diff options
Diffstat (limited to 'fs/xfs/xfs_trans_buf.c')
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 15584fc3ed7d..137e2b9e2948 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -54,7 +54,7 @@ xfs_trans_buf_item_match( | |||
54 | list_for_each_entry(lidp, &tp->t_items, lid_trans) { | 54 | list_for_each_entry(lidp, &tp->t_items, lid_trans) { |
55 | blip = (struct xfs_buf_log_item *)lidp->lid_item; | 55 | blip = (struct xfs_buf_log_item *)lidp->lid_item; |
56 | if (blip->bli_item.li_type == XFS_LI_BUF && | 56 | if (blip->bli_item.li_type == XFS_LI_BUF && |
57 | XFS_BUF_TARGET(blip->bli_buf) == target && | 57 | blip->bli_buf->b_target == target && |
58 | XFS_BUF_ADDR(blip->bli_buf) == blkno && | 58 | XFS_BUF_ADDR(blip->bli_buf) == blkno && |
59 | XFS_BUF_COUNT(blip->bli_buf) == len) | 59 | XFS_BUF_COUNT(blip->bli_buf) == len) |
60 | return blip->bli_buf; | 60 | return blip->bli_buf; |
@@ -80,7 +80,6 @@ _xfs_trans_bjoin( | |||
80 | { | 80 | { |
81 | struct xfs_buf_log_item *bip; | 81 | struct xfs_buf_log_item *bip; |
82 | 82 | ||
83 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
84 | ASSERT(bp->b_transp == NULL); | 83 | ASSERT(bp->b_transp == NULL); |
85 | 84 | ||
86 | /* | 85 | /* |
@@ -194,7 +193,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, | |||
194 | return NULL; | 193 | return NULL; |
195 | } | 194 | } |
196 | 195 | ||
197 | ASSERT(!XFS_BUF_GETERROR(bp)); | 196 | ASSERT(!bp->b_error); |
198 | 197 | ||
199 | _xfs_trans_bjoin(tp, bp, 1); | 198 | _xfs_trans_bjoin(tp, bp, 1); |
200 | trace_xfs_trans_get_buf(bp->b_fspriv); | 199 | trace_xfs_trans_get_buf(bp->b_fspriv); |
@@ -293,10 +292,10 @@ xfs_trans_read_buf( | |||
293 | return (flags & XBF_TRYLOCK) ? | 292 | return (flags & XBF_TRYLOCK) ? |
294 | EAGAIN : XFS_ERROR(ENOMEM); | 293 | EAGAIN : XFS_ERROR(ENOMEM); |
295 | 294 | ||
296 | if (XFS_BUF_GETERROR(bp) != 0) { | 295 | if (bp->b_error) { |
296 | error = bp->b_error; | ||
297 | xfs_ioerror_alert("xfs_trans_read_buf", mp, | 297 | xfs_ioerror_alert("xfs_trans_read_buf", mp, |
298 | bp, blkno); | 298 | bp, blkno); |
299 | error = XFS_BUF_GETERROR(bp); | ||
300 | xfs_buf_relse(bp); | 299 | xfs_buf_relse(bp); |
301 | return error; | 300 | return error; |
302 | } | 301 | } |
@@ -330,7 +329,7 @@ xfs_trans_read_buf( | |||
330 | ASSERT(xfs_buf_islocked(bp)); | 329 | ASSERT(xfs_buf_islocked(bp)); |
331 | ASSERT(bp->b_transp == tp); | 330 | ASSERT(bp->b_transp == tp); |
332 | ASSERT(bp->b_fspriv != NULL); | 331 | ASSERT(bp->b_fspriv != NULL); |
333 | ASSERT((XFS_BUF_ISERROR(bp)) == 0); | 332 | ASSERT(!bp->b_error); |
334 | if (!(XFS_BUF_ISDONE(bp))) { | 333 | if (!(XFS_BUF_ISDONE(bp))) { |
335 | trace_xfs_trans_read_buf_io(bp, _RET_IP_); | 334 | trace_xfs_trans_read_buf_io(bp, _RET_IP_); |
336 | ASSERT(!XFS_BUF_ISASYNC(bp)); | 335 | ASSERT(!XFS_BUF_ISASYNC(bp)); |
@@ -386,10 +385,9 @@ xfs_trans_read_buf( | |||
386 | return (flags & XBF_TRYLOCK) ? | 385 | return (flags & XBF_TRYLOCK) ? |
387 | 0 : XFS_ERROR(ENOMEM); | 386 | 0 : XFS_ERROR(ENOMEM); |
388 | } | 387 | } |
389 | if (XFS_BUF_GETERROR(bp) != 0) { | 388 | if (bp->b_error) { |
390 | XFS_BUF_SUPER_STALE(bp); | 389 | error = bp->b_error; |
391 | error = XFS_BUF_GETERROR(bp); | 390 | XFS_BUF_SUPER_STALE(bp); |
392 | |||
393 | xfs_ioerror_alert("xfs_trans_read_buf", mp, | 391 | xfs_ioerror_alert("xfs_trans_read_buf", mp, |
394 | bp, blkno); | 392 | bp, blkno); |
395 | if (tp->t_flags & XFS_TRANS_DIRTY) | 393 | if (tp->t_flags & XFS_TRANS_DIRTY) |
@@ -430,7 +428,7 @@ shutdown_abort: | |||
430 | if (XFS_BUF_ISSTALE(bp) && XFS_BUF_ISDELAYWRITE(bp)) | 428 | if (XFS_BUF_ISSTALE(bp) && XFS_BUF_ISDELAYWRITE(bp)) |
431 | xfs_notice(mp, "about to pop assert, bp == 0x%p", bp); | 429 | xfs_notice(mp, "about to pop assert, bp == 0x%p", bp); |
432 | #endif | 430 | #endif |
433 | ASSERT((XFS_BUF_BFLAGS(bp) & (XBF_STALE|XBF_DELWRI)) != | 431 | ASSERT((bp->b_flags & (XBF_STALE|XBF_DELWRI)) != |
434 | (XBF_STALE|XBF_DELWRI)); | 432 | (XBF_STALE|XBF_DELWRI)); |
435 | 433 | ||
436 | trace_xfs_trans_read_buf_shut(bp, _RET_IP_); | 434 | trace_xfs_trans_read_buf_shut(bp, _RET_IP_); |
@@ -581,7 +579,6 @@ xfs_trans_bhold(xfs_trans_t *tp, | |||
581 | { | 579 | { |
582 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 580 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
583 | 581 | ||
584 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
585 | ASSERT(bp->b_transp == tp); | 582 | ASSERT(bp->b_transp == tp); |
586 | ASSERT(bip != NULL); | 583 | ASSERT(bip != NULL); |
587 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); | 584 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); |
@@ -602,7 +599,6 @@ xfs_trans_bhold_release(xfs_trans_t *tp, | |||
602 | { | 599 | { |
603 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 600 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
604 | 601 | ||
605 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
606 | ASSERT(bp->b_transp == tp); | 602 | ASSERT(bp->b_transp == tp); |
607 | ASSERT(bip != NULL); | 603 | ASSERT(bip != NULL); |
608 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); | 604 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); |
@@ -631,7 +627,6 @@ xfs_trans_log_buf(xfs_trans_t *tp, | |||
631 | { | 627 | { |
632 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 628 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
633 | 629 | ||
634 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
635 | ASSERT(bp->b_transp == tp); | 630 | ASSERT(bp->b_transp == tp); |
636 | ASSERT(bip != NULL); | 631 | ASSERT(bip != NULL); |
637 | ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp))); | 632 | ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp))); |
@@ -702,7 +697,6 @@ xfs_trans_binval( | |||
702 | { | 697 | { |
703 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 698 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
704 | 699 | ||
705 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
706 | ASSERT(bp->b_transp == tp); | 700 | ASSERT(bp->b_transp == tp); |
707 | ASSERT(bip != NULL); | 701 | ASSERT(bip != NULL); |
708 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 702 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
@@ -774,7 +768,6 @@ xfs_trans_inode_buf( | |||
774 | { | 768 | { |
775 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 769 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
776 | 770 | ||
777 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
778 | ASSERT(bp->b_transp == tp); | 771 | ASSERT(bp->b_transp == tp); |
779 | ASSERT(bip != NULL); | 772 | ASSERT(bip != NULL); |
780 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 773 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
@@ -798,7 +791,6 @@ xfs_trans_stale_inode_buf( | |||
798 | { | 791 | { |
799 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 792 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
800 | 793 | ||
801 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
802 | ASSERT(bp->b_transp == tp); | 794 | ASSERT(bp->b_transp == tp); |
803 | ASSERT(bip != NULL); | 795 | ASSERT(bip != NULL); |
804 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 796 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
@@ -823,7 +815,6 @@ xfs_trans_inode_alloc_buf( | |||
823 | { | 815 | { |
824 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 816 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
825 | 817 | ||
826 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
827 | ASSERT(bp->b_transp == tp); | 818 | ASSERT(bp->b_transp == tp); |
828 | ASSERT(bip != NULL); | 819 | ASSERT(bip != NULL); |
829 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 820 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
@@ -851,7 +842,6 @@ xfs_trans_dquot_buf( | |||
851 | { | 842 | { |
852 | xfs_buf_log_item_t *bip = bp->b_fspriv; | 843 | xfs_buf_log_item_t *bip = bp->b_fspriv; |
853 | 844 | ||
854 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
855 | ASSERT(bp->b_transp == tp); | 845 | ASSERT(bp->b_transp == tp); |
856 | ASSERT(bip != NULL); | 846 | ASSERT(bip != NULL); |
857 | ASSERT(type == XFS_BLF_UDQUOT_BUF || | 847 | ASSERT(type == XFS_BLF_UDQUOT_BUF || |