]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: drop local pool filter in calc_pg_upmaps
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 23 Feb 2019 00:33:40 +0000 (08:33 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Mar 2019 01:48:05 +0000 (09:48 +0800)
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 <xie.xingguo@zte.com.cn>
(cherry picked from commit 3e6bad9821b5fb3e780d970666fbdfbf217d905e)

src/osd/OSDMap.cc

index 9ce294820a703861d9cbbc2bcca5cc6e6e5e25d1..78a5e9957616a669ec3306c73441a8c7f6c159e9 100644 (file)
@@ -4006,18 +4006,10 @@ int OSDMap::calc_pg_upmaps(
   CephContext *cct,
   float max_deviation_ratio,
   int max,
-  const set<int64_t>& only_pools_orig,
+  const set<int64_t>& only_pools,
   OSDMap::Incremental *pending_inc)
 {
-  ldout(cct, 10) << __func__ << " pools " << only_pools_orig  << dendl;
-  set<int64_t> 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;