]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon,cephfs: small improvement for health warning methods 61554/head
authorRishabh Dave <ridave@redhat.com>
Thu, 6 Feb 2025 13:52:36 +0000 (19:22 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 6 Feb 2025 16:35:28 +0000 (22:05 +0530)
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 <ridave@redhat.com>
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h

index 897a27653ba8965073ed12d5730302b7d237fce6..e07ccf136cc6be325b7185e01fa965b1db821f83 100644 (file)
@@ -1548,7 +1548,7 @@ out:
   }
 }
 
-bool MDSMonitor::has_health_warnings(vector<mds_metric_t> warnings, const mds_gid_t& gid)
+bool MDSMonitor::has_health_warnings(const vector<mds_metric_t>& warnings, const mds_gid_t& gid)
 {
   for (auto& [_gid, health] : pending_daemon_health) {
     if (gid != MDS_GID_NONE) {
index 0ba5a2c32dd234d30eabec58b5b3d932efccf472..567a11bce9db8deca10d2bf67aaaee54d49faff4 100644 (file)
@@ -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<mds_metric_t> warnings,
+  bool has_health_warnings(const std::vector<mds_metric_t>& warnings,
                           const mds_gid_t& gid=MDS_GID_NONE);
   bool has_health_warnings(const std::vector<mds_metric_t>& warnings,
                           const std::vector<mds_gid_t>& gids);