From: Kefu Chai Date: Mon, 11 May 2015 11:30:30 +0000 (+0800) Subject: mon/PGMap: add more constness X-Git-Tag: v9.0.2~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e1f1c56ce88ef3ad05e881d650fac637931ce3fe;p=ceph.git mon/PGMap: add more constness Signed-off-by: Kefu Chai --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index cebbe1e3a61..dc3a4fe6087 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 b34b815cad3..a2676432d23 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 7679dc4b194..3703ae6a609 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 18f54025019..d6d147a49c0 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); /*