aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r--fs/xfs/xfs_buf.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 942cf5051ab4..8366348aa1f9 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -185,7 +185,7 @@ xfs_buf_alloc(
185 /* 185 /*
186 * We don't want certain flags to appear in b_flags. 186 * We don't want certain flags to appear in b_flags.
187 */ 187 */
188 flags &= ~(XBF_LOCK|XBF_MAPPED|XBF_DONT_BLOCK|XBF_READ_AHEAD); 188 flags &= ~(XBF_MAPPED|XBF_DONT_BLOCK|XBF_READ_AHEAD);
189 189
190 atomic_set(&bp->b_hold, 1); 190 atomic_set(&bp->b_hold, 1);
191 atomic_set(&bp->b_lru_ref, 1); 191 atomic_set(&bp->b_lru_ref, 1);
@@ -584,19 +584,14 @@ found:
584 if (unlikely(error)) { 584 if (unlikely(error)) {
585 xfs_warn(target->bt_mount, 585 xfs_warn(target->bt_mount,
586 "%s: failed to map pages\n", __func__); 586 "%s: failed to map pages\n", __func__);
587 goto no_buffer; 587 xfs_buf_relse(bp);
588 return NULL;
588 } 589 }
589 } 590 }
590 591
591 XFS_STATS_INC(xb_get); 592 XFS_STATS_INC(xb_get);
592 trace_xfs_buf_get(bp, flags, _RET_IP_); 593 trace_xfs_buf_get(bp, flags, _RET_IP_);
593 return bp; 594 return bp;
594
595no_buffer:
596 if (flags & (XBF_LOCK | XBF_TRYLOCK))
597 xfs_buf_unlock(bp);
598 xfs_buf_rele(bp);
599 return NULL;
600} 595}
601 596
602STATIC int 597STATIC int
@@ -639,7 +634,8 @@ xfs_buf_read(
639 * Read ahead call which is already satisfied, 634 * Read ahead call which is already satisfied,
640 * drop the buffer 635 * drop the buffer
641 */ 636 */
642 goto no_buffer; 637 xfs_buf_relse(bp);
638 return NULL;
643 } else { 639 } else {
644 /* We do not want read in the flags */ 640 /* We do not want read in the flags */
645 bp->b_flags &= ~XBF_READ; 641 bp->b_flags &= ~XBF_READ;
@@ -647,12 +643,6 @@ xfs_buf_read(
647 } 643 }
648 644
649 return bp; 645 return bp;
650
651 no_buffer:
652 if (flags & (XBF_LOCK | XBF_TRYLOCK))
653 xfs_buf_unlock(bp);
654 xfs_buf_rele(bp);
655 return NULL;
656} 646}
657 647
658/* 648/*