]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: mark HeartbeatInfo::is_stale() and friends "const"
authorKefu Chai <kchai@redhat.com>
Sun, 14 Mar 2021 03:56:06 +0000 (11:56 +0800)
committersinguliere <singuliere@autistici.org>
Thu, 1 Apr 2021 21:07:03 +0000 (23:07 +0200)
just for more const correctness.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 253cb8f4114e92768a54376a8834006479930b69)

src/osd/OSD.h

index 50791bbb4908b59907c97eb8a22d70041da2ec45..b7a45f8c9f498375f5088a3b0ac2aaf1e40d7104 100644 (file)
@@ -1391,7 +1391,7 @@ private:
     vector<uint32_t> hb_front_min;
     vector<uint32_t> hb_front_max;
 
-    bool is_stale(utime_t stale) {
+    bool is_stale(utime_t stale) const {
       if (ping_history.empty()) {
         return false;
       }
@@ -1399,7 +1399,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
@@ -1410,7 +1410,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