From: xie xingguo Date: Fri, 23 Sep 2016 06:14:14 +0000 (+0800) Subject: os/bluestore: drop csum_enabled parameter from blob::get_chunk_size() X-Git-Tag: v11.0.1~108^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbe62d016a3b9cf7a3c993dbc87d5f16e5141da5;p=ceph.git os/bluestore: drop csum_enabled parameter from blob::get_chunk_size() The only two callers from bluestore now always set csum_enabled to true, so there is no need to keep this parameter any more. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e4bc5b59923c..749f5b4f479f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4722,7 +4722,7 @@ int BlueStore::_do_read( } else { for (auto reg : b2r_it->second) { // determine how much of the blob to read - uint64_t chunk_size = bptr->get_blob().get_chunk_size(true, block_size); + uint64_t chunk_size = bptr->get_blob().get_chunk_size(block_size); uint64_t r_off = reg.blob_xoffset; uint64_t r_len = reg.length; unsigned front = r_off % chunk_size; @@ -7020,9 +7020,7 @@ void BlueStore::_do_write_small( << " bstart 0x" << std::hex << bstart << std::dec << dendl; // can we pad our head/tail out with zeros? - // blob csum settings to be applied hence ignoring current config - // settings for csum enable/disable - uint64_t chunk_size = b->get_blob().get_chunk_size(true, block_size); + uint64_t chunk_size = b->get_blob().get_chunk_size(block_size); uint64_t head_pad = P2PHASE(offset, chunk_size); if (head_pad && o->extent_map.has_any_lextents(offset - head_pad, chunk_size)) { diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 15a5925cabdb..f5d40014d366 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -339,9 +339,9 @@ struct bluestore_blob_t { } /// return chunk (i.e. min readable block) size for the blob - uint64_t get_chunk_size(bool csum_enabled, uint64_t dev_block_size) const { - return csum_enabled && - has_csum() ? MAX(dev_block_size, get_csum_chunk_size()) : dev_block_size; + uint64_t get_chunk_size(uint64_t dev_block_size) const { + return has_csum() ? + MAX(dev_block_size, get_csum_chunk_size()) : dev_block_size; } uint32_t get_csum_chunk_size() const { return 1 << csum_chunk_order;