iomap: add the new iomap_iter model
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Aug 2021 01:33:07 +0000 (18:33 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 17 Aug 2021 04:26:33 +0000 (21:26 -0700)
commitf4b896c213f0752adc828ddc11bd55419ffab248
tree9807d281548fd5097bdc61284f98cfee65280160
parent740499c78408f75c4e76feac848177cb0d0ccf4f
iomap: add the new iomap_iter model

The iomap_iter struct provides a convenient way to package up and
maintain all the arguments to the various mapping and operation
functions.  It is operated on using the iomap_iter() function that
is called in loop until the whole range has been processed.  Compared
to the existing iomap_apply() function this avoid an indirect call
for each iteration.

For now iomap_iter() calls back into the existing ->iomap_begin and
->iomap_end methods, but in the future this could be further optimized
to avoid indirect calls entirely.

Based on an earlier patch from Matthew Wilcox <willy@infradead.org>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
[djwong: add to apply.c to preserve git history of iomap loop control]
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/iomap/apply.c
fs/iomap/trace.h
include/linux/iomap.h