xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH 16/28] repair: remove duplicate field from aghdr_cnts
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 2 Jun 2015 14:41:49 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1433270521-62026-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1433270521-62026-1-git-send-email-bfoster@xxxxxxxxxx>
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@xxxxxxxxxx>
---
 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

<Prev in Thread] Current Thread [Next in Thread>