From 5ee832185b19cee270dc462dca4d73328cc13c2b Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 6 Feb 2025 19:22:36 +0530 Subject: [PATCH] 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 --- src/mon/MDSMonitor.cc | 2 +- src/mon/MDSMonitor.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 897a27653ba..e07ccf136cc 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 0ba5a2c32dd..567a11bce9d 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); -- 2.39.5