@@ -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;
}
@@ -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)
/*
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(+)