diff options
author | Christoph Hellwig <hch@lst.de> | 2021-01-23 10:06:09 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-01-23 10:06:09 -0800 |
commit | 2f63296578cad1ae681152d5b2122a4595195f16 (patch) | |
tree | 26ec15d848996435a7ba37fa4b48e3892490603b /include/linux/iomap.h | |
parent | 5724be5de88f5f6863d44c859f42f70d5cc667ed (diff) | |
download | linux-stable-2f63296578cad1ae681152d5b2122a4595195f16.tar.gz linux-stable-2f63296578cad1ae681152d5b2122a4595195f16.tar.bz2 linux-stable-2f63296578cad1ae681152d5b2122a4595195f16.zip |
iomap: pass a flags argument to iomap_dio_rw
Pass a set of flags to iomap_dio_rw instead of the boolean
wait_for_completion argument. The IOMAP_DIO_FORCE_WAIT flag
replaces the wait_for_completion, but only needs to be passed
when the iocb isn't synchronous to start with to simplify the
callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
[djwong: rework xfs_file.c so that we can push iomap changes separately]
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'include/linux/iomap.h')
-rw-r--r-- | include/linux/iomap.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 5bd3cac4df9c..be4e1e1e01e8 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -256,12 +256,18 @@ struct iomap_dio_ops { struct bio *bio, loff_t file_offset); }; +/* + * Wait for the I/O to complete in iomap_dio_rw even if the kiocb is not + * synchronous. + */ +#define IOMAP_DIO_FORCE_WAIT (1 << 0) + ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops, - bool wait_for_completion); + unsigned int dio_flags); struct iomap_dio *__iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops, - bool wait_for_completion); + unsigned int dio_flags); ssize_t iomap_dio_complete(struct iomap_dio *dio); int iomap_dio_iopoll(struct kiocb *kiocb, bool spin); |