]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: simplify xfs_btree_check_sblock_siblings
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Apr 2024 17:01:06 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:39 +0000 (11:37 -0700)
Source kernel commit: 4bc94bf640e08cf970354036683ec143a7ae974e

Stop using xfs_btree_check_sptr in xfs_btree_check_sblock_siblings,
as it only duplicates the xfs_verify_agbno call in the other leg of
if / else besides adding a tautological level check.

With this the cur and level arguments can be removed as they are
now unused.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_btree.c

index 0b6d8d6f1de37f7c06a09768e4100b612b32e4e7..4ba36ecbbc36c81ba5973807fad5b9b3db0b3585 100644 (file)
@@ -83,8 +83,6 @@ xfs_btree_check_lblock_siblings(
 static inline xfs_failaddr_t
 xfs_btree_check_sblock_siblings(
        struct xfs_perag        *pag,
-       struct xfs_btree_cur    *cur,
-       int                     level,
        xfs_agblock_t           agbno,
        __be32                  dsibling)
 {
@@ -96,13 +94,8 @@ xfs_btree_check_sblock_siblings(
        sibling = be32_to_cpu(dsibling);
        if (sibling == agbno)
                return __this_address;
-       if (level >= 0) {
-               if (!xfs_btree_check_sptr(cur, sibling, level + 1))
-                       return __this_address;
-       } else {
-               if (!xfs_verify_agbno(pag, sibling))
-                       return __this_address;
-       }
+       if (!xfs_verify_agbno(pag, sibling))
+               return __this_address;
        return NULL;
 }
 
@@ -209,10 +202,10 @@ __xfs_btree_check_sblock(
        if (bp)
                agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(bp));
 
-       fa = xfs_btree_check_sblock_siblings(pag, cur, level, agbno,
+       fa = xfs_btree_check_sblock_siblings(pag, agbno,
                        block->bb_u.s.bb_leftsib);
        if (!fa)
-               fa = xfs_btree_check_sblock_siblings(pag, cur, level, agbno,
+               fa = xfs_btree_check_sblock_siblings(pag, agbno,
                                block->bb_u.s.bb_rightsib);
        return fa;
 }
@@ -4710,10 +4703,10 @@ xfs_btree_sblock_verify(
 
        /* sibling pointer verification */
        agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(bp));
-       fa = xfs_btree_check_sblock_siblings(bp->b_pag, NULL, -1, agbno,
+       fa = xfs_btree_check_sblock_siblings(bp->b_pag, agbno,
                        block->bb_u.s.bb_leftsib);
        if (!fa)
-               fa = xfs_btree_check_sblock_siblings(bp->b_pag, NULL, -1, agbno,
+               fa = xfs_btree_check_sblock_siblings(bp->b_pag, agbno,
                                block->bb_u.s.bb_rightsib);
        return fa;
 }