Commit 4bc94bf6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: simplify xfs_btree_check_sblock_siblings

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent ec793e69
...@@ -86,8 +86,6 @@ xfs_btree_check_lblock_siblings( ...@@ -86,8 +86,6 @@ xfs_btree_check_lblock_siblings(
static inline xfs_failaddr_t static inline xfs_failaddr_t
xfs_btree_check_sblock_siblings( xfs_btree_check_sblock_siblings(
struct xfs_perag *pag, struct xfs_perag *pag,
struct xfs_btree_cur *cur,
int level,
xfs_agblock_t agbno, xfs_agblock_t agbno,
__be32 dsibling) __be32 dsibling)
{ {
...@@ -99,13 +97,8 @@ xfs_btree_check_sblock_siblings( ...@@ -99,13 +97,8 @@ xfs_btree_check_sblock_siblings(
sibling = be32_to_cpu(dsibling); sibling = be32_to_cpu(dsibling);
if (sibling == agbno) if (sibling == agbno)
return __this_address; return __this_address;
if (level >= 0) { if (!xfs_verify_agbno(pag, sibling))
if (!xfs_btree_check_sptr(cur, sibling, level + 1)) return __this_address;
return __this_address;
} else {
if (!xfs_verify_agbno(pag, sibling))
return __this_address;
}
return NULL; return NULL;
} }
...@@ -212,10 +205,10 @@ __xfs_btree_check_sblock( ...@@ -212,10 +205,10 @@ __xfs_btree_check_sblock(
if (bp) if (bp)
agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(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); block->bb_u.s.bb_leftsib);
if (!fa) 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); block->bb_u.s.bb_rightsib);
return fa; return fa;
} }
...@@ -4713,10 +4706,10 @@ xfs_btree_sblock_verify( ...@@ -4713,10 +4706,10 @@ xfs_btree_sblock_verify(
/* sibling pointer verification */ /* sibling pointer verification */
agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(bp)); 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); block->bb_u.s.bb_leftsib);
if (!fa) 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); block->bb_u.s.bb_rightsib);
return fa; return fa;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment