From: Sage Weil Date: Wed, 13 Sep 2017 21:30:06 +0000 (-0400) Subject: osd/PG: clean up intrusive_ptr helpers X-Git-Tag: v13.0.1~634^2~64 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ebf2a76bf60f0db7b227aa586ee77e275be3fec;p=ceph.git osd/PG: clean up intrusive_ptr helpers Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b73916563430..ed9b508cd647 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 4698d233aca4..5bd8220ffd97 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;