From: Jason Dillaman Date: Wed, 29 Nov 2017 20:45:24 +0000 (-0500) Subject: librbd: incorporate new trash notification messages X-Git-Tag: v13.0.2~714^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a40d7ca62ec119ef645bd5e501c99f4f8f58f95;p=ceph.git librbd: incorporate new trash notification messages Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 69cfda50b963..78aeff794387 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -28,6 +28,7 @@ #include "librbd/Journal.h" #include "librbd/ObjectMap.h" #include "librbd/Operations.h" +#include "librbd/TrashWatcher.h" #include "librbd/Types.h" #include "librbd/Utils.h" #include "librbd/api/Image.h" @@ -1408,6 +1409,15 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2) return r; } + C_SaferCond notify_ctx; + TrashWatcher<>::notify_image_added(io_ctx, image_id, trash_image_spec, + ¬ify_ctx); + r = notify_ctx.wait(); + if (r < 0) { + lderr(cct) << "failed to send update notification: " << cpp_strerror(r) + << dendl; + } + return 0; } @@ -1502,6 +1512,15 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2) << " from rbd_trash object" << dendl; return r; } + + C_SaferCond notify_ctx; + TrashWatcher<>::notify_image_removed(io_ctx, image_id, ¬ify_ctx); + r = notify_ctx.wait(); + if (r < 0) { + lderr(cct) << "failed to send update notification: " << cpp_strerror(r) + << dendl; + } + return 0; } @@ -1574,6 +1593,14 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2) return r; } + C_SaferCond notify_ctx; + TrashWatcher<>::notify_image_removed(io_ctx, image_id, ¬ify_ctx); + r = notify_ctx.wait(); + if (r < 0) { + lderr(cct) << "failed to send update notification: " << cpp_strerror(r) + << dendl; + } + return 0; }