]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon,cephfs: small improvement for health warning methods
authorRishabh Dave <ridave@redhat.com>
Thu, 6 Feb 2025 13:52:36 +0000 (19:22 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 15 Sep 2025 06:25:19 +0000 (11:55 +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>
(cherry picked from commit 5ee832185b19cee270dc462dca4d73328cc13c2b)

src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h

index d3aa1dfdb27a2d3f35cc625f3cd8f5cc54b41a80..5c1d89ab2a74376bd9325df1a0c4ddb9a75ff6a1 100644 (file)
@@ -1460,7 +1460,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 a8a05b2c73f1cf58779e9a5917b208a876c635c7..2003e666c4103f0ab31fee553c0bfcf9b16d8bca 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);