]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
aos/bluestore/KernelDevice: optimize rebuild for aio_write.
authorJianpeng Ma <jianpeng.ma@intel.com>
Sat, 7 May 2016 23:16:28 +0000 (07:16 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Sat, 7 May 2016 23:16:28 +0000 (07:16 +0800)
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 <jianpeng.ma@intel.com>
src/os/bluestore/KernelDevice.cc

index 971a0a5244bccbbd385bfb56b292b5155a40bc81..428b607f072c7c975c111570c1204b85af54ab81 100644 (file)
@@ -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: ";