]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/Watch.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / osd / Watch.h
index 31d628d769aa58a960f5638c206e7a9c52005bea..65408c276dce22c28ac0c5403bf1ce1b187fd92c 100644 (file)
 #ifndef CEPH_WATCH_H
 #define CEPH_WATCH_H
 
-#include "include/memory.h"
 #include <set>
-
-#include "msg/Messenger.h"
+#include "msg/Connection.h"
 #include "include/Context.h"
 
 enum WatcherState {
@@ -33,12 +31,12 @@ struct ObjectContext;
 class MWatchNotify;
 
 class Watch;
-typedef ceph::shared_ptr<Watch> WatchRef;
-typedef ceph::weak_ptr<Watch> WWatchRef;
+typedef std::shared_ptr<Watch> WatchRef;
+typedef std::weak_ptr<Watch> WWatchRef;
 
 class Notify;
-typedef ceph::shared_ptr<Notify> NotifyRef;
-typedef ceph::weak_ptr<Notify> WNotifyRef;
+typedef std::shared_ptr<Notify> NotifyRef;
+typedef std::weak_ptr<Notify> WNotifyRef;
 
 struct CancelableContext;
 
@@ -99,12 +97,10 @@ class Notify {
   void unregister_cb();
 public:
 
-  string gen_dbg_prefix() {
-    stringstream ss;
-    ss << "Notify(" << make_pair(cookie, notify_id) << " "
-       << " watchers=" << watchers.size()
-       << ") ";
-    return ss.str();
+  std::ostream& gen_dbg_prefix(std::ostream& out) {
+    return out << "Notify(" << make_pair(cookie, notify_id) << " "
+        << " watchers=" << watchers.size()
+        << ") ";
   }
   void set_self(NotifyRef _self) {
     self = _self;
@@ -157,7 +153,7 @@ class Watch {
 
   OSDService *osd;
   boost::intrusive_ptr<PrimaryLogPG> pg;
-  ceph::shared_ptr<ObjectContext> obc;
+  std::shared_ptr<ObjectContext> obc;
 
   std::map<uint64_t, NotifyRef> in_progress_notifies;
 
@@ -167,14 +163,14 @@ class Watch {
   entity_addr_t addr;
 
   bool will_ping;    ///< is client new enough to ping the watch
-  utime_t last_ping; ///< last cilent ping
+  utime_t last_ping; ///< last client ping
 
   entity_name_t entity;
   bool discarded;
 
   Watch(
     PrimaryLogPG *pg, OSDService *osd,
-    ceph::shared_ptr<ObjectContext> obc, uint32_t timeout,
+    std::shared_ptr<ObjectContext> obc, uint32_t timeout,
     uint64_t cookie, entity_name_t entity,
     const entity_addr_t& addr);
 
@@ -210,10 +206,10 @@ public:
     return entity.num();
   }
 
-  string gen_dbg_prefix();
+  std::ostream& gen_dbg_prefix(std::ostream& out);
   static WatchRef makeWatchRef(
     PrimaryLogPG *pg, OSDService *osd,
-    ceph::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
+    std::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
   void set_self(WatchRef _self) {
     self = _self;
   }
@@ -221,7 +217,7 @@ public:
   /// Does not grant a ref count!
   boost::intrusive_ptr<PrimaryLogPG> get_pg() { return pg; }
 
-  ceph::shared_ptr<ObjectContext> get_obc() { return obc; }
+  std::shared_ptr<ObjectContext> get_obc() { return obc; }
 
   uint64_t get_cookie() const { return cookie; }
   entity_name_t get_entity() const { return entity; }
@@ -278,7 +274,7 @@ class WatchConState {
   std::set<WatchRef> watches;
 public:
   CephContext* cct;
-  WatchConState(CephContext* cct) : lock("WatchConState"), cct(cct) {}
+  explicit WatchConState(CephContext* cct) : lock("WatchConState"), cct(cct) {}
 
   /// Add a watch
   void addWatch(