iomap: factor out a iomap_writepage_map_block helper
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Dec 2023 07:27:07 +0000 (08:27 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 1 Feb 2024 13:20:12 +0000 (14:20 +0100)
commitf525152a0f0ff34eb92b322703d76ba37095f556
tree596ea4b5f90b906b107aa695893bd02df55163a7
parent6b865d6530230b0c446efd93e0207b8eed7eadb2
iomap: factor out a iomap_writepage_map_block helper

Split the loop body that calls into the file system to map a block and
add it to the ioend into a separate helper to prefer for refactoring of
the surrounding code.

Note that this was the only place in iomap_writepage_map that could
return an error, so include the call to ->discard_folio into the new
helper as that will help to avoid code duplication in the future.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231207072710.176093-12-hch@lst.de
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/iomap/buffered-io.c