]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: rename the agfl index loop variable in build_agf_agfl
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 10 Jul 2020 19:35:45 +0000 (15:35 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 10 Jul 2020 19:35:45 +0000 (15:35 -0400)
The variable 'i' is used to index the AGFL block list, so change the
name to make it clearer what this is to be used for.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase5.c

index f942ea17bbf567878736b79483f1089634e5a764..2bee9361dd63a1d02d6f6bd8f3768ff4c008819b 100644 (file)
@@ -2029,7 +2029,7 @@ build_agf_agfl(
 {
        struct extent_tree_node *ext_ptr;
        struct xfs_buf          *agf_buf, *agfl_buf;
-       int                     i;
+       unsigned int            agfl_idx;
        struct xfs_agfl         *agfl;
        struct xfs_agf          *agf;
        xfs_fsblock_t           fsb;
@@ -2127,8 +2127,8 @@ build_agf_agfl(
                agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC);
                agfl->agfl_seqno = cpu_to_be32(agno);
                platform_uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid);
-               for (i = 0; i < libxfs_agfl_size(mp); i++)
-                       freelist[i] = cpu_to_be32(NULLAGBLOCK);
+               for (agfl_idx = 0; agfl_idx < libxfs_agfl_size(mp); agfl_idx++)
+                       freelist[agfl_idx] = cpu_to_be32(NULLAGBLOCK);
        }
 
        /*
@@ -2139,19 +2139,21 @@ build_agf_agfl(
                /*
                 * yes, now grab as many blocks as we can
                 */
-               i = 0;
-               while (bno_bt->num_free_blocks > 0 && i < libxfs_agfl_size(mp))
+               agfl_idx = 0;
+               while (bno_bt->num_free_blocks > 0 &&
+                      agfl_idx < libxfs_agfl_size(mp))
                {
-                       freelist[i] = cpu_to_be32(
+                       freelist[agfl_idx] = cpu_to_be32(
                                        get_next_blockaddr(agno, 0, bno_bt));
-                       i++;
+                       agfl_idx++;
                }
 
-               while (bcnt_bt->num_free_blocks > 0 && i < libxfs_agfl_size(mp))
+               while (bcnt_bt->num_free_blocks > 0 &&
+                      agfl_idx < libxfs_agfl_size(mp))
                {
-                       freelist[i] = cpu_to_be32(
+                       freelist[agfl_idx] = cpu_to_be32(
                                        get_next_blockaddr(agno, 0, bcnt_bt));
-                       i++;
+                       agfl_idx++;
                }
                /*
                 * now throw the rest of the blocks away and complain
@@ -2174,9 +2176,9 @@ _("Insufficient memory saving lost blocks.\n"));
                }
 
                agf->agf_flfirst = 0;
-               agf->agf_fllast = cpu_to_be32(i - 1);
-               agf->agf_flcount = cpu_to_be32(i);
-               rmap_store_agflcount(mp, agno, i);
+               agf->agf_fllast = cpu_to_be32(agfl_idx - 1);
+               agf->agf_flcount = cpu_to_be32(agfl_idx);
+               rmap_store_agflcount(mp, agno, agfl_idx);
 
 #ifdef XR_BLD_FREE_TRACE
                fprintf(stderr, "writing agfl for ag %u\n", agno);