From: Jianpeng Ma Date: Sat, 7 May 2016 23:16:28 +0000 (+0800) Subject: aos/bluestore/KernelDevice: optimize rebuild for aio_write. X-Git-Tag: v11.0.0~622^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dc0c99eb4fdc095c1a96602dd2f9f0d94041517b;p=ceph.git aos/bluestore/KernelDevice: optimize rebuild for aio_write. For the requirement of directio, the content maybe rebuild. In fact, rebuild_aligned_size_and_memory first check is_n_align_sized && is_algined and if need it rebuild. So using rebuild_aligned_size_and_memory can remove the check. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index 971a0a5244bc..428b607f072c 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -375,9 +375,8 @@ int KernelDevice::aio_write( assert(off < size); assert(off + len <= size); - if (!buffered && (!bl.is_n_align_sized(block_size) || !bl.is_aligned(block_size))) { + if (!buffered && bl.rebuild_aligned_size_and_memory(block_size, block_size)) { dout(20) << __func__ << " rebuilding buffer to be aligned" << dendl; - bl.rebuild_aligned(block_size); } dout(40) << "data: ";