aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2021-10-06 08:59:52 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2021-10-25 08:42:19 +0200
commite6f856008d2364a16610d6269b6b38503d5e41a4 (patch)
tree2a164e13c4e3fa49013ce84cbae493b93fa7cf71 /fs
parent60d8bae9d16a52346ba738518bd43702d15eb834 (diff)
downloadlinux-e6f856008d2364a16610d6269b6b38503d5e41a4.tar.gz
gfs2: split glock instantiation off from do_promote
Before this patch, function do_promote had a section of code that did the actual instantiation. This patch splits that off into its own function, gfs2_instantiate, which prepares us for the next patch that will use that function. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index db213f0ef9605f..75d54ed7e54ed1 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -472,6 +472,21 @@ find_first_strong_holder(struct gfs2_glock *gl)
return NULL;
}
+/*
+ * gfs2_instantiate - Call the glops instantiate function
+ * @gl: The glock
+ *
+ * Returns: 0 if instantiate was successful, 2 if type specific operation is
+ * underway, or error.
+ */
+static int gfs2_instantiate(struct gfs2_holder *gh)
+{
+ struct gfs2_glock *gl = gh->gh_gl;
+ const struct gfs2_glock_operations *glops = gl->gl_ops;
+
+ return glops->go_instantiate(gh);
+}
+
/**
* do_promote - promote as many requests as possible on the current queue
* @gl: The glock
@@ -484,7 +499,6 @@ static int do_promote(struct gfs2_glock *gl)
__releases(&gl->gl_lockref.lock)
__acquires(&gl->gl_lockref.lock)
{
- const struct gfs2_glock_operations *glops = gl->gl_ops;
struct gfs2_holder *gh, *tmp, *first_gh;
bool incompat_holders_demoted = false;
bool lock_released;
@@ -513,10 +527,10 @@ restart:
first_gh = gh;
}
if (gh->gh_list.prev == &gl->gl_holders &&
- !(gh->gh_flags & GL_SKIP) && glops->go_instantiate) {
+ !(gh->gh_flags & GL_SKIP) && gl->gl_ops->go_instantiate) {
lock_released = true;
spin_unlock(&gl->gl_lockref.lock);
- ret = glops->go_instantiate(gh);
+ ret = gfs2_instantiate(gh);
spin_lock(&gl->gl_lockref.lock);
if (ret) {
if (ret == 1)