aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/iomap.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2021-07-23 01:59:41 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2021-10-24 15:26:05 +0200
commit97308f8b0d867e9ef59528cd97f0db55ffdf5651 (patch)
treeddf419571b6bf50ea98c445d822627b24a5fbb0b /include/linux/iomap.h
parentiomap: Fix iomap_dio_rw return value for user copies (diff)
downloadwireguard-linux-97308f8b0d867e9ef59528cd97f0db55ffdf5651.tar.xz
wireguard-linux-97308f8b0d867e9ef59528cd97f0db55ffdf5651.zip
iomap: Support partial direct I/O on user copy failures
In iomap_dio_rw, when iomap_apply returns an -EFAULT error and the IOMAP_DIO_PARTIAL flag is set, complete the request synchronously and return a partial result. This allows the caller to deal with the page fault and retry the remainder of the request. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'include/linux/iomap.h')
-rw-r--r--include/linux/iomap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 24f8489583ca..2a213b0d1e1f 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -330,6 +330,13 @@ struct iomap_dio_ops {
*/
#define IOMAP_DIO_OVERWRITE_ONLY (1 << 1)
+/*
+ * When a page fault occurs, return a partial synchronous result and allow
+ * the caller to retry the rest of the operation after dealing with the page
+ * fault.
+ */
+#define IOMAP_DIO_PARTIAL (1 << 2)
+
ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
unsigned int dio_flags);