diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index ed4e3ae2c1d..ff8675b4197 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -5857,43 +5857,18 @@ xfs_bmap_get_bp( | |||
5857 | bp = NULL; | 5857 | bp = NULL; |
5858 | 5858 | ||
5859 | if (!bp) { /* Chase down all the log items to see if the bp is there */ | 5859 | if (!bp) { /* Chase down all the log items to see if the bp is there */ |
5860 | xfs_log_item_chunk_t *licp; | 5860 | struct xfs_log_item_desc *lidp; |
5861 | xfs_trans_t *tp; | 5861 | struct xfs_buf_log_item *bip; |
5862 | 5862 | ||
5863 | tp = cur->bc_tp; | 5863 | list_for_each_entry(lidp, &cur->bc_tp->t_items, lid_trans) { |
5864 | licp = &tp->t_items; | 5864 | bip = (struct xfs_buf_log_item *)lidp->lid_item; |
5865 | while (!bp && licp != NULL) { | 5865 | if (bip->bli_item.li_type == XFS_LI_BUF && |
5866 | if (xfs_lic_are_all_free(licp)) { | 5866 | XFS_BUF_ADDR(bip->bli_buf) == bno) |
5867 | licp = licp->lic_next; | 5867 | return bip->bli_buf; |
5868 | continue; | ||
5869 | } | ||
5870 | for (i = 0; i < licp->lic_unused; i++) { | ||
5871 | xfs_log_item_desc_t *lidp; | ||
5872 | xfs_log_item_t *lip; | ||
5873 | xfs_buf_log_item_t *bip; | ||
5874 | xfs_buf_t *lbp; | ||
5875 | |||
5876 | if (xfs_lic_isfree(licp, i)) { | ||
5877 | continue; | ||
5878 | } | ||
5879 | |||
5880 | lidp = xfs_lic_slot(licp, i); | ||
5881 | lip = lidp->lid_item; | ||
5882 | if (lip->li_type != XFS_LI_BUF) | ||
5883 | continue; | ||
5884 | |||
5885 | bip = (xfs_buf_log_item_t *)lip; | ||
5886 | lbp = bip->bli_buf; | ||
5887 | |||
5888 | if (XFS_BUF_ADDR(lbp) == bno) { | ||
5889 | bp = lbp; | ||
5890 | break; /* Found it */ | ||
5891 | } | ||
5892 | } | ||
5893 | licp = licp->lic_next; | ||
5894 | } | 5868 | } |
5895 | } | 5869 | } |
5896 | return(bp); | 5870 | |
5871 | return bp; | ||
5897 | } | 5872 | } |
5898 | 5873 | ||
5899 | STATIC void | 5874 | STATIC void |