summaryrefslogtreecommitdiff
path: root/include/linux/iomap.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-23 10:06:10 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-01-23 10:22:12 -0800
commit213f627104daf8589aad8ee73fcaeb603ab0af15 (patch)
tree78077f4f6fd6915e09d9c3aba35c7214ae9583f8 /include/linux/iomap.h
parent2f63296578cad1ae681152d5b2122a4595195f16 (diff)
iomap: add a IOMAP_DIO_OVERWRITE_ONLY flag
Add a flag to signal that only pure overwrites are allowed. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index be4e1e1e01e8..1a86f520de56 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -122,6 +122,7 @@ struct iomap_page_ops {
#define IOMAP_FAULT (1 << 3) /* mapping for page fault */
#define IOMAP_DIRECT (1 << 4) /* direct I/O */
#define IOMAP_NOWAIT (1 << 5) /* do not block */
+#define IOMAP_OVERWRITE_ONLY (1 << 6) /* only pure overwrites allowed */
struct iomap_ops {
/*
@@ -262,6 +263,13 @@ struct iomap_dio_ops {
*/
#define IOMAP_DIO_FORCE_WAIT (1 << 0)
+/*
+ * Do not allocate blocks or zero partial blocks, but instead fall back to
+ * the caller by returning -EAGAIN. Used to optimize direct I/O writes that
+ * are not aligned to the file system block size.
+ */
+#define IOMAP_DIO_OVERWRITE_ONLY (1 << 1)
+
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);