From: xie xingguo Date: Sat, 23 Feb 2019 00:33:40 +0000 (+0800) Subject: osd/OSDMap: drop local pool filter in calc_pg_upmaps X-Git-Tag: v14.1.1~94^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e6bad9821b5fb3e780d970666fbdfbf217d905e;p=ceph.git osd/OSDMap: drop local pool filter in calc_pg_upmaps The local pre-loaded pool filter is completely redundant since the below check: if (!only_pools.empty() && !only_pools.count(i.first)) could reliably catch both cases - either optimization should be restricted to specific pools feeded, or all existing pools. Let's clean it up. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 8446d6e8cb7..1a148b47a77 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -4312,18 +4312,10 @@ int OSDMap::calc_pg_upmaps( CephContext *cct, float max_deviation_ratio, int max, - const set& only_pools_orig, + const set& only_pools, OSDMap::Incremental *pending_inc) { - ldout(cct, 10) << __func__ << " pools " << only_pools_orig << dendl; - set only_pools; - if (only_pools_orig.empty()) { - for (auto& i : pools) { - only_pools.insert(i.first); - } - } else { - only_pools = only_pools_orig; - } + ldout(cct, 10) << __func__ << " pools " << only_pools << dendl; OSDMap tmp; tmp.deepish_copy_from(*this); int num_changed = 0;