aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_btree.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 01:58:32 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:58:32 -0400
commit4a26e66e7728112f0e1cd7eca3bcc430b3a221c9 (patch)
tree1944f9aa65476c963658b7b4679f7a64287adfb6 /fs/xfs/xfs_btree.h
parentfd6bcc5b63051392ba709a8fd33173b263669e0a (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_btree.h')
-rw-r--r--fs/xfs/xfs_btree.h36
1 files changed, 12 insertions, 24 deletions
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index d6cc71e31de5..25a488d4da18 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -229,6 +229,18 @@ struct xfs_btree_ops {
229 __int64_t (*key_diff)(struct xfs_btree_cur *cur, 229 __int64_t (*key_diff)(struct xfs_btree_cur *cur,
230 union xfs_btree_key *key); 230 union xfs_btree_key *key);
231 231
232#ifdef DEBUG
233 /* check that k1 is lower than k2 */
234 int (*keys_inorder)(struct xfs_btree_cur *cur,
235 union xfs_btree_key *k1,
236 union xfs_btree_key *k2);
237
238 /* check that r1 is lower than r2 */
239 int (*recs_inorder)(struct xfs_btree_cur *cur,
240 union xfs_btree_rec *r1,
241 union xfs_btree_rec *r2);
242#endif
243
232 /* btree tracing */ 244 /* btree tracing */
233#ifdef XFS_BTREE_TRACE 245#ifdef XFS_BTREE_TRACE
234 void (*trace_enter)(struct xfs_btree_cur *, const char *, 246 void (*trace_enter)(struct xfs_btree_cur *, const char *,
@@ -379,30 +391,6 @@ xfs_btree_check_ptr(
379 int index, /* offset from ptr to check */ 391 int index, /* offset from ptr to check */
380 int level); /* btree block level */ 392 int level); /* btree block level */
381 393
382#ifdef DEBUG
383
384/*
385 * Debug routine: check that keys are in the right order.
386 */
387void
388xfs_btree_check_key(
389 xfs_btnum_t btnum, /* btree identifier */
390 void *ak1, /* pointer to left (lower) key */
391 void *ak2); /* pointer to right (higher) key */
392
393/*
394 * Debug routine: check that records are in the right order.
395 */
396void
397xfs_btree_check_rec(
398 xfs_btnum_t btnum, /* btree identifier */
399 void *ar1, /* pointer to left (lower) record */
400 void *ar2); /* pointer to right (higher) record */
401#else
402#define xfs_btree_check_key(a, b, c)
403#define xfs_btree_check_rec(a, b, c)
404#endif /* DEBUG */
405
406/* 394/*
407 * Delete the btree cursor. 395 * Delete the btree cursor.
408 */ 396 */