Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201824
b: refs/heads/master
c: d5341a9
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Jul 29, 2010
1 parent 01a4d04 commit f0b2e90
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4244b52e18be959ced77b984f268e46a0a7654e3
refs/heads/master: d5341a92416706808dc5cd847826f28c08063c8c
49 changes: 25 additions & 24 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,30 @@ static void gfs2_holder_wake(struct gfs2_holder *gh)
wake_up_bit(&gh->gh_iflags, HIF_WAIT);
}

/**
* do_error - Something unexpected has happened during a lock request
*
*/

static inline void do_error(struct gfs2_glock *gl, const int ret)
{
struct gfs2_holder *gh, *tmp;

list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) {
if (test_bit(HIF_HOLDER, &gh->gh_iflags))
continue;
if (ret & LM_OUT_ERROR)
gh->gh_error = -EIO;
else if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))
gh->gh_error = GLR_TRYFAILED;
else
continue;
list_del_init(&gh->gh_list);
trace_gfs2_glock_queue(gh, 0);
gfs2_holder_wake(gh);
}
}

/**
* do_promote - promote as many requests as possible on the current queue
* @gl: The glock
Expand Down Expand Up @@ -375,35 +399,12 @@ __acquires(&gl->gl_spin)
}
if (gh->gh_list.prev == &gl->gl_holders)
return 1;
do_error(gl, 0);
break;
}
return 0;
}

/**
* do_error - Something unexpected has happened during a lock request
*
*/

static inline void do_error(struct gfs2_glock *gl, const int ret)
{
struct gfs2_holder *gh, *tmp;

list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) {
if (test_bit(HIF_HOLDER, &gh->gh_iflags))
continue;
if (ret & LM_OUT_ERROR)
gh->gh_error = -EIO;
else if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))
gh->gh_error = GLR_TRYFAILED;
else
continue;
list_del_init(&gh->gh_list);
trace_gfs2_glock_queue(gh, 0);
gfs2_holder_wake(gh);
}
}

/**
* find_first_waiter - find the first gh that's waiting for the glock
* @gl: the glock
Expand Down

0 comments on commit f0b2e90

Please sign in to comment.