]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: remove duplicate field from aghdr_cnts
authorBrian Foster <bfoster@redhat.com>
Thu, 30 Jul 2015 23:18:22 +0000 (09:18 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:18:22 +0000 (09:18 +1000)
The agicount and icount fields are used in separate parts of the AG scan
but both fields track the same data. agicount is used to compare with
the AGI header and icount is used to calculate the total inode count to
compare with sb_icount.

Use agicount rather than icount in scan_ags() and remove the icount
field.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/scan.c

index b0dbc0079542ff1504ebfe82f2cb3dd14192f107..e1825ed2226b42dcff890f4d08b0a5f182b0f5e4 100644 (file)
@@ -44,7 +44,6 @@ struct aghdr_cnts {
        __uint32_t      agicount;
        __uint32_t      agifreecount;
        __uint64_t      fdblocks;
-       __uint64_t      icount;
        __uint64_t      ifreecount;
        __uint32_t      fibtfreecount;
 };
@@ -1246,7 +1245,6 @@ _("inode btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
                        if (magic == XFS_IBT_MAGIC ||
                            magic == XFS_IBT_CRC_MAGIC) {
                                agcnts->agicount += XFS_INODES_PER_CHUNK;
-                               agcnts->icount += XFS_INODES_PER_CHUNK;
                                agcnts->agifreecount += freecount;
                                agcnts->ifreecount += freecount;
 
@@ -1685,7 +1683,7 @@ scan_ags(
        /* tally up the counts */
        for (i = 0; i < mp->m_sb.sb_agcount; i++) {
                fdblocks += agcnts[i].fdblocks;
-               icount += agcnts[i].icount;
+               icount += agcnts[i].agicount;
                ifreecount += agcnts[i].ifreecount;
        }