All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: [PATCH 02/11] xfs: remove the unlock argument to xfs_buf_delwri_queue
Date: Tue, 23 Aug 2011 04:28:04 -0400	[thread overview]
Message-ID: <20110823082912.127871770@bombadil.infradead.org> (raw)
In-Reply-To: 20110823082802.335389799@bombadil.infradead.org

[-- Attachment #1: xfs-simplify-xfs_buf_delwri_queue --]
[-- Type: text/plain, Size: 1965 bytes --]

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>

--- xfs.orig/fs/xfs/xfs_buf.c	2011-08-11 22:29:23.490069868 +0200
+++ xfs/fs/xfs/xfs_buf.c	2011-08-11 22:31:10.196731133 +0200
@@ -43,7 +43,7 @@
 
 static kmem_zone_t *xfs_buf_zone;
 STATIC int xfsbufd(void *);
-STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int);
+STATIC void xfs_buf_delwri_queue(xfs_buf_t *);
 
 static struct workqueue_struct *xfslogd_workqueue;
 struct workqueue_struct *xfsdatad_workqueue;
@@ -940,7 +940,7 @@ xfs_buf_unlock(
 	if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI) {
 		atomic_inc(&bp->b_hold);
 		bp->b_flags |= XBF_ASYNC;
-		xfs_buf_delwri_queue(bp, 0);
+		xfs_buf_delwri_queue(bp);
 	}
 
 	XB_CLEAR_OWNER(bp);
@@ -1049,7 +1049,8 @@ xfs_bdwrite(
 	bp->b_flags &= ~XBF_READ;
 	bp->b_flags |= (XBF_DELWRI | XBF_ASYNC);
 
-	xfs_buf_delwri_queue(bp, 1);
+	xfs_buf_delwri_queue(bp);
+	xfs_buf_unlock(bp);
 }
 
 /*
@@ -1562,8 +1563,7 @@ error:
  */
 STATIC void
 xfs_buf_delwri_queue(
-	xfs_buf_t		*bp,
-	int			unlock)
+	xfs_buf_t		*bp)
 {
 	struct list_head	*dwq = &bp->b_target->bt_delwrite_queue;
 	spinlock_t		*dwlk = &bp->b_target->bt_delwrite_lock;
@@ -1576,8 +1576,7 @@ xfs_buf_delwri_queue(
 	/* If already in the queue, dequeue and place at tail */
 	if (!list_empty(&bp->b_list)) {
 		ASSERT(bp->b_flags & _XBF_DELWRI_Q);
-		if (unlock)
-			atomic_dec(&bp->b_hold);
+		atomic_dec(&bp->b_hold);
 		list_del(&bp->b_list);
 	}
 
@@ -1590,9 +1589,6 @@ xfs_buf_delwri_queue(
 	list_add_tail(&bp->b_list, dwq);
 	bp->b_queuetime = jiffies;
 	spin_unlock(dwlk);
-
-	if (unlock)
-		xfs_buf_unlock(bp);
 }
 
 void

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2011-08-23  8:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23  8:28 [PATCH 00/11] patch queue for Linux 3.2 Christoph Hellwig
2011-08-23  8:28 ` [PATCH 01/11] xfs: remove delwri buffer handling from xfs_buf_iorequest Christoph Hellwig
2011-09-01 19:21   ` Alex Elder
2011-08-23  8:28 ` Christoph Hellwig [this message]
2011-09-01 19:22   ` [PATCH 02/11] xfs: remove the unlock argument to xfs_buf_delwri_queue Alex Elder
2011-09-01 21:39     ` Christoph Hellwig
2011-08-23  8:28 ` [PATCH 03/11] xfs: move more delwri setup into xfs_buf_delwri_queue Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 04/11] xfs: call xfs_buf_delwri_queue directly Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-09-01 21:46     ` Christoph Hellwig
2011-09-02  0:17       ` Dave Chinner
2011-08-23  8:28 ` [PATCH 05/11] xfs: let xfs_bwrite callers handle the xfs_buf_relse Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 06/11] xfs: use the "delwri" terminology consistently Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 07/11] xfs: remove dead ENODEV handling in xfs_destroy_ioend Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 08/11] xfs: defer AIO/DIO completions Christoph Hellwig
2011-08-24  0:01   ` Dave Chinner
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 09/11] xfs: reduce ioend latency Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 10/11] xfs: wait for I/O completion when writing out pages in xfs_setattr_size Christoph Hellwig
2011-09-01 19:22   ` Alex Elder
2011-08-23  8:28 ` [PATCH 11/11] xfs: remove i_iocount Christoph Hellwig
2011-09-01 19:22   ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110823082912.127871770@bombadil.infradead.org \
    --to=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.