cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rpeterso@redhat.com <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 3/6] GFS2: Combine functions gfs2_glock_wait and wait_on_holder
Date: Thu,  9 Aug 2012 12:48:44 -0500	[thread overview]
Message-ID: <1344534527-28721-4-git-send-email-rpeterso@redhat.com> (raw)
In-Reply-To: <1344534527-28721-1-git-send-email-rpeterso@redhat.com>

From: Bob Peterson <rpeterso@redhat.com>

Function gfs2_glock_wait only called function wait_on_holder and
returned its return code, so they were combined for readability.
---
 fs/gfs2/glock.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 67f3e42..5c87909 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -869,7 +869,14 @@ static int gfs2_glock_demote_wait(void *word)
 	return 0;
 }
 
-static void wait_on_holder(struct gfs2_holder *gh)
+/**
+ * gfs2_glock_wait - wait on a glock acquisition
+ * @gh: the glock holder
+ *
+ * Returns: 0 on success
+ */
+
+int gfs2_glock_wait(struct gfs2_holder *gh)
 {
 	unsigned long time1 = jiffies;
 
@@ -880,6 +887,7 @@ static void wait_on_holder(struct gfs2_holder *gh)
 		gh->gh_gl->gl_hold_time = min(gh->gh_gl->gl_hold_time +
 					      GL_GLOCK_HOLD_INCR,
 					      GL_GLOCK_MAX_HOLD);
+	return gh->gh_error;
 }
 
 static void wait_on_demote(struct gfs2_glock *gl)
@@ -915,19 +923,6 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
 	trace_gfs2_demote_rq(gl);
 }
 
-/**
- * gfs2_glock_wait - wait on a glock acquisition
- * @gh: the glock holder
- *
- * Returns: 0 on success
- */
-
-int gfs2_glock_wait(struct gfs2_holder *gh)
-{
-	wait_on_holder(gh);
-	return gh->gh_error;
-}
-
 void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...)
 {
 	struct va_format vaf;
-- 
1.7.7.6



  parent reply	other threads:[~2012-08-09 17:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 17:48 [Cluster-devel] [PATCH 0/6] GFS2: Misc minor optimizations rpeterso
2012-08-09 17:48 ` [Cluster-devel] [PATCH 1/6] GFS2: change function gfs2_direct_IO to use a normal gfs2_glock_dq rpeterso
2012-08-10 11:07   ` Steven Whitehouse
2012-08-09 17:48 ` [Cluster-devel] [PATCH 2/6] GFS2: inline __gfs2_glock_schedule_for_reclaim rpeterso
2012-08-09 17:48 ` rpeterso [this message]
2012-08-09 17:48 ` [Cluster-devel] [PATCH 4/6] GFS2: Combine functions gfs2_glock_dq_wait and wait_on_demote rpeterso
2012-08-09 17:48 ` [Cluster-devel] [PATCH 5/6] GFS2: Eliminate redundant calls to may_grant rpeterso
2012-08-09 17:48 ` [Cluster-devel] [PATCH 6/6] GFS2: Eliminate unnecessary check for state > 3 in bitfit rpeterso

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=1344534527-28721-4-git-send-email-rpeterso@redhat.com \
    --to=rpeterso@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).