]> git.apps.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)
committerKefu Chai <kchai@redhat.com>
Fri, 19 Mar 2021 16:04:32 +0000 (00:04 +0800)
just for more const correctness.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSD.h

index bd127285a1551d343cdcd4f756aff8477a953e11..aed0523a2eb87ab70a9728fd3646df9032c253b6 100644 (file)
@@ -1420,7 +1420,7 @@ private:
     std::vector<uint32_t> hb_front_min;
     std::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;
       }
@@ -1428,7 +1428,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
@@ -1439,7 +1439,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