ASSIGN_OPTION(skip_partial_discard, bool);
ASSIGN_OPTION(discard_granularity_bytes, uint64_t);
ASSIGN_OPTION(blkin_trace_all, bool);
- ASSIGN_OPTION(parent_cache_enabled, bool);
#undef ASSIGN_OPTION
uint64_t mtime_update_interval;
uint64_t atime_update_interval;
- bool parent_cache_enabled;
- std::string shared_cache_path;
-
LibrbdAdminSocketHook *asok_hook;
exclusive_lock::Policy *exclusive_lock_policy = nullptr;
if (reg) {
ldout(cct, 20) << "Parent cache open cache handler" << dendl;
- m_object_store = new SharedPersistentObjectCacher(m_image_ctx, m_image_ctx->shared_cache_path);
+ m_object_store = new SharedPersistentObjectCacher(m_image_ctx);
}
return 0;
}
template <typename I>
ParentCacheObjectDispatch<I>::SharedPersistentObjectCacher::SharedPersistentObjectCacher (
- I *image_ctx, std::string cache_path)
- : m_image_ctx(image_ctx) {
+ I *image_ctx) : m_image_ctx(image_ctx) {
auto *cct = m_image_ctx->cct;
ldout(cct, 20) << dendl;
}
class SharedPersistentObjectCacher {
public:
- SharedPersistentObjectCacher(ImageCtxT *image_ctx, std::string cache_path);
+ SharedPersistentObjectCacher(ImageCtxT *image_ctx);
~SharedPersistentObjectCacher();
int read_object(std::string file_path, ceph::bufferlist* read_data,
if (!m_image_ctx->cache || m_image_ctx->child != nullptr) {
// enable Shared Read-only cache for parent image
- if (m_image_ctx->child != nullptr && m_image_ctx->parent_cache_enabled ) {
+ bool parent_cache_enabled = m_image_ctx->config.template get_val<bool>(
+ "rbd_parent_cache_enabled");
+ if (m_image_ctx->child != nullptr && parent_cache_enabled ) {
ldout(cct, 10) << this << " " << "setting up parent cache"<< dendl;
auto sro_cache = cache::ParentCacheObjectDispatch<I>::create(m_image_ctx);
sro_cache->init();