]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: track the child of an image in-memory
authorJason Dillaman <dillaman@redhat.com>
Tue, 17 Oct 2017 18:57:08 +0000 (14:57 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 31 Jan 2018 16:41:28 +0000 (11:41 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit ce2ae1d7c0f8818c86cbc746921e8eb6b0f89913)

src/librbd/ImageCtx.h
src/librbd/image/RefreshParentRequest.cc

index 910182a70dd6412a1e71e713e1505d730d0a2ea8..ed32ba5a34d8d5f10267a5efa870ea13cc7e928c 100644 (file)
@@ -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;
index 86001da82c60a490fdc2207ed328da3965e352de..9ad7ed05d0a2c2961f9f96c6f779eb15f59c50a0 100644 (file)
@@ -109,6 +109,7 @@ void RefreshParentRequest<I>::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) {