diff mbox series

[03/14] iomap: introduce IOMAP_F_NO_MERGE for non-mergable ioends

Message ID 20241229133836.1194272-4-aalbersh@kernel.org (mailing list archive)
State New
Headers show
Series Direct mapped extended attribute data | expand

Commit Message

Andrey Albershteyn Dec. 29, 2024, 1:38 p.m. UTC
XFS will use it to calculate CRC of written data.

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
 fs/iomap/buffered-io.c | 4 ++++
 include/linux/iomap.h  | 2 ++
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 93da48ec5801..d6231f4f78d9 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1651,6 +1651,8 @@  iomap_ioend_can_merge(struct iomap_ioend *ioend, struct iomap_ioend *next)
 	 */
 	if (ioend->io_sector + (ioend->io_size >> 9) != next->io_sector)
 		return false;
+	if (ioend->io_flags & IOMAP_F_NO_MERGE)
+		return false;
 	return true;
 }
 
@@ -1782,6 +1784,8 @@  static bool iomap_can_add_to_ioend(struct iomap_writepage_ctx *wpc, loff_t pos)
 	 */
 	if (wpc->nr_folios >= IOEND_BATCH_SIZE)
 		return false;
+	if (wpc->iomap.flags & IOMAP_F_NO_MERGE)
+		return false;
 	return true;
 }
 
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index f089969e4716..261772431fae 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -87,6 +87,8 @@  struct vm_fault;
  * Flags from 0x1000 up are for file system specific usage:
  */
 #define IOMAP_F_PRIVATE		(1U << 12)
+/* No ioend merges for this operation */
+#define IOMAP_F_NO_MERGE	(1U << 13)
 
 
 /*