Convert ntfs 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 --- fs/ntfs/iomap.c | 56 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/fs/ntfs/iomap.c b/fs/ntfs/iomap.c index 52eecf5cb256..0f9f02e1593e 100644 --- a/fs/ntfs/iomap.c +++ b/fs/ntfs/iomap.c @@ -277,8 +277,14 @@ static int ntfs_read_iomap_begin(struct inode *inode, loff_t offset, loff_t leng srcmap, true); } +static int ntfs_read_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_read_iomap_begin, NULL); +} + const struct iomap_ops ntfs_read_iomap_ops = { - .iomap_begin = ntfs_read_iomap_begin, + .iomap_next = ntfs_read_iomap_next, }; /* @@ -329,13 +335,25 @@ static int ntfs_zero_read_iomap_end(struct inode *inode, loff_t pos, loff_t leng return written; } +static int ntfs_zero_read_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_seek_iomap_begin, + ntfs_zero_read_iomap_end); +} + static const struct iomap_ops ntfs_zero_read_iomap_ops = { - .iomap_begin = ntfs_seek_iomap_begin, - .iomap_end = ntfs_zero_read_iomap_end, + .iomap_next = ntfs_zero_read_iomap_next, }; +static int ntfs_seek_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_seek_iomap_begin, NULL); +} + const struct iomap_ops ntfs_seek_iomap_ops = { - .iomap_begin = ntfs_seek_iomap_begin, + .iomap_next = ntfs_seek_iomap_next, }; int ntfs_dio_zero_range(struct inode *inode, loff_t offset, loff_t length) @@ -764,9 +782,15 @@ static int ntfs_write_iomap_end(struct inode *inode, loff_t pos, loff_t length, return written; } +static int ntfs_write_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_write_iomap_begin, + ntfs_write_iomap_end); +} + const struct iomap_ops ntfs_write_iomap_ops = { - .iomap_begin = ntfs_write_iomap_begin, - .iomap_end = ntfs_write_iomap_end, + .iomap_next = ntfs_write_iomap_next, }; static int ntfs_page_mkwrite_iomap_begin(struct inode *inode, loff_t offset, @@ -777,9 +801,15 @@ static int ntfs_page_mkwrite_iomap_begin(struct inode *inode, loff_t offset, NTFS_IOMAP_FLAGS_MKWRITE); } +static int ntfs_page_mkwrite_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_page_mkwrite_iomap_begin, + ntfs_write_iomap_end); +} + const struct iomap_ops ntfs_page_mkwrite_iomap_ops = { - .iomap_begin = ntfs_page_mkwrite_iomap_begin, - .iomap_end = ntfs_write_iomap_end, + .iomap_next = ntfs_page_mkwrite_iomap_next, }; static int ntfs_dio_iomap_begin(struct inode *inode, loff_t offset, @@ -790,9 +820,15 @@ static int ntfs_dio_iomap_begin(struct inode *inode, loff_t offset, NTFS_IOMAP_FLAGS_DIO); } +static int ntfs_dio_iomap_next(const struct iomap_iter *iter, + struct iomap *iomap, struct iomap *srcmap) +{ + return iomap_process(iter, iomap, srcmap, ntfs_dio_iomap_begin, + ntfs_write_iomap_end); +} + const struct iomap_ops ntfs_dio_iomap_ops = { - .iomap_begin = ntfs_dio_iomap_begin, - .iomap_end = ntfs_write_iomap_end, + .iomap_next = ntfs_dio_iomap_next, }; static ssize_t ntfs_writeback_range(struct iomap_writepage_ctx *wpc, -- 2.52.0