]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: cleanup and move ref counting public bits
authorSage Weil <sage@redhat.com>
Fri, 15 Sep 2017 15:37:29 +0000 (11:37 -0400)
committerSage Weil <sage@redhat.com>
Fri, 6 Oct 2017 18:08:17 +0000 (13:08 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.h
src/osd/Session.h

index e8f11eb24e1399928c901389bd40d37987dc5f2f..3d5bb81c52d3d90405bc64c1842be1010ff2b332 100644 (file)
@@ -53,6 +53,7 @@
 using namespace std;
 
 //#define DEBUG_RECOVERY_OIDS   // track set of recovering oids explicitly, to find counting bugs
+//#define PG_DEBUG_REFS    // track provenance of pg refs, helpful for finding leaks
 
 class OSD;
 class OSDService;
@@ -398,6 +399,18 @@ public:
   virtual void agent_choose_mode_restart() = 0;
 
 
+  // reference counting
+#ifdef PG_DEBUG_REFS
+  uint64_t get_with_id();
+  void put_with_id(uint64_t);
+  void dump_live_ids();
+#endif
+
+  void get(const char* tag);
+  void put(const char* tag);
+
+
+
 protected:
   OSDService *osd;
   CephContext *cct;
@@ -454,17 +467,6 @@ protected:
 
   ZTracer::Endpoint trace_endpoint;
 
-protected:
-#ifdef PG_DEBUG_REFS
-  uint64_t get_with_id();
-  void put_with_id(uint64_t);
-  void dump_live_ids();
-#endif
-
-public:
-  void get(const char* tag);
-  void put(const char* tag);
-
 private:
   friend void intrusive_ptr_add_ref(PG *pg) {
     pg->get("intptr");
index 040d97be2f54db1790b0e75b99cea9b2c20f6728..7b29f80acd6cefbfe764c10c6c97328b80c5ae38 100644 (file)
@@ -22,6 +22,8 @@
 #include "Watch.h"
 #include "OSDMap.h"
 
+//#define PG_DEBUG_REFS
+
 struct Session;
 typedef boost::intrusive_ptr<Session> SessionRef;
 struct Backoff;