.set_enum_allowed({"disabled", "rwl", "ssd"})
.set_description("enable persistent write back cache for this volume"),
- Option("rbd_rwl_log_periodic_stats", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ Option("rbd_persistent_cache_log_periodic_stats", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(false)
.set_description("emit periodic perf stats to debug log"),
- Option("rbd_rwl_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+ Option("rbd_persistent_cache_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1073741824)
.set_min(1073741824)
.set_description("size of the persistent write back cache for this volume"),
- Option("rbd_rwl_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+ Option("rbd_persistent_cache_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("/tmp")
.set_description("location of the persistent write back cache in a DAX-enabled filesystem on persistent memory"),
if (!m_cache_state->present) {
m_cache_state->host = ceph_get_short_hostname();
- m_cache_state->size = m_image_ctx.config.template get_val<uint64_t>("rbd_rwl_size");
+ m_cache_state->size = m_image_ctx.config.template get_val<uint64_t>(
+ "rbd_persistent_cache_size");
- string path = m_image_ctx.config.template get_val<string>("rbd_rwl_path");
+ string path = m_image_ctx.config.template get_val<string>(
+ "rbd_persistent_cache_path");
std::string pool_name = m_image_ctx.md_ctx.get_pool_name();
m_cache_state->path = path + "/rbd-pwl." + pool_name + "." + m_image_ctx.id + ".pool";
}
<< dendl;
ConfigProxy &config = image_ctx->config;
- log_periodic_stats = config.get_val<bool>("rbd_rwl_log_periodic_stats");
+ log_periodic_stats = config.get_val<bool>("rbd_persistent_cache_log_periodic_stats");
cache_type = config.get_val<std::string>("rbd_persistent_cache_mode");
}
// Others from config
ConfigProxy &config = image_ctx->config;
- log_periodic_stats = config.get_val<bool>("rbd_rwl_log_periodic_stats");
+ log_periodic_stats = config.get_val<bool>("rbd_persistent_cache_log_periodic_stats");
}
template <typename I>
#include "librbd/ImageCtx.h"
#include "librbd/cache/WriteLogImageDispatch.h"
#include "librbd/cache/ImageWriteback.h"
+#include "librbd/cache/Utils.h"
#include "librbd/cache/pwl/DiscardRequest.h"
#include "librbd/cache/pwl/InitRequest.h"
#include "librbd/io/ImageDispatcherInterface.h"
cache::ImageWritebackInterface& image_writeback,
PluginHookPoints& hook_points_list,
Context* on_finish) {
- bool rwl_enabled = image_ctx->config.template get_val<bool>(
- "rbd_rwl_enabled");
- if (!rwl_enabled || !image_ctx->data_ctx.is_valid()) {
+ bool pwl_enabled = librbd::cache::util::is_pwl_enabled(*image_ctx);
+ if (!pwl_enabled || !image_ctx->data_ctx.is_valid()) {
on_finish->complete(0);
return;
}
ASSERT_EQ(host, state.host);
ASSERT_EQ(path, state.path);
ASSERT_EQ(size, state.size);
- ASSERT_EQ(config.get_val<bool>("rbd_rwl_log_periodic_stats"),
+ ASSERT_EQ(config.get_val<bool>("rbd_persistent_cache_log_periodic_stats"),
state.log_periodic_stats);
}
ASSERT_EQ(host, state.host);
ASSERT_EQ(path, state.path);
ASSERT_EQ(size, state.size);
- ASSERT_EQ(config.get_val<bool>("rbd_rwl_log_periodic_stats"),
+ ASSERT_EQ(config.get_val<bool>("rbd_persistent_cache_log_periodic_stats"),
state.log_periodic_stats);
}
ASSERT_EQ(0, _rados.ioctx_create(_pool_name.c_str(), m_ioctx));
m_cct = reinterpret_cast<CephContext*>(m_ioctx.cct());
librados::Rados rados(m_ioctx);
- rados.conf_set("rbd_rwl_path", ".");
+ rados.conf_set("rbd_persistent_cache_path", ".");
m_image_name = get_temp_image_name();
m_image_size = 2 << 20;