]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: add a xfs_group_next_range helper
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 04:18:39 +0000 (20:18 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:27 +0000 (13:38 -0800)
commit819928770bd91960f88f5a4dfa21b35a1bade61b
treec3e652355ee635e4fcb4f4b12a45efb6ed3656fa
parente9c4d8bfb26c13c41b73fdf4183d3df2d392101e
xfs: add a xfs_group_next_range helper

Add a helper to iterate over iterate over all groups, which can be used
as a simple while loop:

struct xfs_group *xg = NULL;

while ((xg = xfs_group_next_range(mp, xg, 0, MAX_GROUP))) {
...
}

This will be wrapped by the realtime group code first, and eventually
replace the for_each_rtgroup_from and for_each_rtgroup_range helpers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_group.c
fs/xfs/libxfs/xfs_group.h