diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index d74fbec80622..23f14e595c18 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -5648,41 +5648,34 @@ xfs_bmap_eof( | |||
5648 | } | 5648 | } |
5649 | 5649 | ||
5650 | #ifdef DEBUG | 5650 | #ifdef DEBUG |
5651 | STATIC | 5651 | STATIC struct xfs_buf * |
5652 | xfs_buf_t * | ||
5653 | xfs_bmap_get_bp( | 5652 | xfs_bmap_get_bp( |
5654 | xfs_btree_cur_t *cur, | 5653 | struct xfs_btree_cur *cur, |
5655 | xfs_fsblock_t bno) | 5654 | xfs_fsblock_t bno) |
5656 | { | 5655 | { |
5657 | int i; | 5656 | struct xfs_log_item_desc *lidp; |
5658 | xfs_buf_t *bp; | 5657 | int i; |
5659 | 5658 | ||
5660 | if (!cur) | 5659 | if (!cur) |
5661 | return(NULL); | 5660 | return NULL; |
5662 | 5661 | ||
5663 | bp = NULL; | 5662 | for (i = 0; i < XFS_BTREE_MAXLEVELS; i++) { |
5664 | for(i = 0; i < XFS_BTREE_MAXLEVELS; i++) { | 5663 | if (!cur->bc_bufs[i]) |
5665 | bp = cur->bc_bufs[i]; | 5664 | break; |
5666 | if (!bp) break; | 5665 | if (XFS_BUF_ADDR(cur->bc_bufs[i]) == bno) |
5667 | if (XFS_BUF_ADDR(bp) == bno) | 5666 | return cur->bc_bufs[i]; |
5668 | break; /* Found it */ | ||
5669 | } | 5667 | } |
5670 | if (i == XFS_BTREE_MAXLEVELS) | ||
5671 | bp = NULL; | ||
5672 | 5668 | ||
5673 | if (!bp) { /* Chase down all the log items to see if the bp is there */ | 5669 | /* Chase down all the log items to see if the bp is there */ |
5674 | struct xfs_log_item_desc *lidp; | 5670 | list_for_each_entry(lidp, &cur->bc_tp->t_items, lid_trans) { |
5675 | struct xfs_buf_log_item *bip; | 5671 | struct xfs_buf_log_item *bip; |
5676 | 5672 | bip = (struct xfs_buf_log_item *)lidp->lid_item; | |
5677 | list_for_each_entry(lidp, &cur->bc_tp->t_items, lid_trans) { | 5673 | if (bip->bli_item.li_type == XFS_LI_BUF && |
5678 | bip = (struct xfs_buf_log_item *)lidp->lid_item; | 5674 | XFS_BUF_ADDR(bip->bli_buf) == bno) |
5679 | if (bip->bli_item.li_type == XFS_LI_BUF && | 5675 | return bip->bli_buf; |
5680 | XFS_BUF_ADDR(bip->bli_buf) == bno) | ||
5681 | return bip->bli_buf; | ||
5682 | } | ||
5683 | } | 5676 | } |
5684 | 5677 | ||
5685 | return bp; | 5678 | return NULL; |
5686 | } | 5679 | } |
5687 | 5680 | ||
5688 | STATIC void | 5681 | STATIC void |