]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: drop csum_enabled parameter from blob::get_chunk_size()
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 23 Sep 2016 06:14:14 +0000 (14:14 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 23 Sep 2016 06:14:14 +0000 (14:14 +0800)
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 <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/bluestore_types.h

index e4bc5b59923c614dfa9e02cdb818546ed6957b9b..749f5b4f479f95c6c0eab9a5c4b24993fa5054da 100644 (file)
@@ -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)) {
index 15a5925cabdbcfc6333c9f4ef06c022eae1d36e8..f5d40014d3665cf033e3ab5ae22d94dc99905653 100644 (file)
@@ -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;