[PATCH 16/28] repair: remove duplicate field from aghdr_cnts

Brian Foster bfoster at redhat.com
Tue Jun 2 13:41:49 CDT 2015


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 at redhat.com>
---
 repair/scan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/repair/scan.c b/repair/scan.c
index f42459c..9daa488 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;
 };
@@ -1229,7 +1228,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;
 
@@ -1668,7 +1666,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;
 	}
 
-- 
1.9.3



More information about the xfs mailing list