From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] [GFS2] Clean up run_queue()
Date: Mon, 30 Jul 2007 10:32:15 +0100 [thread overview]
Message-ID: <11857879472203-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1185787946183-git-send-email-swhiteho@redhat.com>
A further clean up to make the logic a bit more obvious and
remove a local variable which is no longer required.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 65d6eba..79d61ff 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -564,24 +564,19 @@ static int rq_demote(struct gfs2_glock *gl)
*/
static void run_queue(struct gfs2_glock *gl)
{
- int blocked;
-
- for (;;) {
- blocked = 1;
- if (test_bit(GLF_LOCK, &gl->gl_flags))
- break;
-
+ while(test_bit(GLF_LOCK, &gl->gl_flags) == 0) {
if (!list_empty(&gl->gl_waiters1)) {
rq_mutex(gl);
break;
- } else if (test_bit(GLF_DEMOTE, &gl->gl_flags)) {
- blocked = rq_demote(gl);
+ }
+ if (test_bit(GLF_DEMOTE, &gl->gl_flags)) {
+ if (rq_demote(gl) == 0)
+ continue;
} else if (!list_empty(&gl->gl_waiters3)) {
- blocked = rq_promote(gl);
+ if (rq_promote(gl) == 0)
+ continue;
}
-
- if (blocked)
- break;
+ break;
}
}
--
1.5.1.2
next prev parent reply other threads:[~2007-07-30 9:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-30 9:32 [Cluster-devel] [GFS2] Clean up glock layer Steven Whitehouse
2007-07-30 9:32 ` [Cluster-devel] [PATCH] [GFS2] Clean up arguments to rq_mutex/rq_promote Steven Whitehouse
2007-07-30 9:32 ` Steven Whitehouse [this message]
2007-07-30 9:32 ` [Cluster-devel] [PATCH] [GFS2] Merge ->go_drop_th() with ->go_xmote_th() Steven Whitehouse
2007-07-30 9:32 ` [Cluster-devel] [PATCH] [GFS2] Merge gfs2_glock_drop_th() into gfs2_glock_xmote_th() Steven Whitehouse
2007-07-30 9:32 ` [Cluster-devel] [PATCH] [GFs2] Remove reclaim logic from rq_promote() Steven Whitehouse
2007-08-02 13:39 ` [Cluster-devel] [PATCH] [GFS2] Clean up run_queue() David Teigland
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=11857879472203-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).