[PATCH] loop: change fsync to fdatasync when update dio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In general, fsync has a larger overhead than fdatasync. And since the
dio option is for data, it seems like fdatasync is enough.
So this patch changes it to fdatasync which has little load relatively.

Signed-off-by: Huijin Park <huijin.park@xxxxxxxxxxx>

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1518a6423279..6c7ce8be8c0c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -203,7 +203,7 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
 		return;
 
 	/* flush dirty pages before changing direct IO */
-	vfs_fsync(file, 0);
+	vfs_fsync(file, 1);
 
 	/*
 	 * The flag of LO_FLAGS_DIRECT_IO is handled similarly with
-- 
2.17.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux