提交 07a79049 编写于 作者: B Bob Peterson 提交者: Steven Whitehouse

GFS2: Combine functions gfs2_glock_wait and wait_on_holder

Function gfs2_glock_wait only called function wait_on_holder and
returned its return code, so they were combined for readability.
Signed-off-by: NBob Peterson <rpeterso@redhat.com>
Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 4abb6ad9
...@@ -869,7 +869,14 @@ static int gfs2_glock_demote_wait(void *word) ...@@ -869,7 +869,14 @@ static int gfs2_glock_demote_wait(void *word)
return 0; 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; unsigned long time1 = jiffies;
...@@ -880,6 +887,7 @@ static void wait_on_holder(struct gfs2_holder *gh) ...@@ -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 + gh->gh_gl->gl_hold_time = min(gh->gh_gl->gl_hold_time +
GL_GLOCK_HOLD_INCR, GL_GLOCK_HOLD_INCR,
GL_GLOCK_MAX_HOLD); GL_GLOCK_MAX_HOLD);
return gh->gh_error;
} }
static void wait_on_demote(struct gfs2_glock *gl) static void wait_on_demote(struct gfs2_glock *gl)
...@@ -915,19 +923,6 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state, ...@@ -915,19 +923,6 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
trace_gfs2_demote_rq(gl); 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, ...) void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册