]> 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)
committerNeha Ojha <nojha@redhat.com>
Thu, 29 Apr 2021 17:40:51 +0000 (17:40 +0000)
just for more const correctness.

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

src/osd/OSD.h

index 90d2f800fb841a96236ca4c06d0e46493ddd70a8..4348dcd6411778cb76ccb7cdd294205a4d0248c7 100644 (file)
@@ -1422,7 +1422,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;
       }
@@ -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