From: Rishabh Dave Date: Thu, 6 Feb 2025 13:52:36 +0000 (+0530) Subject: mon,cephfs: small improvement for health warning methods X-Git-Tag: v20.0.0~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ee832185b19cee270dc462dca4d73328cc13c2b;p=ceph.git mon,cephfs: small improvement for health warning methods Use const qualifier since warnings vector won't be modified by the helper methods and use also use a reference instead of a regular variable. Signed-off-by: Rishabh Dave --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 897a27653ba8..e07ccf136cc6 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1548,7 +1548,7 @@ out: } } -bool MDSMonitor::has_health_warnings(vector warnings, const mds_gid_t& gid) +bool MDSMonitor::has_health_warnings(const vector& warnings, const mds_gid_t& gid) { for (auto& [_gid, health] : pending_daemon_health) { if (gid != MDS_GID_NONE) { diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index 0ba5a2c32dd2..567a11bce9db 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -52,7 +52,7 @@ class MDSMonitor : public PaxosService, public PaxosFSMap, protected CommandHand bool preprocess_query(MonOpRequestRef op) override; // true if processed. bool prepare_update(MonOpRequestRef op) override; bool should_propose(double& delay) override; - bool has_health_warnings(std::vector warnings, + bool has_health_warnings(const std::vector& warnings, const mds_gid_t& gid=MDS_GID_NONE); bool has_health_warnings(const std::vector& warnings, const std::vector& gids);