Convert erofs 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 <[email protected]>
---
 fs/erofs/data.c | 10 ++++++++--
 fs/erofs/zmap.c |  9 ++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 9aa48c8d67d1..47dba61ec576 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -380,9 +380,15 @@ static int erofs_iomap_end(struct inode *inode, loff_t 
pos, loff_t length,
        return written;
 }
 
+static int erofs_iomap_next(const struct iomap_iter *iter, struct iomap *iomap,
+                           struct iomap *srcmap)
+{
+       return iomap_process(iter, iomap, srcmap, erofs_iomap_begin,
+                            erofs_iomap_end);
+}
+
 static const struct iomap_ops erofs_iomap_ops = {
-       .iomap_begin = erofs_iomap_begin,
-       .iomap_end = erofs_iomap_end,
+       .iomap_next = erofs_iomap_next,
 };
 
 int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c
index bab521613552..dd058413a0b6 100644
--- a/fs/erofs/zmap.c
+++ b/fs/erofs/zmap.c
@@ -821,6 +821,13 @@ static int z_erofs_iomap_begin_report(struct inode *inode, 
loff_t offset,
        return 0;
 }
 
+static int z_erofs_iomap_next_report(const struct iomap_iter *iter,
+                                    struct iomap *iomap, struct iomap *srcmap)
+{
+       return iomap_process(iter, iomap, srcmap, z_erofs_iomap_begin_report,
+                            NULL);
+}
+
 const struct iomap_ops z_erofs_iomap_report_ops = {
-       .iomap_begin = z_erofs_iomap_begin_report,
+       .iomap_next = z_erofs_iomap_next_report,
 };
-- 
2.52.0


Reply via email to