]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: cleanup build_agf_agfl
authorChristoph Hellwig <hch@lst.de>
Mon, 11 May 2020 20:48:40 +0000 (16:48 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 11 May 2020 20:48:40 +0000 (16:48 -0400)
No need to have two variables for the AGFL block number array.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase5.c

index 17b574487e52251d67ce674ffa7316d5bf87bb40..677297fe75d2ac0025a890d196422c75e7e0b458 100644 (file)
@@ -2149,18 +2149,15 @@ build_agf_agfl(
 
        /* setting to 0xff results in initialisation to NULLAGBLOCK */
        memset(agfl, 0xff, mp->m_sb.sb_sectsize);
+       freelist = xfs_buf_to_agfl_bno(agfl_buf);
        if (xfs_sb_version_hascrc(&mp->m_sb)) {
-               __be32 *agfl_bno = xfs_buf_to_agfl_bno(agfl_buf);
-
                agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC);
                agfl->agfl_seqno = cpu_to_be32(agno);
                platform_uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid);
                for (i = 0; i < libxfs_agfl_size(mp); i++)
-                       agfl_bno[i] = cpu_to_be32(NULLAGBLOCK);
+                       freelist[i] = cpu_to_be32(NULLAGBLOCK);
        }
 
-       freelist = xfs_buf_to_agfl_bno(agfl_buf);
-
        /*
         * do we have left-over blocks in the btree cursors that should
         * be used to fill the AGFL?