From: Brian Foster Date: Thu, 30 Jul 2015 23:18:22 +0000 (+1000) Subject: repair: remove duplicate field from aghdr_cnts X-Git-Tag: v4.2.0-rc1~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37246b955506a0c189f7a68e57ea8899fe7d9327;p=thirdparty%2Fxfsprogs-dev.git repair: remove duplicate field from aghdr_cnts 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 Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/repair/scan.c b/repair/scan.c index b0dbc0079..e1825ed22 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -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; }