[PATCH v2 03/18] btrfs: convert iomap ops to ->iomap_next()

From: Joanne Koong

Date: Tue Jun 30 2026 - 20:12:16 EST


Convert btrfs iomap_ops to the new ->iomap_next() callback. This uses the
iomap_process() helper, which finishes the previous mapping if needed
and produces the next one. No functional changes are intended.

Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx>
---
fs/btrfs/direct-io.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c
index 460326d34143..46dd72982fba 100644
--- a/fs/btrfs/direct-io.c
+++ b/fs/btrfs/direct-io.c
@@ -798,9 +798,15 @@ static void btrfs_dio_submit_io(const struct iomap_iter *iter, struct bio *bio,
btrfs_submit_bbio(bbio, 0);
}

+static int btrfs_dio_iomap_next(const struct iomap_iter *iter,
+ struct iomap *iomap, struct iomap *srcmap)
+{
+ return iomap_process(iter, iomap, srcmap, btrfs_dio_iomap_begin,
+ btrfs_dio_iomap_end);
+}
+
static const struct iomap_ops btrfs_dio_iomap_ops = {
- .iomap_begin = btrfs_dio_iomap_begin,
- .iomap_end = btrfs_dio_iomap_end,
+ .iomap_next = btrfs_dio_iomap_next,
};

static const struct iomap_dio_ops btrfs_dio_ops = {
--
2.52.0