diff options
author | Samuel Just <sjust@redhat.com> | 2019-04-04 01:50:14 +0200 |
---|---|---|
committer | sjust@redhat.com <sjust@redhat.com> | 2019-05-01 20:22:24 +0200 |
commit | 726894353f5ba01d74870e7917270c7b5a3ce1cc (patch) | |
tree | 0ffaef5532f56c45d3e4fab701ed54133e55584f /src | |
parent | osd/: move split/merge helpers into PeeringState (diff) | |
download | ceph-726894353f5ba01d74870e7917270c7b5a3ce1cc.tar.xz ceph-726894353f5ba01d74870e7917270c7b5a3ce1cc.zip |
osd/: move more state helpers to PeeringState
Signed-off-by: Samuel Just <sjust@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/osd/PG.h | 9 | ||||
-rw-r--r-- | src/osd/PeeringState.h | 11 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/osd/PG.h b/src/osd/PG.h index 8a7aa1ed6b4..71283d54b83 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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(); } diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 3720ec31d72..e7c4adb0557 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -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); } |