From e1f1c56ce88ef3ad05e881d650fac637931ce3fe Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 11 May 2015 19:30:30 +0800 Subject: [PATCH] mon/PGMap: add more constness Signed-off-by: Kefu Chai --- src/mon/PGMap.cc | 2 +- src/mon/PGMap.h | 2 +- src/osd/osd_types.cc | 2 +- src/osd/osd_types.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index cebbe1e3a612..dc3a4fe6087a 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1473,7 +1473,7 @@ void PGMap::generate_test_instances(list& o) } } -void PGMap::get_filtered_pg_stats(string& state, int64_t poolid, int64_t osdid, +void PGMap::get_filtered_pg_stats(const string& state, int64_t poolid, int64_t osdid, bool primary, set& pgs) { int type = 0; diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index b34b815cad3a..a2676432d236 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -294,7 +294,7 @@ public: void dump_osd_blocked_by_stats(Formatter *f) const; void print_osd_blocked_by_stats(std::ostream *ss) const; - void get_filtered_pg_stats(string& state, int64_t poolid, int64_t osdid, + void get_filtered_pg_stats(const string& state, int64_t poolid, int64_t osdid, bool primary, set& pgs); void recovery_summary(Formatter *f, list *psl, const pool_stat_t& delta_sum) const; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 7679dc4b1945..3703ae6a6097 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -770,7 +770,7 @@ std::string pg_state_string(int state) return ret; } -int pg_string_state(std::string state) +int pg_string_state(const std::string& state) { int type; if (state == "active") diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 18f540250196..d6d147a49c05 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -773,7 +773,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) { std::string pg_state_string(int state); std::string pg_vector_string(const vector &a); -int pg_string_state(std::string state); +int pg_string_state(const std::string& state); /* -- 2.47.3