From: Sage Weil Date: Fri, 15 Sep 2017 15:26:16 +0000 (-0400) Subject: osd/PG: protect pg state accessors X-Git-Tag: v13.0.1~634^2~54 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e70067c68532ec44bb8fa3e48e0ef09ed828b9f6;p=ceph.git osd/PG: protect pg state accessors Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 9300b927fbb7..e8f11eb24e13 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2457,24 +2457,21 @@ protected: bool is_complete() const { return info.last_complete == info.last_update; } bool should_send_notify() const { return send_notify; } -public: int get_state() const { return state; } - bool is_active() const { return state_test(PG_STATE_ACTIVE); } - 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_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); } - bool is_undersized() const { return state_test(PG_STATE_UNDERSIZED); } - - bool is_scrubbing() const { return state_test(PG_STATE_SCRUBBING); } - bool is_peered() const { + bool is_active() const { return state_test(PG_STATE_ACTIVE); } + 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_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); } + bool is_undersized() const { return state_test(PG_STATE_UNDERSIZED); } + bool is_scrubbing() const { return state_test(PG_STATE_SCRUBBING); } + bool is_peered() const { return state_test(PG_STATE_ACTIVE) || state_test(PG_STATE_PEERED); } -protected: - bool is_empty() const { return info.last_update == eversion_t(0,0); } + bool is_empty() const { return info.last_update == eversion_t(0,0); } void init( int role,