]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: use accessors for pg resurrection
authorSage Weil <sage@redhat.com>
Mon, 18 Sep 2017 02:17:36 +0000 (21:17 -0500)
committerSage Weil <sage@redhat.com>
Fri, 6 Oct 2017 18:08:18 +0000 (13:08 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/PG.h

index 4a9b053c6d15a49505387695b4513112dcd9aaa4..63b2ccabf0da21581da902338310167f3c88eff3 100644 (file)
@@ -4040,13 +4040,13 @@ int OSD::handle_pg_peering_evt(
     case RES_SELF: {
       old_pg_state->lock();
       OSDMapRef old_osd_map = old_pg_state->get_osdmap();
-      int old_role = old_pg_state->role;
-      vector<int> old_up = old_pg_state->up;
-      int old_up_primary = old_pg_state->up_primary.osd;
-      vector<int> old_acting = old_pg_state->acting;
-      int old_primary = old_pg_state->primary.osd;
-      pg_history_t old_history = old_pg_state->info.history;
-      PastIntervals old_past_intervals = old_pg_state->past_intervals;
+      int old_role = old_pg_state->get_role();
+      vector<int> old_up = old_pg_state->get_up();
+      int old_up_primary = old_pg_state->get_up_primary();
+      vector<int> old_acting = old_pg_state->get_acting();
+      int old_primary = old_pg_state->get_acting_primary();
+      pg_history_t old_history = old_pg_state->get_history();
+      PastIntervals old_past_intervals = old_pg_state->get_past_intervals();
       old_pg_state->unlock();
       pg = _create_lock_pg(
        old_osd_map,
@@ -4075,13 +4075,13 @@ int OSD::handle_pg_peering_evt(
       assert(old_pg_state);
       old_pg_state->lock();
       OSDMapRef old_osd_map = old_pg_state->get_osdmap();
-      int old_role = old_pg_state->role;
-      vector<int> old_up = old_pg_state->up;
-      int old_up_primary = old_pg_state->up_primary.osd;
-      vector<int> old_acting = old_pg_state->acting;
-      int old_primary = old_pg_state->primary.osd;
-      pg_history_t old_history = old_pg_state->info.history;
-      PastIntervals old_past_intervals = old_pg_state->past_intervals;
+      int old_role = old_pg_state->get_role();
+      vector<int> old_up = old_pg_state->get_up();
+      int old_up_primary = old_pg_state->get_up_primary();
+      vector<int> old_acting = old_pg_state->get_acting();
+      int old_primary = old_pg_state->get_acting_primary();
+      pg_history_t old_history = old_pg_state->get_history();
+      PastIntervals old_past_intervals = old_pg_state->get_past_intervals();
       old_pg_state->unlock();
       PG *parent = _create_lock_pg(
        old_osd_map,
index c9c362ab45bea53c85302674e3631352a9988493..f8227cfd1ec5faf29635259ac40d968f420bc090 100644 (file)
@@ -354,9 +354,24 @@ public:
   bool is_ec_pg() const {
     return pool.info.is_erasure();
   }
+  int get_role() const {
+    return role;
+  }
   const vector<int> get_acting() const {
     return acting;
   }
+  int get_acting_primary() const {
+    return primary.osd;
+  }
+  const vector<int> get_up() const {
+    return up;
+  }
+  int get_up_primary() const {
+    return up_primary.osd;
+  }
+  const PastIntervals& get_past_intervals() const {
+    return past_intervals;
+  }
 
   /// initialize created PG
   void init(
@@ -2510,9 +2525,6 @@ protected:
   }
   pg_shard_t get_primary() const { return primary; }
 
-  int get_role() const {
-    return role;
-  }
   void set_role(int r) {
     role = r;
   }