From: Sage Weil Date: Fri, 15 Sep 2017 15:37:29 +0000 (-0400) Subject: osd/PG: cleanup and move ref counting public bits X-Git-Tag: v13.0.1~634^2~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89213014187cd320a1a93888cafc359bd9f90a9a;p=ceph.git osd/PG: cleanup and move ref counting public bits Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.h b/src/osd/PG.h index e8f11eb24e13..3d5bb81c52d3 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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"); diff --git a/src/osd/Session.h b/src/osd/Session.h index 040d97be2f54..7b29f80acd6c 100644 --- a/src/osd/Session.h +++ b/src/osd/Session.h @@ -22,6 +22,8 @@ #include "Watch.h" #include "OSDMap.h" +//#define PG_DEBUG_REFS + struct Session; typedef boost::intrusive_ptr SessionRef; struct Backoff;