aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-08-23 04:28:04 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:14:59 -0400
commit527cfdf19dd538a5a9e46b9bed0f30a38c28438d (patch)
treed6fe2410b628b27b159f3db9113b9186c1871bfd /fs/xfs/xfs_buf.c
parent375ec69d2ef6e0797f19f5823e36e249765c3d41 (diff)
xfs: remove the unlock argument to xfs_buf_delwri_queue
We can just unlock the buffer in the caller, and the decrement of b_hold would also be needed in the !unlock, we just never hit that case currently given that the caller handles that case. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r--fs/xfs/xfs_buf.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 2e71a26da22e..04689dbbcbba 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -43,7 +43,7 @@
43 43
44static kmem_zone_t *xfs_buf_zone; 44static kmem_zone_t *xfs_buf_zone;
45STATIC int xfsbufd(void *); 45STATIC int xfsbufd(void *);
46STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int); 46STATIC void xfs_buf_delwri_queue(xfs_buf_t *);
47 47
48static struct workqueue_struct *xfslogd_workqueue; 48static struct workqueue_struct *xfslogd_workqueue;
49struct workqueue_struct *xfsdatad_workqueue; 49struct workqueue_struct *xfsdatad_workqueue;
@@ -940,7 +940,7 @@ xfs_buf_unlock(
940 if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI) { 940 if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI) {
941 atomic_inc(&bp->b_hold); 941 atomic_inc(&bp->b_hold);
942 bp->b_flags |= XBF_ASYNC; 942 bp->b_flags |= XBF_ASYNC;
943 xfs_buf_delwri_queue(bp, 0); 943 xfs_buf_delwri_queue(bp);
944 } 944 }
945 945
946 XB_CLEAR_OWNER(bp); 946 XB_CLEAR_OWNER(bp);
@@ -1049,7 +1049,8 @@ xfs_bdwrite(
1049 bp->b_flags &= ~XBF_READ; 1049 bp->b_flags &= ~XBF_READ;
1050 bp->b_flags |= (XBF_DELWRI | XBF_ASYNC); 1050 bp->b_flags |= (XBF_DELWRI | XBF_ASYNC);
1051 1051
1052 xfs_buf_delwri_queue(bp, 1); 1052 xfs_buf_delwri_queue(bp);
1053 xfs_buf_unlock(bp);
1053} 1054}
1054 1055
1055/* 1056/*
@@ -1562,8 +1563,7 @@ error:
1562 */ 1563 */
1563STATIC void 1564STATIC void
1564xfs_buf_delwri_queue( 1565xfs_buf_delwri_queue(
1565 xfs_buf_t *bp, 1566 xfs_buf_t *bp)
1566 int unlock)
1567{ 1567{
1568 struct list_head *dwq = &bp->b_target->bt_delwrite_queue; 1568 struct list_head *dwq = &bp->b_target->bt_delwrite_queue;
1569 spinlock_t *dwlk = &bp->b_target->bt_delwrite_lock; 1569 spinlock_t *dwlk = &bp->b_target->bt_delwrite_lock;
@@ -1576,8 +1576,7 @@ xfs_buf_delwri_queue(
1576 /* If already in the queue, dequeue and place at tail */ 1576 /* If already in the queue, dequeue and place at tail */
1577 if (!list_empty(&bp->b_list)) { 1577 if (!list_empty(&bp->b_list)) {
1578 ASSERT(bp->b_flags & _XBF_DELWRI_Q); 1578 ASSERT(bp->b_flags & _XBF_DELWRI_Q);
1579 if (unlock) 1579 atomic_dec(&bp->b_hold);
1580 atomic_dec(&bp->b_hold);
1581 list_del(&bp->b_list); 1580 list_del(&bp->b_list);
1582 } 1581 }
1583 1582
@@ -1590,9 +1589,6 @@ xfs_buf_delwri_queue(
1590 list_add_tail(&bp->b_list, dwq); 1589 list_add_tail(&bp->b_list, dwq);
1591 bp->b_queuetime = jiffies; 1590 bp->b_queuetime = jiffies;
1592 spin_unlock(dwlk); 1591 spin_unlock(dwlk);
1593
1594 if (unlock)
1595 xfs_buf_unlock(bp);
1596} 1592}
1597 1593
1598void 1594void