From: Kefu Chai Date: Sun, 14 Mar 2021 03:56:06 +0000 (+0800) Subject: osd: mark HeartbeatInfo::is_stale() and friends "const" X-Git-Tag: v16.2.5~118^2~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df91fa8db300b458302cdfc828eda0c9ffde7842;p=ceph.git osd: mark HeartbeatInfo::is_stale() and friends "const" just for more const correctness. Signed-off-by: Kefu Chai (cherry picked from commit 253cb8f4114e92768a54376a8834006479930b69) --- diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 90d2f800fb84..4348dcd64117 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1422,7 +1422,7 @@ private: std::vector hb_front_min; std::vector hb_front_max; - bool is_stale(utime_t stale) { + bool is_stale(utime_t stale) const { if (ping_history.empty()) { return false; } @@ -1430,7 +1430,7 @@ private: return oldest_deadline <= stale; } - bool is_unhealthy(utime_t now) { + bool is_unhealthy(utime_t now) const { if (ping_history.empty()) { /// we haven't sent a ping yet or we have got all replies, /// in either way we are safe and healthy for now @@ -1441,7 +1441,7 @@ private: return now > oldest_deadline; } - bool is_healthy(utime_t now) { + bool is_healthy(utime_t now) const { if (last_rx_front == utime_t() || last_rx_back == utime_t()) { // only declare to be healthy until we have received the first // replies from both front/back connections