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>
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: ";