]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Sun, 29 Oct 2017 12:13:27 +0000 (08:13 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.h
src/librbd/image/RefreshParentRequest.cc

index ed77e339d64421377a23c59703f674ea3874f159..830c8900d0a1dc2bbd4f24c0198e1c70d641693e 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) {