diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:58:32 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:58:32 -0400 |
commit | 4a26e66e7728112f0e1cd7eca3bcc430b3a221c9 (patch) | |
tree | 1944f9aa65476c963658b7b4679f7a64287adfb6 /fs/xfs/xfs_bmap.c | |
parent | fd6bcc5b63051392ba709a8fd33173b263669e0a (diff) |
[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>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 5cceb8d3c162..b7f99d7576d0 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -6195,7 +6195,8 @@ xfs_check_block( | |||
6195 | } | 6195 | } |
6196 | 6196 | ||
6197 | if (prevp) { | 6197 | if (prevp) { |
6198 | xfs_btree_check_key(XFS_BTNUM_BMAP, prevp, keyp); | 6198 | ASSERT(be64_to_cpu(prevp->br_startoff) < |
6199 | be64_to_cpu(keyp->br_startoff)); | ||
6199 | } | 6200 | } |
6200 | prevp = keyp; | 6201 | prevp = keyp; |
6201 | 6202 | ||
@@ -6338,11 +6339,15 @@ xfs_bmap_check_leaf_extents( | |||
6338 | 6339 | ||
6339 | ep = XFS_BTREE_REC_ADDR(xfs_bmbt, block, 1); | 6340 | ep = XFS_BTREE_REC_ADDR(xfs_bmbt, block, 1); |
6340 | if (i) { | 6341 | if (i) { |
6341 | xfs_btree_check_rec(XFS_BTNUM_BMAP, &last, ep); | 6342 | ASSERT(xfs_bmbt_disk_get_startoff(&last) + |
6343 | xfs_bmbt_disk_get_blockcount(&last) <= | ||
6344 | xfs_bmbt_disk_get_startoff(ep)); | ||
6342 | } | 6345 | } |
6343 | for (j = 1; j < num_recs; j++) { | 6346 | for (j = 1; j < num_recs; j++) { |
6344 | nextp = XFS_BTREE_REC_ADDR(xfs_bmbt, block, j + 1); | 6347 | nextp = XFS_BTREE_REC_ADDR(xfs_bmbt, block, j + 1); |
6345 | xfs_btree_check_rec(XFS_BTNUM_BMAP, ep, nextp); | 6348 | ASSERT(xfs_bmbt_disk_get_startoff(ep) + |
6349 | xfs_bmbt_disk_get_blockcount(ep) <= | ||
6350 | xfs_bmbt_disk_get_startoff(nextp)); | ||
6346 | ep = nextp; | 6351 | ep = nextp; |
6347 | } | 6352 | } |
6348 | 6353 | ||