summaryrefslogtreecommitdiff
path: root/include/linux/iomap.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-12-07 10:27:09 +0300
committerChristian Brauner <brauner@kernel.org>2024-02-01 16:20:13 +0300
commit30deff8531f469453ccc0981f14eceb0a2ea68d6 (patch)
tree9a2aa22f3d893cc278b9e4be79ceebca95b94608 /include/linux/iomap.h
parent410bb2ce611133a11d4d11f0aef4c83f095c3200 (diff)
downloadlinux-30deff8531f469453ccc0981f14eceb0a2ea68d6.tar.xz
iomap: map multiple blocks at a time
The ->map_blocks interface returns a valid range for writeback, but we still call back into it for every block, which is a bit inefficient. Change iomap_writepage_map to use the valid range in the map until the end of the folio or the dirty range inside the folio instead of calling back into every block. Note that the range is not used over folio boundaries as we need to be able to check the mapping sequence count under the folio lock. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20231207072710.176093-14-hch@lst.de Signed-off-by: Christian Brauner <brauner@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 b8d3b658ad2b..49d93f538785 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -309,6 +309,13 @@ struct iomap_writeback_ops {
/*
* Required, maps the blocks so that writeback can be performed on
* the range starting at offset.
+ *
+ * Can return arbitrarily large regions, but we need to call into it at
+ * least once per folio to allow the file systems to synchronize with
+ * the write path that could be invalidating mappings.
+ *
+ * An existing mapping from a previous call to this method can be reused
+ * by the file system if it is still valid.
*/
int (*map_blocks)(struct iomap_writepage_ctx *wpc, struct inode *inode,
loff_t offset);