Skip to content

Commit 3278b97

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: change go_lock to go_instantiate
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>
1 parent a739765 commit 3278b97

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

fs/gfs2/glock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,11 @@ __acquires(&gl->gl_lockref.lock)
501501
first_gh = gh;
502502
}
503503
if (gh->gh_list.prev == &gl->gl_holders &&
504-
glops->go_lock) {
504+
glops->go_instantiate) {
505505
if (!(gh->gh_flags & GL_SKIP)) {
506506
spin_unlock(&gl->gl_lockref.lock);
507507
/* FIXME: eliminate this eventually */
508-
ret = glops->go_lock(gh);
508+
ret = glops->go_instantiate(gh);
509509
spin_lock(&gl->gl_lockref.lock);
510510
if (ret) {
511511
if (ret == 1)

fs/gfs2/glops.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,13 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
482482
}
483483

484484
/**
485-
* inode_go_lock - operation done after an inode lock is locked by a process
485+
* inode_go_instantiate - read in an inode if necessary
486486
* @gh: The glock holder
487487
*
488488
* Returns: errno
489489
*/
490490

491-
static int inode_go_lock(struct gfs2_holder *gh)
491+
static int inode_go_instantiate(struct gfs2_holder *gh)
492492
{
493493
struct gfs2_glock *gl = gh->gh_gl;
494494
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
@@ -740,7 +740,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
740740
.go_sync = inode_go_sync,
741741
.go_inval = inode_go_inval,
742742
.go_demote_ok = inode_go_demote_ok,
743-
.go_lock = inode_go_lock,
743+
.go_instantiate = inode_go_instantiate,
744744
.go_dump = inode_go_dump,
745745
.go_type = LM_TYPE_INODE,
746746
.go_flags = GLOF_ASPACE | GLOF_LRU | GLOF_LVB,
@@ -750,7 +750,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
750750
const struct gfs2_glock_operations gfs2_rgrp_glops = {
751751
.go_sync = rgrp_go_sync,
752752
.go_inval = rgrp_go_inval,
753-
.go_lock = gfs2_rgrp_go_lock,
753+
.go_instantiate = gfs2_rgrp_go_instantiate,
754754
.go_dump = gfs2_rgrp_go_dump,
755755
.go_type = LM_TYPE_RGRP,
756756
.go_flags = GLOF_LVB,

fs/gfs2/incore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ struct gfs2_glock_operations {
220220
int (*go_xmote_bh)(struct gfs2_glock *gl);
221221
void (*go_inval) (struct gfs2_glock *gl, int flags);
222222
int (*go_demote_ok) (const struct gfs2_glock *gl);
223-
int (*go_lock) (struct gfs2_holder *gh);
223+
int (*go_instantiate) (struct gfs2_holder *gh);
224224
void (*go_dump)(struct seq_file *seq, struct gfs2_glock *gl,
225225
const char *fs_id_buf);
226226
void (*go_callback)(struct gfs2_glock *gl, bool remote);

fs/gfs2/rgrp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ static int update_rgrp_lvb(struct gfs2_rgrpd *rgd)
12881288
return 0;
12891289
}
12901290

1291-
int gfs2_rgrp_go_lock(struct gfs2_holder *gh)
1291+
int gfs2_rgrp_go_instantiate(struct gfs2_holder *gh)
12921292
{
12931293
struct gfs2_rgrpd *rgd = gh->gh_gl->gl_object;
12941294

fs/gfs2/rgrp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd);
3131
extern void gfs2_clear_rgrpd(struct gfs2_sbd *sdp);
3232
extern int gfs2_rindex_update(struct gfs2_sbd *sdp);
3333
extern void gfs2_free_clones(struct gfs2_rgrpd *rgd);
34-
extern int gfs2_rgrp_go_lock(struct gfs2_holder *gh);
34+
extern int gfs2_rgrp_go_instantiate(struct gfs2_holder *gh);
3535
extern void gfs2_rgrp_brelse(struct gfs2_rgrpd *rgd);
3636

3737
extern struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip);

0 commit comments

Comments
 (0)