diff options
Diffstat (limited to 'fs/xfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/xfs_bmap_btree.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 7a02d391afec..c5eeb3241e25 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -699,6 +699,29 @@ xfs_bmbt_key_diff( | |||
699 | cur->bc_rec.b.br_startoff; | 699 | cur->bc_rec.b.br_startoff; |
700 | } | 700 | } |
701 | 701 | ||
702 | #ifdef DEBUG | ||
703 | STATIC int | ||
704 | xfs_bmbt_keys_inorder( | ||
705 | struct xfs_btree_cur *cur, | ||
706 | union xfs_btree_key *k1, | ||
707 | union xfs_btree_key *k2) | ||
708 | { | ||
709 | return be64_to_cpu(k1->bmbt.br_startoff) < | ||
710 | be64_to_cpu(k2->bmbt.br_startoff); | ||
711 | } | ||
712 | |||
713 | STATIC int | ||
714 | xfs_bmbt_recs_inorder( | ||
715 | struct xfs_btree_cur *cur, | ||
716 | union xfs_btree_rec *r1, | ||
717 | union xfs_btree_rec *r2) | ||
718 | { | ||
719 | return xfs_bmbt_disk_get_startoff(&r1->bmbt) + | ||
720 | xfs_bmbt_disk_get_blockcount(&r1->bmbt) <= | ||
721 | xfs_bmbt_disk_get_startoff(&r2->bmbt); | ||
722 | } | ||
723 | #endif /* DEBUG */ | ||
724 | |||
702 | #ifdef XFS_BTREE_TRACE | 725 | #ifdef XFS_BTREE_TRACE |
703 | ktrace_t *xfs_bmbt_trace_buf; | 726 | ktrace_t *xfs_bmbt_trace_buf; |
704 | 727 | ||
@@ -801,6 +824,11 @@ static const struct xfs_btree_ops xfs_bmbt_ops = { | |||
801 | .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, | 824 | .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, |
802 | .key_diff = xfs_bmbt_key_diff, | 825 | .key_diff = xfs_bmbt_key_diff, |
803 | 826 | ||
827 | #ifdef DEBUG | ||
828 | .keys_inorder = xfs_bmbt_keys_inorder, | ||
829 | .recs_inorder = xfs_bmbt_recs_inorder, | ||
830 | #endif | ||
831 | |||
804 | #ifdef XFS_BTREE_TRACE | 832 | #ifdef XFS_BTREE_TRACE |
805 | .trace_enter = xfs_bmbt_trace_enter, | 833 | .trace_enter = xfs_bmbt_trace_enter, |
806 | .trace_cursor = xfs_bmbt_trace_cursor, | 834 | .trace_cursor = xfs_bmbt_trace_cursor, |