提交 d64588ca 编写于 作者: D Dave Chinner 提交者: Dave Chinner

xfs: remove xfs_bmap_sanity_check()

This code is redundant now that we have verifiers that sanity check
the buffers as they are read from disk.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 964aa8d9
...@@ -244,30 +244,6 @@ xfs_bmap_forkoff_reset( ...@@ -244,30 +244,6 @@ xfs_bmap_forkoff_reset(
} }
} }
/*
* Debug/sanity checking code
*/
STATIC int
xfs_bmap_sanity_check(
struct xfs_mount *mp,
struct xfs_buf *bp,
int level)
{
struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp);
if (block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC) &&
block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC))
return 0;
if (be16_to_cpu(block->bb_level) != level ||
be16_to_cpu(block->bb_numrecs) == 0 ||
be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[level != 0])
return 0;
return 1;
}
#ifdef DEBUG #ifdef DEBUG
STATIC struct xfs_buf * STATIC struct xfs_buf *
xfs_bmap_get_bp( xfs_bmap_get_bp(
...@@ -410,9 +386,6 @@ xfs_bmap_check_leaf_extents( ...@@ -410,9 +386,6 @@ xfs_bmap_check_leaf_extents(
goto error_norelse; goto error_norelse;
} }
block = XFS_BUF_TO_BLOCK(bp); block = XFS_BUF_TO_BLOCK(bp);
XFS_WANT_CORRUPTED_GOTO(
xfs_bmap_sanity_check(mp, bp, level),
error0);
if (level == 0) if (level == 0)
break; break;
...@@ -1311,9 +1284,6 @@ xfs_bmap_read_extents( ...@@ -1311,9 +1284,6 @@ xfs_bmap_read_extents(
if (error) if (error)
return error; return error;
block = XFS_BUF_TO_BLOCK(bp); block = XFS_BUF_TO_BLOCK(bp);
XFS_WANT_CORRUPTED_GOTO(
xfs_bmap_sanity_check(mp, bp, level),
error0);
if (level == 0) if (level == 0)
break; break;
pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]); pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
...@@ -1345,9 +1315,6 @@ xfs_bmap_read_extents( ...@@ -1345,9 +1315,6 @@ xfs_bmap_read_extents(
XFS_ERRLEVEL_LOW, ip->i_mount, block); XFS_ERRLEVEL_LOW, ip->i_mount, block);
goto error0; goto error0;
} }
XFS_WANT_CORRUPTED_GOTO(
xfs_bmap_sanity_check(mp, bp, 0),
error0);
/* /*
* Read-ahead the next leaf block, if any. * Read-ahead the next leaf block, if any.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册