template <typename I>
void ParentCache<I>::init(I* image_ctx, Api<I>& api, HookPoints* hook_points,
Context* on_finish) {
- m_image_ctx = image_ctx;
- bool parent_cache_enabled = m_image_ctx->config.template get_val<bool>(
+ bool parent_cache_enabled = image_ctx->config.template get_val<bool>(
"rbd_parent_cache_enabled");
- if (m_image_ctx->child == nullptr || !parent_cache_enabled ||
- !m_image_ctx->data_ctx.is_valid()) {
+ if (image_ctx->child == nullptr || !parent_cache_enabled ||
+ !image_ctx->data_ctx.is_valid()) {
on_finish->complete(0);
return;
}
- auto cct = m_image_ctx->cct;
+ auto cct = image_ctx->cct;
ldout(cct, 5) << dendl;
auto parent_cache = cache::ParentCacheObjectDispatch<I>::create(
- m_image_ctx, api);
+ image_ctx, api);
on_finish = new LambdaContext([this, on_finish, parent_cache](int r) {
if (r < 0) {
// the object dispatcher will handle cleanup if successfully initialized
template <typename I>
void ParentCache<I>::handle_init_parent_cache(int r, Context* on_finish) {
- auto cct = m_image_ctx->cct;
ldout(cct, 5) << "r=" << r << dendl;
if (r < 0) {
Context* on_finish) override;
private:
- ImageCtxT* m_image_ctx = nullptr;
-
void handle_init_parent_cache(int r, Context* on_finish);
+ using ceph::Plugin::cct;
};