From: xie xingguo Date: Wed, 16 Nov 2016 06:33:30 +0000 (+0800) Subject: os/bluestore: avoid unnecessary call to init_csum() X-Git-Tag: v11.1.0~254^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5beb99e17a6fd683e83f7e7e0fd3660bfc272f0e;p=ceph.git os/bluestore: avoid unnecessary call to init_csum() We have to initiate CSumType from 1, which represents CSUM_NONE, to be aligned with OSDMnitor's pool_opts_t handling. So we have to explicitly check against CSUM_NONE to skip init_csum(), which will set FLAG_CSUM and alloc memory for csum_data and thus shall be avoided whenever it is possible. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 140a8e62bd25..ca886c607595 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7906,7 +7906,7 @@ int BlueStore::_do_alloc_write( << " csum_length 0x" << std::hex << csum_length << std::dec << dendl; - if (csum) { + if (csum != Checksummer::CSUM_NONE) { dblob.init_csum(csum, csum_order, csum_length); dblob.calc_csum(b_off, *l); }