]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: introduce xfs_for_each_perag_wrap()
authorDave Chinner <dchinner@redhat.com>
Tue, 9 May 2023 09:29:50 +0000 (11:29 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 May 2023 08:21:00 +0000 (10:21 +0200)
commit5cb4ffc839c4fbab117fd9a68de6f65bbdffb4a1
treed4333b695aad34c197aa91fb077f72dd987037fc
parent03dc2ef2a52715ca7557b9c35b0d39ee1ccddfff
xfs: introduce xfs_for_each_perag_wrap()

Source kernel commit: 76257a15873ccce817e0c4441f6bb66fb8f8201c

In several places we iterate every AG from a specific start agno and
wrap back to the first AG when we reach the end of the filesystem to
continue searching. We don't have a primitive for this iteration
yet, so add one for conversion of these algorithms to per-ag based
iteration.

The filestream AG select code is a mess, and this initially makes it
worse. The per-ag selection needs to be driven completely into the
filestream code to clean this up and it will be done in a future
patch that makes the filestream allocator use active per-ag
references correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_ag.h
libxfs/xfs_bmap.c
libxfs/xfs_ialloc.c