iomap: map multiple blocks at a time
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Dec 2023 07:27:09 +0000 (08:27 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 1 Feb 2024 13:20:13 +0000 (14:20 +0100)
commit30deff8531f469453ccc0981f14eceb0a2ea68d6
tree9a2aa22f3d893cc278b9e4be79ceebca95b94608
parent410bb2ce611133a11d4d11f0aef4c83f095c3200
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>
fs/iomap/buffered-io.c
include/linux/iomap.h