X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FMirrorStatusWatcher.cc;fp=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FMirrorStatusWatcher.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=ed752ba04dffc5bf48e839fde2b7f277a524d130;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/tools/rbd_mirror/MirrorStatusWatcher.cc b/src/ceph/src/tools/rbd_mirror/MirrorStatusWatcher.cc deleted file mode 100644 index ed752ba..0000000 --- a/src/ceph/src/tools/rbd_mirror/MirrorStatusWatcher.cc +++ /dev/null @@ -1,74 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#include "MirrorStatusWatcher.h" -#include "common/debug.h" -#include "common/errno.h" -#include "cls/rbd/cls_rbd_client.h" -#include "librbd/Utils.h" - -#define dout_context g_ceph_context -#define dout_subsys ceph_subsys_rbd_mirror -#undef dout_prefix -#define dout_prefix *_dout << "rbd::mirror::MirrorStatusWatcher: " \ - << this << " " << __func__ << ": " - -namespace rbd { -namespace mirror { - -using librbd::util::create_rados_callback; - -template -MirrorStatusWatcher::MirrorStatusWatcher(librados::IoCtx &io_ctx, - ContextWQ *work_queue) - : Watcher(io_ctx, work_queue, RBD_MIRRORING) { -} - -template -MirrorStatusWatcher::~MirrorStatusWatcher() { -} - -template -void MirrorStatusWatcher::init(Context *on_finish) { - dout(20) << dendl; - - on_finish = new FunctionContext( - [this, on_finish] (int r) { - if (r < 0) { - derr << "error removing down statuses: " << cpp_strerror(r) << dendl; - on_finish->complete(r); - return; - } - register_watch(on_finish); - }); - - librados::ObjectWriteOperation op; - librbd::cls_client::mirror_image_status_remove_down(&op); - librados::AioCompletion *aio_comp = create_rados_callback(on_finish); - - int r = m_ioctx.aio_operate(RBD_MIRRORING, aio_comp, &op); - assert(r == 0); - aio_comp->release(); -} - -template -void MirrorStatusWatcher::shut_down(Context *on_finish) { - dout(20) << dendl; - - unregister_watch(on_finish); -} - -template -void MirrorStatusWatcher::handle_notify(uint64_t notify_id, uint64_t handle, - uint64_t notifier_id, - bufferlist &bl) { - dout(20) << dendl; - - bufferlist out; - acknowledge_notify(notify_id, handle, out); -} - -} // namespace mirror -} // namespace rbd - -template class rbd::mirror::MirrorStatusWatcher;