]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: clean up intrusive_ptr helpers
authorSage Weil <sage@redhat.com>
Wed, 13 Sep 2017 21:30:06 +0000 (17:30 -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.cc
src/osd/PG.h

index b7391656343064cb78812820de1cdb3eae66e357..ed9b508cd6472f7a8b5029b6b2229be8aa7b51d7 100644 (file)
@@ -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
index 4698d233aca40cd2fe6329724a6e60322af438c0..5bd8220ffd97d21f1be9204f1aecb247e6f4efb4 100644 (file)
@@ -52,9 +52,6 @@
 #include <tuple>
 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<utime_t, utime_t, const char*>;
 using embedded_state = std::pair<utime_t, const char*>;
 
@@ -308,6 +302,9 @@ protected:
   map<uint64_t, string> _live_ids;
   map<string, uint64_t> _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;