From: Sage Weil Date: Thu, 10 Mar 2016 18:15:43 +0000 (-0500) Subject: mon/PGMap: drop unused nocreating flag for stat_pg_{add,sub} X-Git-Tag: v10.1.0~96^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d64c167023f00e3e9204416a6741835d81b4a5c8;p=ceph.git mon/PGMap: drop unused nocreating flag for stat_pg_{add,sub} Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index b81db7cd6760..81162012b0e7 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -459,7 +459,7 @@ void PGMap::remove_osd(int osd) } } -void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating, +void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool sameosds) { pg_pool_sum[pgid.pool()].add(s); @@ -468,12 +468,10 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating, num_pg++; num_pg_by_state[s.state]++; - if (!nocreating) { - if (s.state & PG_STATE_CREATING) { - creating_pgs.insert(pgid); - if (s.acting_primary >= 0) { - creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid); - } + if (s.state & PG_STATE_CREATING) { + creating_pgs.insert(pgid); + if (s.acting_primary >= 0) { + creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid); } } @@ -492,7 +490,7 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating, pg_by_osd[*p].insert(pgid); } -void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating, +void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool sameosds) { pool_stat_t& ps = pg_pool_sum[pgid.pool()]; @@ -507,17 +505,15 @@ void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating, if (end == 0) num_pg_by_state.erase(s.state); - if (!nocreating) { - if (s.state & PG_STATE_CREATING) { - creating_pgs.erase(pgid); - if (s.acting_primary >= 0) { - map >& r = creating_pgs_by_osd_epoch[s.acting_primary]; - r[s.mapping_epoch].erase(pgid); - if (r[s.mapping_epoch].empty()) - r.erase(s.mapping_epoch); - if (r.empty()) - creating_pgs_by_osd_epoch.erase(s.acting_primary); - } + if (s.state & PG_STATE_CREATING) { + creating_pgs.erase(pgid); + if (s.acting_primary >= 0) { + map >& r = creating_pgs_by_osd_epoch[s.acting_primary]; + r[s.mapping_epoch].erase(pgid); + if (r[s.mapping_epoch].empty()) + r.erase(s.mapping_epoch); + if (r.empty()) + creating_pgs_by_osd_epoch.erase(s.acting_primary); } } @@ -559,9 +555,9 @@ void PGMap::stat_pg_update(const pg_t pgid, pg_stat_t& s, s.up == n.up && s.blocked_by == n.blocked_by; - stat_pg_sub(pgid, s, false, sameosds); + stat_pg_sub(pgid, s, sameosds); s = n; - stat_pg_add(pgid, n, false, sameosds); + stat_pg_add(pgid, n, sameosds); } void PGMap::stat_osd_add(const osd_stat_t &s) diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 8c2b3cadea2d..335c1207bc9f 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -258,9 +258,9 @@ public: void redo_full_sets(); void register_nearfull_status(int osd, const osd_stat_t& s); void calc_stats(); - void stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating=false, + void stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool sameosds=false); - void stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating=false, + void stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool sameosds=false); void stat_pg_update(const pg_t pgid, pg_stat_t &prev, bufferlist::iterator& blp); void stat_osd_add(const osd_stat_t &s);