diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-07-21 22:52:08 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-07-26 14:16:53 -0400 |
commit | ecd7f082d68d7fb1c96bcf72071aa85db9c00ddf (patch) | |
tree | 1cc4b35219fd1437ec52bc8519a5de96281ba00f /fs | |
parent | 5d18898b20dfed5f373f8a9a7cbe01446036f8e9 (diff) |
xfs: clean up xfs_bmap_get_bp
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs')
-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 |