Skip to content

Commit 8f0028f

Browse files
author
Andreas Gruenbacher
committed
gfs2: Use better variable name
In do_promote() and add_to_queue(), use current_gh as the variable name for the first strong holder we could find: this matches the variable name is may_grant(), and more clearly indicates that we're interested in one (any) of the current strong holders. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 5f38a4d commit 8f0028f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/gfs2/glock.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,14 @@ int gfs2_instantiate(struct gfs2_holder *gh)
529529

530530
static int do_promote(struct gfs2_glock *gl)
531531
{
532-
struct gfs2_holder *gh, *tmp, *first_gh;
532+
struct gfs2_holder *gh, *tmp, *current_gh;
533533
bool incompat_holders_demoted = false;
534534

535-
first_gh = find_first_strong_holder(gl);
535+
current_gh = find_first_strong_holder(gl);
536536
list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) {
537537
if (test_bit(HIF_HOLDER, &gh->gh_iflags))
538538
continue;
539-
if (!may_grant(gl, first_gh, gh)) {
539+
if (!may_grant(gl, current_gh, gh)) {
540540
/*
541541
* If we get here, it means we may not grant this holder for
542542
* some reason. If this holder is the head of the list, it
@@ -548,9 +548,9 @@ static int do_promote(struct gfs2_glock *gl)
548548
break;
549549
}
550550
if (!incompat_holders_demoted) {
551-
demote_incompat_holders(gl, first_gh);
551+
demote_incompat_holders(gl, current_gh);
552552
incompat_holders_demoted = true;
553-
first_gh = gh;
553+
current_gh = gh;
554554
}
555555
set_bit(HIF_HOLDER, &gh->gh_iflags);
556556
trace_gfs2_promote(gh);
@@ -1456,10 +1456,10 @@ __acquires(&gl->gl_lockref.lock)
14561456

14571457
if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) {
14581458
if (test_bit(GLF_LOCK, &gl->gl_flags)) {
1459-
struct gfs2_holder *first_gh;
1459+
struct gfs2_holder *current_gh;
14601460

1461-
first_gh = find_first_strong_holder(gl);
1462-
try_futile = !may_grant(gl, first_gh, gh);
1461+
current_gh = find_first_strong_holder(gl);
1462+
try_futile = !may_grant(gl, current_gh, gh);
14631463
}
14641464
if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags))
14651465
goto fail;

0 commit comments

Comments
 (0)