From 7ebf2a76bf60f0db7b227aa586ee77e275be3fec Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Sep 2017 17:30:06 -0400 Subject: [PATCH] osd/PG: clean up intrusive_ptr helpers Signed-off-by: Sage Weil --- src/osd/PG.cc | 8 -------- src/osd/PG.h | 17 +++++++++++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b7391656343..ed9b508cd64 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -8124,11 +8124,3 @@ ostream& operator<<(ostream& out, const PG::BackfillInterval& bi) out << ")"; return out; } - -void intrusive_ptr_add_ref(PG *pg) { pg->get("intptr"); } -void intrusive_ptr_release(PG *pg) { pg->put("intptr"); } - -#ifdef PG_DEBUG_REFS - uint64_t get_with_id(PG *pg) { return pg->get_with_id(); } - void put_with_id(PG *pg, uint64_t id) { return pg->put_with_id(id); } -#endif diff --git a/src/osd/PG.h b/src/osd/PG.h index 4698d233aca..5bd8220ffd9 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -52,9 +52,6 @@ #include using namespace std; -// #include "include/unordered_map.h" -// #include "include/unordered_set.h" - //#define DEBUG_RECOVERY_OIDS // track set of recovering oids explicitly, to find counting bugs class OSD; @@ -74,9 +71,6 @@ namespace Scrub { class Store; } -void intrusive_ptr_add_ref(PG *pg); -void intrusive_ptr_release(PG *pg); - using state_history_entry = std::tuple; using embedded_state = std::pair; @@ -308,6 +302,9 @@ protected: map _live_ids; map _tag_counts; uint64_t _ref_id; + + friend uint64_t get_with_id(PG *pg) { return pg->get_with_id(); } + friend void put_with_id(PG *pg, uint64_t id) { return pg->put_with_id(id); } #endif public: @@ -344,6 +341,14 @@ public: void get(const char* tag); void put(const char* tag); +private: + friend void intrusive_ptr_add_ref(PG *pg) { + pg->get("intptr"); + } + friend void intrusive_ptr_release(PG *pg) { + pg->put("intptr"); + } + protected: bool dirty_info, dirty_big_info; -- 2.39.5