From: Dave Chinner Date: Fri, 15 Oct 2021 20:28:25 +0000 (-0400) Subject: xfs: convert raw ag walks to use for_each_perag X-Git-Tag: libxfs-5.14-sync_2021-10-16~36 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=29d36774e8b662f1ff2c2c397261884c3f25d0e6;p=thirdparty%2Fxfsprogs-dev.git xfs: convert raw ag walks to use for_each_perag Source kernel commit: 934933c3eec9e4a5826d3d7a47aca0742337fded Convert the raw walks to an iterator, pulling the current AG out of pag->pag_agno instead of the loop iterator variable. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_types.c b/libxfs/xfs_types.c index 8e67c5bbc..93dd10fb3 100644 --- a/libxfs/xfs_types.c +++ b/libxfs/xfs_types.c @@ -11,6 +11,7 @@ #include "xfs_trans_resv.h" #include "xfs_bit.h" #include "xfs_mount.h" +#include "xfs_ag.h" /* Find the size of the AG, in blocks. */ inline xfs_agblock_t @@ -222,12 +223,13 @@ xfs_icount_range( unsigned long long *max) { unsigned long long nr_inos = 0; + struct xfs_perag *pag; xfs_agnumber_t agno; /* root, rtbitmap, rtsum all live in the first chunk */ *min = XFS_INODES_PER_CHUNK; - for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { + for_each_perag(mp, agno, pag) { xfs_agino_t first, last; xfs_agino_range(mp, agno, &first, &last);