From 4f8ff44ba0ad82a6f51c1bf381d7bad346464b09 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 2 May 2018 12:54:52 -0700 Subject: iomap: iomap_dio_rw() handles all sync writes Currently iomap_dio_rw() only handles (data)sync write completions for AIO. This means we can't optimised non-AIO IO to minimise device flushes as we can't tell the caller whether a flush is required or not. To solve this problem and enable further optimisations, make iomap_dio_rw responsible for data sync behaviour for all IO, not just AIO. In doing so, the sync operation is now accounted as part of the DIO IO by inode_dio_end(), hence post-IO data stability updates will no long race against operations that serialise via inode_dio_wait() such as truncate or hole punch. Signed-Off-By: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_file.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'fs/xfs/xfs_file.c') diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index e03e084b6819..28be51908254 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -568,11 +568,6 @@ out: * complete fully or fail. */ ASSERT(ret < 0 || ret == count); - - if (ret > 0) { - /* Handle various SYNC-type writes */ - ret = generic_write_sync(iocb, ret); - } return ret; } -- cgit v1.2.1