Btrfs: set plug for fsync
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 15 Nov 2017 23:10:28 +0000 (16:10 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:13 +0000 (16:08 +0100)
commit343e4fc1c60971b0734de26dbbd475d433950982
treeb900c92ed8a718f05f81779132754a0609ebce55
parent0fb08bccbce2c1900d18f7ecc01ff8b8f677ce3e
Btrfs: set plug for fsync

Setting plug can merge adjacent IOs before dispatching IOs to the disk
driver.

Without plug, it'd not be a problem for single disk usecases, but for
multiple disks using raid profile, a large IO can be split to several
IOs of stripe length, and plug can be helpful to bring them together
for each disk so that we can save several disk access.

Moreover, fsync issues synchronous writes, so plug can really take
effect.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c