]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/: move more state helpers to PeeringState
authorSamuel Just <sjust@redhat.com>
Wed, 3 Apr 2019 23:50:14 +0000 (16:50 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:24 +0000 (11:22 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.h
src/osd/PeeringState.h

index 8a7aa1ed6b4ca54fa710a4d85c5fd706adfcc971..71283d54b83c3351a86959a1c51b23845559f701 100644 (file)
@@ -810,7 +810,7 @@ protected:
 
 public:
   bool is_backfill_targets(pg_shard_t osd) {
-    return backfill_targets.count(osd);
+    return recovery_state.is_backfill_targets(osd);
   }
 
   // Space reserved for backfill is primary_num_bytes - local_num_bytes
@@ -1406,13 +1406,12 @@ protected:
     return recovery_state.should_send_notify();
   }
 
-  int get_state() const { return state; }
   bool is_active() const { return recovery_state.is_active(); }
   bool is_activating() const { return recovery_state.is_activating(); }
   bool is_peering() const { return recovery_state.is_peering(); }
   bool is_down() const { return recovery_state.is_down(); }
-  bool is_recovery_unfound() const { return state_test(PG_STATE_RECOVERY_UNFOUND); }
-  bool is_backfill_unfound() const { return state_test(PG_STATE_BACKFILL_UNFOUND); }
+  bool is_recovery_unfound() const { return recovery_state.is_recovery_unfound(); }
+  bool is_backfill_unfound() const { return recovery_state.is_backfill_unfound(); }
   bool is_incomplete() const { return recovery_state.is_incomplete(); }
   bool is_clean() const { return recovery_state.is_clean(); }
   bool is_degraded() const { return recovery_state.is_degraded(); }
@@ -1420,7 +1419,7 @@ protected:
   bool is_scrubbing() const { return state_test(PG_STATE_SCRUBBING); }
   bool is_remapped() const { return recovery_state.is_remapped(); }
   bool is_peered() const { return recovery_state.is_peered(); }
-  bool is_recovering() const { return state_test(PG_STATE_RECOVERING); }
+  bool is_recovering() const { return recovery_state.is_recovering(); }
   bool is_premerge() const { return recovery_state.is_premerge(); }
   bool is_repair() const { return recovery_state.is_repair(); }
 
index 3720ec31d72964f04094955aa40cb5562c56666c..e7c4adb05574ca4b5f83eeb71fca7059c28f2174 100644 (file)
@@ -1573,6 +1573,10 @@ public:
     return up_primary.osd;
   }
 
+  bool is_backfill_targets(pg_shard_t osd) {
+    return backfill_targets.count(osd);
+  }
+
   bool state_test(uint64_t m) const { return (state & m) != 0; }
   void state_set(uint64_t m) { state |= m; }
   void state_clear(uint64_t m) { state &= ~m; }
@@ -1585,6 +1589,12 @@ public:
   bool is_activating() const { return state_test(PG_STATE_ACTIVATING); }
   bool is_peering() const { return state_test(PG_STATE_PEERING); }
   bool is_down() const { return state_test(PG_STATE_DOWN); }
+  bool is_recovery_unfound() const {
+    return state_test(PG_STATE_RECOVERY_UNFOUND);
+  }
+  bool is_backfill_unfound() const {
+    return state_test(PG_STATE_BACKFILL_UNFOUND);
+  }
   bool is_incomplete() const { return state_test(PG_STATE_INCOMPLETE); }
   bool is_clean() const { return state_test(PG_STATE_CLEAN); }
   bool is_degraded() const { return state_test(PG_STATE_DEGRADED); }
@@ -1593,6 +1603,7 @@ public:
   bool is_peered() const {
     return state_test(PG_STATE_ACTIVE) || state_test(PG_STATE_PEERED);
   }
+  bool is_recovering() const { return state_test(PG_STATE_RECOVERING); }
   bool is_premerge() const { return state_test(PG_STATE_PREMERGE); }
   bool is_repair() const { return state_test(PG_STATE_REPAIR); }
   bool is_empty() const { return info.last_update == eversion_t(0,0); }