[XFS] add keys_inorder and recs_inorder btree methods

Add methods to check whether two keys/records are in the righ order. This
replaces the xfs_btree_check_key and xfs_btree_check_rec methods. For the
callers from xfs_bmap.c just opencode the bmbt-specific asserts.

SGI-PV: 985583

SGI-Modid: xfs-linux-melb:xfs-kern:32208a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Bill O'Donnell <billodo@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
This commit is contained in:
Christoph Hellwig 2008-10-30 16:58:32 +11:00 committed by Lachlan McIlroy
parent fd6bcc5b63
commit 4a26e66e77
6 changed files with 135 additions and 161 deletions

View file

@ -6195,7 +6195,8 @@ xfs_check_block(
}
if (prevp) {
xfs_btree_check_key(XFS_BTNUM_BMAP, prevp, keyp);
ASSERT(be64_to_cpu(prevp->br_startoff) <
be64_to_cpu(keyp->br_startoff));
}
prevp = keyp;
@ -6338,11 +6339,15 @@ xfs_bmap_check_leaf_extents(
ep = XFS_BTREE_REC_ADDR(xfs_bmbt, block, 1);
if (i) {
xfs_btree_check_rec(XFS_BTNUM_BMAP, &last, ep);
ASSERT(xfs_bmbt_disk_get_startoff(&last) +
xfs_bmbt_disk_get_blockcount(&last) <=
xfs_bmbt_disk_get_startoff(ep));
}
for (j = 1; j < num_recs; j++) {
nextp = XFS_BTREE_REC_ADDR(xfs_bmbt, block, j + 1);
xfs_btree_check_rec(XFS_BTNUM_BMAP, ep, nextp);
ASSERT(xfs_bmbt_disk_get_startoff(ep) +
xfs_bmbt_disk_get_blockcount(ep) <=
xfs_bmbt_disk_get_startoff(nextp));
ep = nextp;
}