gfs2: change go_lock to go_instantiate
authorBob Peterson <rpeterso@redhat.com>
Wed, 29 Sep 2021 20:06:21 +0000 (15:06 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Oct 2021 06:42:18 +0000 (08:42 +0200)
Before this patch, the go_lock glock operations (glops) did not do
any actual locking. They were used to instantiate objects, like reading
in dinodes and rgrps from the media.

This patch renames the functions to go_instantiate for clarity.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/rgrp.c
fs/gfs2/rgrp.h

index 54a1ed3..7053628 100644 (file)
@@ -501,11 +501,11 @@ restart:
                                first_gh = gh;
                        }
                        if (gh->gh_list.prev == &gl->gl_holders &&
-                           glops->go_lock) {
+                           glops->go_instantiate) {
                                if (!(gh->gh_flags & GL_SKIP)) {
                                        spin_unlock(&gl->gl_lockref.lock);
                                        /* FIXME: eliminate this eventually */
-                                       ret = glops->go_lock(gh);
+                                       ret = glops->go_instantiate(gh);
                                        spin_lock(&gl->gl_lockref.lock);
                                        if (ret) {
                                                if (ret == 1)
index 4b19f51..8452a83 100644 (file)
@@ -482,13 +482,13 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
 }
 
 /**
- * inode_go_lock - operation done after an inode lock is locked by a process
+ * inode_go_instantiate - read in an inode if necessary
  * @gh: The glock holder
  *
  * Returns: errno
  */
 
-static int inode_go_lock(struct gfs2_holder *gh)
+static int inode_go_instantiate(struct gfs2_holder *gh)
 {
        struct gfs2_glock *gl = gh->gh_gl;
        struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
@@ -740,7 +740,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
        .go_sync = inode_go_sync,
        .go_inval = inode_go_inval,
        .go_demote_ok = inode_go_demote_ok,
-       .go_lock = inode_go_lock,
+       .go_instantiate = inode_go_instantiate,
        .go_dump = inode_go_dump,
        .go_type = LM_TYPE_INODE,
        .go_flags = GLOF_ASPACE | GLOF_LRU | GLOF_LVB,
@@ -750,7 +750,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
 const struct gfs2_glock_operations gfs2_rgrp_glops = {
        .go_sync = rgrp_go_sync,
        .go_inval = rgrp_go_inval,
-       .go_lock = gfs2_rgrp_go_lock,
+       .go_instantiate = gfs2_rgrp_go_instantiate,
        .go_dump = gfs2_rgrp_go_dump,
        .go_type = LM_TYPE_RGRP,
        .go_flags = GLOF_LVB,
index ca42d31..af632dc 100644 (file)
@@ -220,7 +220,7 @@ struct gfs2_glock_operations {
        int (*go_xmote_bh)(struct gfs2_glock *gl);
        void (*go_inval) (struct gfs2_glock *gl, int flags);
        int (*go_demote_ok) (const struct gfs2_glock *gl);
-       int (*go_lock) (struct gfs2_holder *gh);
+       int (*go_instantiate) (struct gfs2_holder *gh);
        void (*go_dump)(struct seq_file *seq, struct gfs2_glock *gl,
                        const char *fs_id_buf);
        void (*go_callback)(struct gfs2_glock *gl, bool remote);
index 96b2fbe..cdcbc82 100644 (file)
@@ -1288,7 +1288,7 @@ static int update_rgrp_lvb(struct gfs2_rgrpd *rgd)
        return 0;
 }
 
-int gfs2_rgrp_go_lock(struct gfs2_holder *gh)
+int gfs2_rgrp_go_instantiate(struct gfs2_holder *gh)
 {
        struct gfs2_rgrpd *rgd = gh->gh_gl->gl_object;
 
index a6855fd..3e2ca1f 100644 (file)
@@ -31,7 +31,7 @@ extern struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd);
 extern void gfs2_clear_rgrpd(struct gfs2_sbd *sdp);
 extern int gfs2_rindex_update(struct gfs2_sbd *sdp);
 extern void gfs2_free_clones(struct gfs2_rgrpd *rgd);
-extern int gfs2_rgrp_go_lock(struct gfs2_holder *gh);
+extern int gfs2_rgrp_go_instantiate(struct gfs2_holder *gh);
 extern void gfs2_rgrp_brelse(struct gfs2_rgrpd *rgd);
 
 extern struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip);