From: xie xingguo Date: Mon, 18 Jul 2016 03:31:43 +0000 (+0800) Subject: os/bluestore: make csum_type checking more efficient X-Git-Tag: v11.0.1~700^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1c07f2e2e82e81c0bfeee4e7cc0d41d8e9cc1e7e;p=ceph-ci.git os/bluestore: make csum_type checking more efficient Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index cc91d89af6f..8f1548a7c97 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1478,12 +1478,14 @@ void BlueStore::_set_compression() void BlueStore::_set_csum() { - int t = bluestore_blob_t::get_csum_string_type( - g_conf->bluestore_csum_type); - if (t < 0 || !g_conf->bluestore_csum) { - t = bluestore_blob_t::CSUM_NONE; + csum_type = bluestore_blob_t::CSUM_NONE; + if (g_conf->bluestore_csum) { + int t = bluestore_blob_t::get_csum_string_type( + g_conf->bluestore_csum_type); + if (t > bluestore_blob_t::CSUM_NONE) + csum_type = t; } - csum_type = t; + dout(10) << __func__ << " csum_type " << bluestore_blob_t::get_csum_type_string(csum_type) << dendl;