From: Christoph Hellwig <hch@sgi.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] keep lru_list_lock around osync_buffers_list
Date: Mon, 2 Dec 2002 23:47:54 -0500 [thread overview]
Message-ID: <20021202234754.A30978@sgi.com> (raw)
There's exactly one caller of osync_buffers_list (and it's static
to buffer.c), so we can keep holding lru_list_lock over the call
to it instead of releasing and reacquiring it.
--- 1.77/fs/buffer.c Sun Aug 25 21:28:55 2002
+++ edited/fs/buffer.c Mon Dec 2 21:48:11 2002
@@ -869,8 +869,8 @@
spin_lock(&lru_list_lock);
}
- spin_unlock(&lru_list_lock);
err2 = osync_buffers_list(list);
+ spin_unlock(&lru_list_lock);
if (err)
return err;
@@ -887,6 +887,8 @@
* you dirty the buffers, and then use osync_buffers_list to wait for
* completion. Any other dirty buffers which are not yet queued for
* write will not be flushed to disk by the osync.
+ *
+ * Expects lru_list_lock to be held at entry.
*/
static int osync_buffers_list(struct list_head *list)
{
@@ -894,8 +896,6 @@
struct list_head *p;
int err = 0;
- spin_lock(&lru_list_lock);
-
repeat:
list_for_each_prev(p, list) {
bh = BH_ENTRY(p);
@@ -911,7 +911,6 @@
}
}
- spin_unlock(&lru_list_lock);
return err;
}
reply other threads:[~2002-12-02 21:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20021202234754.A30978@sgi.com \
--to=hch@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome