diff options
author | Andreas Gruenbacher | 2023-08-08 22:46:34 +0200 |
---|---|---|
committer | Andreas Gruenbacher | 2023-09-05 15:58:16 +0200 |
commit | de3e7f97aebb7304856c46daf358ef14f0204219 (patch) | |
tree | e0909dac558949491c8e8032ccd931ac9af84a6d /fs | |
parent | dc0b9435238c1a68150c798c9c7a1b5d7414cbb9 (diff) |
gfs2: do_promote cleanup
Change function do_promote to return true on success, and false
otherwise.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/glock.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1438e7465e30..d0c82b721f90 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -468,10 +468,10 @@ done: * do_promote - promote as many requests as possible on the current queue * @gl: The glock * - * Returns: 1 if there is a blocked holder at the head of the list + * Returns true on success (i.e., progress was made or there are no waiters). */ -static int do_promote(struct gfs2_glock *gl) +static bool do_promote(struct gfs2_glock *gl) { struct gfs2_holder *gh, *current_gh; @@ -484,10 +484,10 @@ static int do_promote(struct gfs2_glock *gl) * If we get here, it means we may not grant this * holder for some reason. If this holder is at the * head of the list, it means we have a blocked holder - * at the head, so return 1. + * at the head, so return false. */ if (list_is_first(&gh->gh_list, &gl->gl_holders)) - return 1; + return false; do_error(gl, 0); break; } @@ -497,7 +497,7 @@ static int do_promote(struct gfs2_glock *gl) if (!current_gh) current_gh = gh; } - return 0; + return true; } /** @@ -834,7 +834,7 @@ __acquires(&gl->gl_lockref.lock) } else { if (test_bit(GLF_DEMOTE, &gl->gl_flags)) gfs2_demote_wake(gl); - if (do_promote(gl) == 0) + if (do_promote(gl)) goto out_unlock; gh = find_first_waiter(gl); gl->gl_target = gh->gh_state; |