Commit 906753be authored by Jan Kara's avatar Jan Kara Committed by Darrick J. Wong

xfs: Use iomap_dio_rw to wait for unaligned direct IO

Use iomap_dio_rw() to wait for unaligned direct IO instead of opencoding
the wait.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 13ef9544
...@@ -547,16 +547,12 @@ xfs_file_dio_aio_write( ...@@ -547,16 +547,12 @@ xfs_file_dio_aio_write(
} }
trace_xfs_file_direct_write(ip, count, iocb->ki_pos); trace_xfs_file_direct_write(ip, count, iocb->ki_pos);
ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops,
is_sync_kiocb(iocb));
/* /*
* If unaligned, this is the only IO in-flight. If it has not yet * If unaligned, this is the only IO in-flight. Wait on it before we
* completed, wait on it before we release the iolock to prevent * release the iolock to prevent subsequent overlapping IO.
* subsequent overlapping IO.
*/ */
if (ret == -EIOCBQUEUED && unaligned_io) ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops,
inode_dio_wait(inode); is_sync_kiocb(iocb) || unaligned_io);
out: out:
xfs_iunlock(ip, iolock); xfs_iunlock(ip, iolock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment