]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: ExtentMap: remove reshard 0 extent special case
authorSage Weil <sage@redhat.com>
Fri, 27 Jan 2017 17:28:50 +0000 (12:28 -0500)
committerSage Weil <sage@redhat.com>
Thu, 2 Feb 2017 15:12:08 +0000 (10:12 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 88b24fa9b5e216bc7f0c6a59cf1a1e667928bf7f..6162a7e2ae8d1211f3fcf86076686dcede10e32f 100644 (file)
@@ -1884,14 +1884,6 @@ void BlueStore::ExtentMap::reshard(
     p = spanning_blob_map.erase(p);
   }
 
-  if (extent_map.size() <= 1) {
-    dout(20) << __func__ << " <= 1 extent, going inline" << dendl;
-    shards.clear();
-    onode->onode.extent_map_shards.clear();
-    clear_needs_reshard();
-    return;
-  }
-
   unsigned bytes = 0;
   if (onode->onode.extent_map_shards.empty()) {
     bytes = inline_bl.length();
@@ -1903,9 +1895,9 @@ void BlueStore::ExtentMap::reshard(
   unsigned target = cct->_conf->bluestore_extent_map_shard_target_size;
   unsigned slop = target *
     cct->_conf->bluestore_extent_map_shard_target_size_slop;
-  unsigned extent_avg = bytes / extent_map.size();
-  dout(20) << __func__ << " extent_avg " << extent_avg << " target " << target
-          << " slop " << slop << dendl;
+  unsigned extent_avg = bytes / MAX(1, extent_map.size());
+  dout(20) << __func__ << "  extent_avg " << extent_avg << ", target " << target
+          << ", slop " << slop << dendl;
 
   // reshard
   unsigned estimate = 0;