summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2025-02-24 17:47:57 +0300
committerChristian Brauner <brauner@kernel.org>2025-02-26 11:42:37 +0300
commitd79c9cc512973ef6583c3bfc0b343f9d312d85b3 (patch)
tree1da287f0d733f153d1e494daca38b37803fb796f /include
parentedd3e3b7d210747dec723edd2b6cb49d140c1256 (diff)
downloadlinux-d79c9cc512973ef6583c3bfc0b343f9d312d85b3.tar.xz
iomap: introduce a full map advance helper
Various iomap_iter_advance() calls advance by the full mapping length and thus have no need for the current length input or post-advance remaining length output from the standard advance function. Add an iomap_iter_advance_full() helper to clean up these cases. Signed-off-by: Brian Foster <bfoster@redhat.com> Link: https://lore.kernel.org/r/20250224144757.237706-13-bfoster@redhat.com Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iomap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index af9e51fba5f0..1fd66bc29cc1 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -272,6 +272,16 @@ static inline u64 iomap_length(const struct iomap_iter *iter)
}
/**
+ * iomap_iter_advance_full - advance by the full length of current map
+ */
+static inline int iomap_iter_advance_full(struct iomap_iter *iter)
+{
+ u64 length = iomap_length(iter);
+
+ return iomap_iter_advance(iter, &length);
+}
+
+/**
* iomap_iter_srcmap - return the source map for the current iomap iteration
* @i: iteration structure
*