]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: convert raw ag walks to use for_each_perag
authorDave Chinner <dchinner@redhat.com>
Fri, 15 Oct 2021 20:28:25 +0000 (16:28 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 15 Oct 2021 20:28:25 +0000 (16:28 -0400)
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 <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_types.c

index 8e67c5bbc2a7d069afd40608f8c665f51678b69b..93dd10fb365fb33bff95f0999370628550560e54 100644 (file)
@@ -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);