Commit 8b8ada97 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: simplify xfs_btree_check_lblock_siblings

Stop using xfs_btree_check_lptr in xfs_btree_check_lblock_siblings,
as it only duplicates the xfs_verify_fsbno 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 4bc94bf6
...@@ -59,8 +59,6 @@ xfs_btree_magic( ...@@ -59,8 +59,6 @@ xfs_btree_magic(
static inline xfs_failaddr_t static inline xfs_failaddr_t
xfs_btree_check_lblock_siblings( xfs_btree_check_lblock_siblings(
struct xfs_mount *mp, struct xfs_mount *mp,
struct xfs_btree_cur *cur,
int level,
xfs_fsblock_t fsb, xfs_fsblock_t fsb,
__be64 dsibling) __be64 dsibling)
{ {
...@@ -72,14 +70,8 @@ xfs_btree_check_lblock_siblings( ...@@ -72,14 +70,8 @@ xfs_btree_check_lblock_siblings(
sibling = be64_to_cpu(dsibling); sibling = be64_to_cpu(dsibling);
if (sibling == fsb) if (sibling == fsb)
return __this_address; return __this_address;
if (level >= 0) {
if (!xfs_btree_check_lptr(cur, sibling, level + 1))
return __this_address;
} else {
if (!xfs_verify_fsbno(mp, sibling)) if (!xfs_verify_fsbno(mp, sibling))
return __this_address; return __this_address;
}
return NULL; return NULL;
} }
...@@ -139,10 +131,9 @@ __xfs_btree_check_lblock( ...@@ -139,10 +131,9 @@ __xfs_btree_check_lblock(
if (bp) if (bp)
fsb = XFS_DADDR_TO_FSB(mp, xfs_buf_daddr(bp)); fsb = XFS_DADDR_TO_FSB(mp, xfs_buf_daddr(bp));
fa = xfs_btree_check_lblock_siblings(mp, cur, level, fsb, fa = xfs_btree_check_lblock_siblings(mp, fsb, block->bb_u.l.bb_leftsib);
block->bb_u.l.bb_leftsib);
if (!fa) if (!fa)
fa = xfs_btree_check_lblock_siblings(mp, cur, level, fsb, fa = xfs_btree_check_lblock_siblings(mp, fsb,
block->bb_u.l.bb_rightsib); block->bb_u.l.bb_rightsib);
return fa; return fa;
} }
...@@ -4651,10 +4642,9 @@ xfs_btree_lblock_verify( ...@@ -4651,10 +4642,9 @@ xfs_btree_lblock_verify(
/* sibling pointer verification */ /* sibling pointer verification */
fsb = XFS_DADDR_TO_FSB(mp, xfs_buf_daddr(bp)); fsb = XFS_DADDR_TO_FSB(mp, xfs_buf_daddr(bp));
fa = xfs_btree_check_lblock_siblings(mp, NULL, -1, fsb, fa = xfs_btree_check_lblock_siblings(mp, fsb, block->bb_u.l.bb_leftsib);
block->bb_u.l.bb_leftsib);
if (!fa) if (!fa)
fa = xfs_btree_check_lblock_siblings(mp, NULL, -1, fsb, fa = xfs_btree_check_lblock_siblings(mp, fsb,
block->bb_u.l.bb_rightsib); block->bb_u.l.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