]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: rename librbd::WatchNotify namespace to librbd::watch_notify
authorJason Dillaman <dillaman@redhat.com>
Thu, 30 Jul 2015 18:34:57 +0000 (14:34 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 19 Nov 2015 01:34:37 +0000 (20:34 -0500)
The new namespace follows the expected naming conventions.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageWatcher.cc
src/librbd/ImageWatcher.h
src/librbd/WatchNotifyTypes.cc
src/librbd/WatchNotifyTypes.h
src/test/encoding/types.h
src/test/librbd/test_ImageWatcher.cc

index d884617bb43470e132bac8f57efff195336ab9b8..0065cac9348f966b4a51d4c7f205b56adc4ba8a7 100644 (file)
@@ -22,7 +22,7 @@
 
 namespace librbd {
 
-using namespace WatchNotify;
+using namespace watch_notify;
 
 static const std::string WATCHER_LOCK_TAG = "internal";
 static const std::string WATCHER_LOCK_COOKIE_PREFIX = "auto";
@@ -625,7 +625,7 @@ void ImageWatcher::cancel_async_requests() {
   m_async_requests.clear();
 }
 
-void ImageWatcher::set_owner_client_id(const WatchNotify::ClientId& client_id) {
+void ImageWatcher::set_owner_client_id(const ClientId& client_id) {
   assert(m_owner_client_id_lock.is_locked());
   m_owner_client_id = client_id;
   ldout(m_image_ctx.cct, 10) << this << " current lock owner: "
index 2b3da278e796ffd2c6faed0a3135b20be4bb2c09..2611b552177b2009ad59e8b82f91b2b9ebc65c30 100644 (file)
@@ -107,7 +107,7 @@ private:
   class Task {
   public:
     Task(TaskCode task_code) : m_task_code(task_code) {}
-    Task(TaskCode task_code, const WatchNotify::AsyncRequestId &id)
+    Task(TaskCode task_code, const watch_notify::AsyncRequestId &id)
       : m_task_code(task_code), m_async_request_id(id) {}
 
     inline bool operator<(const Task& rhs) const {
@@ -122,7 +122,7 @@ private:
     }
   private:
     TaskCode m_task_code;
-    WatchNotify::AsyncRequestId m_async_request_id;
+    watch_notify::AsyncRequestId m_async_request_id;
   };
 
   struct WatchCtx : public librados::WatchCtx2 {
@@ -140,7 +140,7 @@ private:
   class RemoteProgressContext : public ProgressContext {
   public:
     RemoteProgressContext(ImageWatcher &image_watcher,
-                          const WatchNotify::AsyncRequestId &id)
+                          const watch_notify::AsyncRequestId &id)
       : m_image_watcher(image_watcher), m_async_request_id(id)
     {
     }
@@ -153,14 +153,14 @@ private:
 
   private:
     ImageWatcher &m_image_watcher;
-    WatchNotify::AsyncRequestId m_async_request_id;
+    watch_notify::AsyncRequestId m_async_request_id;
   };
 
   class RemoteContext : public Context {
   public:
     RemoteContext(ImageWatcher &image_watcher,
-                  const WatchNotify::AsyncRequestId &id,
-                  ProgressContext *prog_ctx)
+                 const watch_notify::AsyncRequestId &id,
+                 ProgressContext *prog_ctx)
       : m_image_watcher(image_watcher), m_async_request_id(id),
         m_prog_ctx(prog_ctx)
     {
@@ -174,7 +174,7 @@ private:
 
   private:
     ImageWatcher &m_image_watcher;
-    WatchNotify::AsyncRequestId m_async_request_id;
+    watch_notify::AsyncRequestId m_async_request_id;
     ProgressContext *m_prog_ctx;
   };
 
@@ -189,7 +189,7 @@ private:
     {
     }
 
-    inline void operator()(const WatchNotify::HeaderUpdatePayload &payload) const {
+    inline void operator()(const watch_notify::HeaderUpdatePayload &payload) const {
       bufferlist out;
       image_watcher->handle_payload(payload, &out);
       image_watcher->acknowledge_notify(notify_id, handle, out);
@@ -222,11 +222,11 @@ private:
   TaskFinisher<Task> *m_task_finisher;
 
   RWLock m_async_request_lock;
-  std::map<WatchNotify::AsyncRequestId, AsyncRequest> m_async_requests;
-  std::set<WatchNotify::AsyncRequestId> m_async_pending;
+  std::map<watch_notify::AsyncRequestId, AsyncRequest> m_async_requests;
+  std::set<watch_notify::AsyncRequestId> m_async_pending;
 
   Mutex m_owner_client_id_lock;
-  WatchNotify::ClientId m_owner_client_id;
+  watch_notify::ClientId m_owner_client_id;
 
   std::string encode_lock_cookie() const;
   static bool decode_lock_cookie(const std::string &cookie, uint64_t *handle);
@@ -240,8 +240,8 @@ private:
   void schedule_cancel_async_requests();
   void cancel_async_requests();
 
-  void set_owner_client_id(const WatchNotify::ClientId &client_id);
-  WatchNotify::ClientId get_client_id();
+  void set_owner_client_id(const watch_notify::ClientId &client_id);
+  watch_notify::ClientId get_client_id();
 
   void notify_acquired_lock();
   void notify_release_lock();
@@ -252,50 +252,50 @@ private:
 
   int notify_lock_owner(bufferlist &bl);
 
-  void schedule_async_request_timed_out(const WatchNotify::AsyncRequestId &id);
-  void async_request_timed_out(const WatchNotify::AsyncRequestId &id);
-  int notify_async_request(const WatchNotify::AsyncRequestId &id,
+  void schedule_async_request_timed_out(const watch_notify::AsyncRequestId &id);
+  void async_request_timed_out(const watch_notify::AsyncRequestId &id);
+  int notify_async_request(const watch_notify::AsyncRequestId &id,
                            bufferlist &in, ProgressContext& prog_ctx);
   void notify_request_leadership();
 
-  void schedule_async_progress(const WatchNotify::AsyncRequestId &id,
+  void schedule_async_progress(const watch_notify::AsyncRequestId &id,
                                uint64_t offset, uint64_t total);
-  int notify_async_progress(const WatchNotify::AsyncRequestId &id,
+  int notify_async_progress(const watch_notify::AsyncRequestId &id,
                             uint64_t offset, uint64_t total);
-  void schedule_async_complete(const WatchNotify::AsyncRequestId &id, int r);
-  int notify_async_complete(const WatchNotify::AsyncRequestId &id, int r);
+  void schedule_async_complete(const watch_notify::AsyncRequestId &id, int r);
+  int notify_async_complete(const watch_notify::AsyncRequestId &id, int r);
 
-  int prepare_async_request(const WatchNotify::AsyncRequestId& id,
+  int prepare_async_request(const watch_notify::AsyncRequestId& id,
                             bool* new_request, Context** ctx,
                             ProgressContext** prog_ctx);
-  void cleanup_async_request(const WatchNotify::AsyncRequestId& id,
+  void cleanup_async_request(const watch_notify::AsyncRequestId& id,
                              Context *ctx);
 
-  void handle_payload(const WatchNotify::HeaderUpdatePayload& payload,
+  void handle_payload(const watch_notify::HeaderUpdatePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::AcquiredLockPayload& payload,
+  void handle_payload(const watch_notify::AcquiredLockPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::ReleasedLockPayload& payload,
+  void handle_payload(const watch_notify::ReleasedLockPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::RequestLockPayload& payload,
+  void handle_payload(const watch_notify::RequestLockPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::AsyncProgressPayload& payload,
+  void handle_payload(const watch_notify::AsyncProgressPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::AsyncCompletePayload& payload,
+  void handle_payload(const watch_notify::AsyncCompletePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::FlattenPayload& payload,
+  void handle_payload(const watch_notify::FlattenPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::ResizePayload& payload,
+  void handle_payload(const watch_notify::ResizePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::SnapCreatePayload& payload,
+  void handle_payload(const watch_notify::SnapCreatePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::SnapRenamePayload& payload,
+  void handle_payload(const watch_notify::SnapRenamePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::SnapRemovePayload& payload,
+  void handle_payload(const watch_notify::SnapRemovePayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::RebuildObjectMapPayload& payload,
+  void handle_payload(const watch_notify::RebuildObjectMapPayload& payload,
                       bufferlist *out);
-  void handle_payload(const WatchNotify::UnknownPayload& payload,
+  void handle_payload(const watch_notify::UnknownPayload& payload,
                       bufferlist *out);
 
   void handle_notify(uint64_t notify_id, uint64_t handle, bufferlist &bl);
index af2e434d3afa21ca6420db1e7103e1c71784199b..a21b233937d483f4066a9974aa8170960de6e23a 100644 (file)
@@ -7,7 +7,7 @@
 #include "common/Formatter.h"
 
 namespace librbd {
-namespace WatchNotify {
+namespace watch_notify {
 
 namespace {
 
@@ -373,12 +373,12 @@ void ResponseMessage::generate_test_instances(std::list<ResponseMessage *> &o) {
   o.push_back(new ResponseMessage(1));
 }
 
-} // namespace WatchNotify
+} // namespace watch_notify
 } // namespace librbd
 
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::NotifyOp &op) {
-  using namespace librbd::WatchNotify;
+                         const librbd::watch_notify::NotifyOp &op) {
+  using namespace librbd::watch_notify;
 
   switch (op) {
   case NOTIFY_OP_ACQUIRED_LOCK:
@@ -425,13 +425,13 @@ std::ostream &operator<<(std::ostream &out,
 }
 
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::ClientId &client_id) {
+                         const librbd::watch_notify::ClientId &client_id) {
   out << "[" << client_id.gid << "," << client_id.handle << "]";
   return out;
 }
 
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::AsyncRequestId &request) {
+                         const librbd::watch_notify::AsyncRequestId &request) {
   out << "[" << request.client_id.gid << "," << request.client_id.handle << ","
       << request.request_id << "]";
   return out;
index eaa3305e021c4b8b6f26bdb633ff359812c4f984..e7ba50d32e3aebd99ee50a870c974d7b0bebe11c 100644 (file)
@@ -16,7 +16,7 @@ class Formatter;
 }
 
 namespace librbd {
-namespace WatchNotify {
+namespace watch_notify {
 
 struct ClientId {
   uint64_t gid;
@@ -295,19 +295,19 @@ struct ResponseMessage {
   static void generate_test_instances(std::list<ResponseMessage *> &o);
 };
 
-} // namespace WatchNotify
+} // namespace watch_notify
 } // namespace librbd
 
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::NotifyOp &op);
+                         const librbd::watch_notify::NotifyOp &op);
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::ClientId &client);
+                         const librbd::watch_notify::ClientId &client);
 std::ostream &operator<<(std::ostream &out,
-                         const librbd::WatchNotify::AsyncRequestId &request);
+                         const librbd::watch_notify::AsyncRequestId &request);
 
-WRITE_CLASS_ENCODER(librbd::WatchNotify::ClientId);
-WRITE_CLASS_ENCODER(librbd::WatchNotify::AsyncRequestId);
-WRITE_CLASS_ENCODER(librbd::WatchNotify::NotifyMessage);
-WRITE_CLASS_ENCODER(librbd::WatchNotify::ResponseMessage);
+WRITE_CLASS_ENCODER(librbd::watch_notify::ClientId);
+WRITE_CLASS_ENCODER(librbd::watch_notify::AsyncRequestId);
+WRITE_CLASS_ENCODER(librbd::watch_notify::NotifyMessage);
+WRITE_CLASS_ENCODER(librbd::watch_notify::ResponseMessage);
 
 #endif // LIBRBD_WATCH_NOTIFY_TYPES_H
index a9dbc9bf7b7dd43eea53734f2541711a87559734..35b7e16b977b176a176d83f5969f0b720302c7da 100644 (file)
@@ -229,8 +229,8 @@ TYPE(EUpdate)
 #include "librbd/JournalTypes.h"
 TYPE(librbd::journal::EventEntry)
 #include "librbd/WatchNotifyTypes.h"
-TYPE(librbd::WatchNotify::NotifyMessage)
-TYPE(librbd::WatchNotify::ResponseMessage)
+TYPE(librbd::watch_notify::NotifyMessage)
+TYPE(librbd::watch_notify::ResponseMessage)
 
 #include "rbd_replay/ActionTypes.h"
 TYPE(rbd_replay::action::Dependency)
index 0f137fe6cbccbada144cb0cc7db6d10de71dbd0f..e8ad76ed37c7283158cdbf977c0a68bb3f4dacaf 100644 (file)
@@ -33,7 +33,7 @@
 
 using namespace ceph;
 using namespace boost::assign;
-using namespace librbd::WatchNotify;
+using namespace librbd::watch_notify;
 
 void register_test_image_watcher() {
 }