From: Jason Dillaman Date: Tue, 17 Oct 2017 18:57:08 +0000 (-0400) Subject: librbd: track the child of an image in-memory X-Git-Tag: v12.2.3~85^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2472ec3b956b104717fa23ca5d0dc29cfbc43955;p=ceph.git librbd: track the child of an image in-memory Signed-off-by: Jason Dillaman (cherry picked from commit ce2ae1d7c0f8818c86cbc746921e8eb6b0f89913) --- diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h index 910182a70dd6..ed32ba5a34d8 100644 --- a/src/librbd/ImageCtx.h +++ b/src/librbd/ImageCtx.h @@ -125,6 +125,7 @@ namespace librbd { std::string id; // only used for new-format images ParentInfo parent_md; ImageCtx *parent; + ImageCtx *child = nullptr; cls::rbd::GroupSpec group_spec; uint64_t stripe_unit, stripe_count; uint64_t flags; diff --git a/src/librbd/image/RefreshParentRequest.cc b/src/librbd/image/RefreshParentRequest.cc index 86001da82c60..9ad7ed05d0a2 100644 --- a/src/librbd/image/RefreshParentRequest.cc +++ b/src/librbd/image/RefreshParentRequest.cc @@ -109,6 +109,7 @@ void RefreshParentRequest::send_open_parent() { // reset the snap_name and snap_exists fields after we read the header m_parent_image_ctx = new I("", m_parent_md.spec.image_id, NULL, parent_io_ctx, true); + m_parent_image_ctx->child = &m_child_image_ctx; // set rados flags for reading the parent image if (m_child_image_ctx.balance_parent_reads) {