From ae772b8d0d9fc0186759b9e2051633ff1127b2b0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Nov 2016 17:41:44 -0500 Subject: [PATCH] os/bluestore: set csum order based on alloc hints If the users hints that this object is sequentially read and written we can use a larger csum order. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index ace6ee33560dd..31075d4969b9e 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -8049,7 +8049,8 @@ int BlueStore::_do_write( CEPH_OSD_ALLOC_HINT_FLAG_APPEND_ONLY)) && (alloc_hints & CEPH_OSD_ALLOC_HINT_FLAG_RANDOM_WRITE) == 0) { dout(20) << __func__ << " will prefer large blob and csum sizes" << dendl; - wctx.csum_order = min_alloc_size_order; + wctx.csum_order = std::max(min_alloc_size_order, + (size_t)ctzl(o->onode.expected_write_size)); if (wctx.compress) { wctx.target_blob_size = select_option( "compression_max_blob_size", -- 2.39.5