From 0fd776da48b4d936af9031f45815d98b30e52352 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 18 Jun 2013 15:20:00 -0700 Subject: [PATCH] mon/PGMap: make int type explicit We get away with this because int is 32-bits on x86_64 and i386 both, but we should be explicit anyway! Signed-off-by: Sage Weil --- src/mon/PGMap.cc | 18 +++++++++--------- src/mon/PGMap.h | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 32ff8963a0a4b..e1f3e77e0a2e3 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -109,7 +109,7 @@ void PGMap::Incremental::dump(Formatter *f) const f->close_section(); f->open_array_section("osd_stat_updates"); - for (map::const_iterator p = osd_stat_updates.begin(); p != osd_stat_updates.end(); ++p) { + for (map::const_iterator p = osd_stat_updates.begin(); p != osd_stat_updates.end(); ++p) { f->open_object_section("osd_stat"); f->dump_int("osd", p->first); p->second.dump(f); @@ -192,15 +192,15 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc) } stat_pg_add(update_pg, update_stat); } - for (map::const_iterator p = inc.osd_stat_updates.begin(); + for (map::const_iterator p = inc.osd_stat_updates.begin(); p != inc.osd_stat_updates.end(); ++p) { int osd = p->first; const osd_stat_t &new_stats(p->second); - hash_map::iterator t = osd_stat.find(osd); + hash_map::iterator t = osd_stat.find(osd); if (t == osd_stat.end()) { - hash_map::value_type v(osd, new_stats); + hash_map::value_type v(osd, new_stats); osd_stat.insert(v); } else { stat_osd_sub(t->second); @@ -226,7 +226,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc) for (set::iterator p = inc.osd_stat_rm.begin(); p != inc.osd_stat_rm.end(); ++p) { - hash_map::iterator t = osd_stat.find(*p); + hash_map::iterator t = osd_stat.find(*p); if (t != osd_stat.end()) { stat_osd_sub(t->second); osd_stat.erase(t); @@ -260,7 +260,7 @@ void PGMap::redo_full_sets() { full_osds.clear(); nearfull_osds.clear(); - for (hash_map::iterator i = osd_stat.begin(); + for (hash_map::iterator i = osd_stat.begin(); i != osd_stat.end(); ++i) { register_nearfull_status(i->first, i->second); @@ -300,7 +300,7 @@ void PGMap::calc_stats() ++p) { stat_pg_add(p->first, p->second); } - for (hash_map::iterator p = osd_stat.begin(); + for (hash_map::iterator p = osd_stat.begin(); p != osd_stat.end(); ++p) stat_osd_add(p->second); @@ -487,7 +487,7 @@ void PGMap::dump_pool_stats(Formatter *f) const void PGMap::dump_osd_stats(Formatter *f) const { f->open_array_section("osd_stats"); - for (hash_map::const_iterator q = osd_stat.begin(); + for (hash_map::const_iterator q = osd_stat.begin(); q != osd_stat.end(); ++q) { f->open_object_section("osd_stat"); @@ -558,7 +558,7 @@ void PGMap::dump(ostream& ss) const << "\t" << pg_sum.ondisk_log_size << std::endl; ss << "osdstat\tkbused\tkbavail\tkb\thb in\thb out" << std::endl; - for (hash_map::const_iterator p = osd_stat.begin(); + for (hash_map::const_iterator p = osd_stat.begin(); p != osd_stat.end(); ++p) ss << p->first diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 1d0f40e8ba2c3..7ab481f887ea3 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -35,9 +35,9 @@ public: epoch_t last_osdmap_epoch; // last osdmap epoch i applied to the pgmap epoch_t last_pg_scan; // osdmap epoch hash_map pg_stat; - hash_map osd_stat; - set full_osds; - set nearfull_osds; + hash_map osd_stat; + set full_osds; + set nearfull_osds; float full_ratio; float nearfull_ratio; @@ -45,8 +45,8 @@ public: public: version_t version; map pg_stat_updates; - map osd_stat_updates; - set osd_stat_rm; + map osd_stat_updates; + set osd_stat_rm; epoch_t osdmap_epoch; epoch_t pg_scan; // osdmap epoch set pg_remove; -- 2.39.5