Commit 17a6ecee authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: re-factor function do_promote

This patch simply re-factors function do_promote to reduce the indents.
The logic should be unchanged. This makes future patches more readable.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent d74d0ce5
...@@ -494,7 +494,17 @@ __acquires(&gl->gl_lockref.lock) ...@@ -494,7 +494,17 @@ __acquires(&gl->gl_lockref.lock)
list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) { list_for_each_entry_safe(gh, tmp, &gl->gl_holders, gh_list) {
if (!test_bit(HIF_WAIT, &gh->gh_iflags)) if (!test_bit(HIF_WAIT, &gh->gh_iflags))
continue; continue;
if (may_grant(gl, first_gh, gh)) { if (!may_grant(gl, first_gh, gh)) {
/*
* If we get here, it means we may not grant this holder for
* some reason. If this holder is the head of the list, it
* means we have a blocked holder at the head, so return 1.
*/
if (gh->gh_list.prev == &gl->gl_holders)
return 1;
do_error(gl, 0);
break;
}
if (!incompat_holders_demoted) { if (!incompat_holders_demoted) {
demote_incompat_holders(gl, first_gh); demote_incompat_holders(gl, first_gh);
incompat_holders_demoted = true; incompat_holders_demoted = true;
...@@ -525,17 +535,6 @@ __acquires(&gl->gl_lockref.lock) ...@@ -525,17 +535,6 @@ __acquires(&gl->gl_lockref.lock)
set_bit(HIF_HOLDER, &gh->gh_iflags); set_bit(HIF_HOLDER, &gh->gh_iflags);
trace_gfs2_promote(gh); trace_gfs2_promote(gh);
gfs2_holder_wake(gh); gfs2_holder_wake(gh);
continue;
}
/*
* If we get here, it means we may not grant this holder for
* some reason. If this holder is the head of the list, it
* means we have a blocked holder at the head, so return 1.
*/
if (gh->gh_list.prev == &gl->gl_holders)
return 1;
do_error(gl, 0);
break;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment