]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: switch perag iteration from the for_each macros to a while based iterator
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Sep 2024 20:40:36 +0000 (13:40 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 2 Oct 2024 01:10:36 +0000 (18:10 -0700)
commit9ddd140c6c5c9c6eecbe9eae1d521e030933c1a0
tree3e755a06bd1c3fb8bed5b400d9d22de98e6f0006
parentace7be2f461e3663ca0684381767325b4c4a5e68
xfs: switch perag iteration from the for_each macros to a while based iterator

The current for_each_perag* macros are a bit annoying in that they
require the caller to both provide an object and an index iterator, and
also somewhat obsfucate the underlying control flow mechanism.

Switch to open coded while loops using new xfs_perag_next{,_from,_range}
helpers that return the next pag structure to iterate on based on the
previous one or NULL for the loop start.

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>
17 files changed:
fs/xfs/libxfs/xfs_ag.h
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_types.c
fs/xfs/scrub/bmap.c
fs/xfs/scrub/bmap_repair.c
fs/xfs/scrub/fscounters.c
fs/xfs/scrub/health.c
fs/xfs/scrub/inode_repair.c
fs/xfs/xfs_discard.c
fs/xfs/xfs_extent_busy.c
fs/xfs/xfs_fsmap.c
fs/xfs/xfs_fsops.c
fs/xfs/xfs_health.c
fs/xfs/xfs_icache.c
fs/xfs/xfs_iwalk.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_reflink.c