From f7d40280be140b0a08ef914d758e19e48a0ff870 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Tue, 23 Jun 2015 15:08:47 +1000 Subject: [PATCH] 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 --- repair/scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; } -- 2.50.1