]> asedeno.scripts.mit.edu Git - linux.git/commit
iomap: iomap_dio_rw() handles all sync writes
authorDave Chinner <dchinner@redhat.com>
Wed, 2 May 2018 19:54:52 +0000 (12:54 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 May 2018 17:04:01 +0000 (10:04 -0700)
commit4f8ff44ba0ad82a6f51c1bf381d7bad346464b09
treef54b53f824041b26fdcd51e5cbeaab29c827af86
parented5c3e66a32883e2b3d119d358d23fd5990dc9c2
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 <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/iomap.c
fs/xfs/xfs_file.c