From 89213014187cd320a1a93888cafc359bd9f90a9a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Sep 2017 11:37:29 -0400 Subject: [PATCH] osd/PG: cleanup and move ref counting public bits Signed-off-by: Sage Weil --- src/osd/PG.h | 24 +++++++++++++----------- src/osd/Session.h | 2 ++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index e8f11eb24e1..3d5bb81c52d 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 040d97be2f5..7b29f80acd6 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; -- 2.39.5