]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: allow watcher derived classes access ioctx, oid and work queue
authorMykola Golub <mgolub@mirantis.com>
Thu, 24 Nov 2016 08:05:34 +0000 (10:05 +0200)
committerMykola Golub <mgolub@mirantis.com>
Wed, 1 Feb 2017 09:55:03 +0000 (10:55 +0100)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/Watcher.cc
src/librbd/Watcher.h

index 6b3af958fb79d426336df47dd4d6ac9ba88a667a..528a7c22201ad164baf72a68a55c1dae017fd4d9 100644 (file)
@@ -67,16 +67,14 @@ struct C_UnwatchAndFlush : public Context {
 
 Watcher::Watcher(librados::IoCtx& ioctx, ContextWQ *work_queue,
                           const string& oid)
-  : m_cct(reinterpret_cast<CephContext *>(ioctx.cct())),
+  : m_ioctx(ioctx), m_work_queue(work_queue), m_oid(oid),
+    m_cct(reinterpret_cast<CephContext *>(ioctx.cct())),
     m_watch_lock(util::unique_lock_name("librbd::Watcher::m_watch_lock", this)),
     m_watch_handle(0), m_notifier(work_queue, ioctx, oid),
-    m_watch_state(WATCH_STATE_UNREGISTERED), m_ioctx(ioctx),
-    m_work_queue(work_queue), m_oid(oid), m_watch_ctx(*this)
-{
+    m_watch_state(WATCH_STATE_UNREGISTERED), m_watch_ctx(*this) {
 }
 
-Watcher::~Watcher()
-{
+Watcher::~Watcher() {
   RWLock::RLocker l(m_watch_lock);
   assert(m_watch_state != WATCH_STATE_REGISTERED);
 }
index 21a59c886f187b833ef742dfc7823617105c3e5c..04806f2d91cddcee2ab7b40f74fc372c08470e7b 100644 (file)
@@ -48,6 +48,9 @@ protected:
     WATCH_STATE_REWATCHING
   };
 
+  librados::IoCtx& m_ioctx;
+  ContextWQ *m_work_queue;
+  std::string m_oid;
   CephContext *m_cct;
   mutable RWLock m_watch_lock;
   uint64_t m_watch_handle;
@@ -124,10 +127,6 @@ private:
     }
   };
 
-  librados::IoCtx& m_ioctx;
-  ContextWQ *m_work_queue;
-  std::string m_oid;
-
   WatchCtx m_watch_ctx;
   Context *m_unregister_watch_ctx = nullptr;