]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: start grouping public interface at top of class
authorSage Weil <sage@redhat.com>
Wed, 13 Sep 2017 21:55:40 +0000 (17:55 -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 ed9b508cd6472f7a8b5029b6b2229be8aa7b51d7..2e7c9d32eddd13614c9d4c4f60281215d10c18de 100644 (file)
@@ -277,6 +277,7 @@ void PGPool::update(OSDMapRef map)
 
 PG::PG(OSDService *o, OSDMapRef curmap,
        const PGPool &_pool, spg_t p) :
+  coll(p),
   osd(o),
   cct(o->cct),
   osdriver(osd->store, coll_t(), OSD::make_snapmapper_oid()),
@@ -297,7 +298,6 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   dirty_info(false), dirty_big_info(false),
   info(p),
   info_struct_v(0),
-  coll(p),
   pg_log(cct),
   pgmeta_oid(p.make_pgmeta_oid()),
   missing_loc(this),
index be311f7cfa6047b94ca2484a9218a761c8b94fbb..1841b16a6e270a4ce66170b2e0eb157272029bc1 100644 (file)
@@ -246,9 +246,46 @@ struct PGPool {
 
 class PG : public DoutPrefixProvider {
 public:
+  const coll_t coll;
+  ObjectStore::CollectionHandle ch;
+
+  std::string gen_prefix() const override;
+  CephContext *get_cct() const override { return cct; }
+  unsigned get_subsys() const override { return ceph_subsys_osd; }
+
+  OSDMapRef get_osdmap() const {
+    assert(is_locked());
+    assert(osdmap_ref);
+    return osdmap_ref;
+  }
+
+  void lock_suspend_timeout(ThreadPool::TPHandle &handle) {
+    handle.suspend_tp_timeout();
+    lock();
+    handle.reset_tp_timeout();
+  }
+  void lock(bool no_lockdep = false) const;
+  void unlock() const {
+    //generic_dout(0) << this << " " << info.pgid << " unlock" << dendl;
+    assert(!dirty_info);
+    assert(!dirty_big_info);
+    _lock.Unlock();
+  }
+  bool is_locked() const {
+    return _lock.is_locked();
+  }
+
   bool is_deleting() const {
     return deleting;
   }
+
+  bool is_ec_pg() const {
+    return pool.info.is_erasure();
+  }
+  const vector<int> get_acting() const {
+    return acting;
+  }
+
 protected:
   OSDService *osd;
   CephContext *cct;
@@ -257,10 +294,6 @@ protected:
   bool eio_errors_to_process = false;
 
   virtual PGBackend *get_pgbackend() = 0;
-public:
-  std::string gen_prefix() const override;
-  CephContext *get_cct() const override { return cct; }
-  unsigned get_subsys() const override { return ceph_subsys_osd; }
 
 protected:
   /*** PG ****/
@@ -283,12 +316,6 @@ protected:
     osdmap_ref = std::move(newmap);
   }
 
-public:
-  OSDMapRef get_osdmap() const {
-    assert(is_locked());
-    assert(osdmap_ref);
-    return osdmap_ref;
-  }
 protected:
 
   /** locking and reference counting.
@@ -311,29 +338,10 @@ protected:
   friend void put_with_id(PG *pg, uint64_t id) { return pg->put_with_id(id); }
 #endif
 
-public:
   bool deleting;  // true while in removing or OSD is shutting down
 
   ZTracer::Endpoint trace_endpoint;
 
-  void lock_suspend_timeout(ThreadPool::TPHandle &handle) {
-    handle.suspend_tp_timeout();
-    lock();
-    handle.reset_tp_timeout();
-  }
-
-  void lock(bool no_lockdep = false) const;
-  void unlock() const {
-    //generic_dout(0) << this << " " << info.pgid << " unlock" << dendl;
-    assert(!dirty_info);
-    assert(!dirty_big_info);
-    _lock.Unlock();
-  }
-
-  bool is_locked() const {
-    return _lock.is_locked();
-  }
-
 protected:
 #ifdef PG_DEBUG_REFS
   uint64_t get_with_id();
@@ -356,10 +364,6 @@ private:
 protected:
   bool dirty_info, dirty_big_info;
 
-public:
-  bool is_ec_pg() const {
-    return pool.info.is_erasure();
-  }
 protected:
   // pg state
   pg_info_t info;               ///< current pg info
@@ -380,9 +384,6 @@ protected:
   }
   void upgrade(ObjectStore *store);
 
-public:
-  const coll_t coll;
-  ObjectStore::CollectionHandle ch;
 protected:
   PGLog  pg_log;
   static string get_info_key(spg_t pgid) {
@@ -642,11 +643,6 @@ protected:
 
   set<int> blocked_by; ///< osds we are blocked by (for pg stats)
 
-public:
-  const vector<int> get_acting() const {
-    return acting;
-  }
-
 protected:
   // [primary only] content recovery state
   struct BufferedRecoveryMessages {