From a6fb43363f3e6f6d6a84f61580501b32daac7249 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 30 Jun 2016 19:31:45 +0800 Subject: [PATCH] os/bluestore: check against if tail_pad is already 0 So we may skip the potential has_any_lextents() check. Signed-off-by: xie xingguo --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 54cf1e23b2ab..f80795e1738c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5639,7 +5639,7 @@ void BlueStore::_do_write_small( } uint64_t tail_pad = ROUND_UP_TO(offset + length, chunk_size) - (offset + length); - if (o->onode.has_any_lextents(offset + length, tail_pad)) { + if (tail_pad && o->onode.has_any_lextents(offset + length, tail_pad)) { tail_pad = 0; } bufferlist padded = bl; -- 2.47.3