From b806f4faadf36d6078520d3356840ddc1dba07d1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Jan 2017 12:28:50 -0500 Subject: [PATCH] os/bluestore: ExtentMap: remove reshard 0 extent special case Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 88b24fa9b5e..6162a7e2ae8 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; -- 2.39.5