summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-09-09 09:08:54 +0300
committerJens Axboe <axboe@kernel.dk>2026-09-14 07:42:09 -0600
commita552b1c7388929f5d7fc16b249c25366550197ea (patch)
treed78e9b727eb3863b94c7de6c76984d28d4826d8e /include/linux
parentc7715a942e9daffe566bb87274714c170d06e256 (diff)
downloadlinux-next-a552b1c7388929f5d7fc16b249c25366550197ea.tar.gz
linux-next-a552b1c7388929f5d7fc16b249c25366550197ea.zip
iomap: add a iomap_ioend_flags helper
Add a helper to initialize the ioend flags to the values that can be directly derived from the iomap. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Link: https://patch.msgid.link/20260909060924.1102037-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iomap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index bc7ae6327dbf..8e09b2d4eda0 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -491,6 +491,18 @@ sector_t iomap_bmap(struct address_space *mapping, sector_t bno,
#define IOMAP_IOEND_NOMERGE_FLAGS \
(IOMAP_IOEND_SHARED | IOMAP_IOEND_UNWRITTEN | IOMAP_IOEND_DIRECT)
+/* ioend flags directly implied by iomap flags */
+static inline u16 iomap_ioend_flags(const struct iomap *iomap)
+{
+ unsigned int flags = 0;
+
+ if (iomap->type == IOMAP_UNWRITTEN)
+ flags |= IOMAP_IOEND_UNWRITTEN;
+ if (iomap->flags & IOMAP_F_SHARED)
+ flags |= IOMAP_IOEND_SHARED;
+ return flags;
+}
+
/*
* Structure for writeback I/O completions.
*