From c653063e04c6ff586e582b9cfd998c5657279609 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 23 Feb 2019 08:33:40 +0800 Subject: [PATCH] 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 (cherry picked from commit 3e6bad9821b5fb3e780d970666fbdfbf217d905e) --- src/osd/OSDMap.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 3ed0330894de2..2f6468745b792 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -4158,18 +4158,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; -- 2.39.5