From e025dfcb8afd5dced76c7ffab37d02869b8b0a77 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 (cherry picked from commit 5ee832185b19cee270dc462dca4d73328cc13c2b) --- 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 d3aa1dfdb27..5c1d89ab2a7 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1460,7 +1460,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 a8a05b2c73f..2003e666c41 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