Skip to content

Commit 121e730

Browse files
author
Andreas Gruenbacher
committed
gfs2: Rename GLF_FREEING to GLF_UNLOCKED
Rename the GLF_FREEING flag to GLF_UNLOCKED, and the ->go_free glock operation to ->go_unlocked. This mechanism is used to wait for the underlying DLM lock to be unlocked; being able to free the glock is a consequence of the DLM lock being unlocked. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 932a905 commit 121e730

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

fs/gfs2/glock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
23782378
*p++ = 'o';
23792379
if (test_bit(GLF_BLOCKING, gflags))
23802380
*p++ = 'b';
2381-
if (test_bit(GLF_FREEING, gflags))
2381+
if (test_bit(GLF_UNLOCKED, gflags))
23822382
*p++ = 'x';
23832383
if (test_bit(GLF_INSTANTIATE_NEEDED, gflags))
23842384
*p++ = 'n';

fs/gfs2/glops.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,21 +648,21 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
648648
}
649649

650650
/**
651-
* inode_go_free - wake up anyone waiting for dlm's unlock ast to free it
652-
* @gl: glock being freed
651+
* inode_go_unlocked - wake up anyone waiting for dlm's unlock ast
652+
* @gl: glock being unlocked
653653
*
654654
* For now, this is only used for the journal inode glock. In withdraw
655-
* situations, we need to wait for the glock to be freed so that we know
655+
* situations, we need to wait for the glock to be unlocked so that we know
656656
* other nodes may proceed with recovery / journal replay.
657657
*/
658-
static void inode_go_free(struct gfs2_glock *gl)
658+
static void inode_go_unlocked(struct gfs2_glock *gl)
659659
{
660660
/* Note that we cannot reference gl_object because it's already set
661661
* to NULL by this point in its lifecycle. */
662-
if (!test_bit(GLF_FREEING, &gl->gl_flags))
662+
if (!test_bit(GLF_UNLOCKED, &gl->gl_flags))
663663
return;
664-
clear_bit_unlock(GLF_FREEING, &gl->gl_flags);
665-
wake_up_bit(&gl->gl_flags, GLF_FREEING);
664+
clear_bit_unlock(GLF_UNLOCKED, &gl->gl_flags);
665+
wake_up_bit(&gl->gl_flags, GLF_UNLOCKED);
666666
}
667667

668668
/**
@@ -728,7 +728,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
728728
.go_dump = inode_go_dump,
729729
.go_type = LM_TYPE_INODE,
730730
.go_flags = GLOF_ASPACE | GLOF_LRU | GLOF_LVB,
731-
.go_free = inode_go_free,
731+
.go_unlocked = inode_go_unlocked,
732732
};
733733

734734
const struct gfs2_glock_operations gfs2_rgrp_glops = {

fs/gfs2/incore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ struct gfs2_glock_operations {
224224
void (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl,
225225
const char *fs_id_buf);
226226
void (*go_callback)(struct gfs2_glock *gl, bool remote);
227-
void (*go_free)(struct gfs2_glock *gl);
227+
void (*go_unlocked)(struct gfs2_glock *gl);
228228
const int go_subclass;
229229
const int go_type;
230230
const unsigned long go_flags;
@@ -329,7 +329,7 @@ enum {
329329
GLF_LRU = 13,
330330
GLF_OBJECT = 14, /* Used only for tracing */
331331
GLF_BLOCKING = 15,
332-
GLF_FREEING = 16, /* Wait for glock to be freed */
332+
GLF_UNLOCKED = 16, /* Wait for glock to be unlocked */
333333
GLF_TRY_TO_EVICT = 17, /* iopen glocks only */
334334
GLF_VERIFY_EVICT = 18, /* iopen glocks only */
335335
};

fs/gfs2/lock_dlm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ static void gdlm_ast(void *arg)
134134

135135
switch (gl->gl_lksb.sb_status) {
136136
case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
137-
if (gl->gl_ops->go_free)
138-
gl->gl_ops->go_free(gl);
137+
if (gl->gl_ops->go_unlocked)
138+
gl->gl_ops->go_unlocked(gl);
139139
gfs2_glock_free(gl);
140140
return;
141141
case -DLM_ECANCEL: /* Cancel while getting lock */

fs/gfs2/util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
206206
* on other nodes to be successful, otherwise we remain the owner of
207207
* the glock as far as dlm is concerned.
208208
*/
209-
if (i_gl->gl_ops->go_free) {
210-
set_bit(GLF_FREEING, &i_gl->gl_flags);
211-
wait_on_bit(&i_gl->gl_flags, GLF_FREEING, TASK_UNINTERRUPTIBLE);
209+
if (i_gl->gl_ops->go_unlocked) {
210+
set_bit(GLF_UNLOCKED, &i_gl->gl_flags);
211+
wait_on_bit(&i_gl->gl_flags, GLF_UNLOCKED, TASK_UNINTERRUPTIBLE);
212212
}
213213

214214
/*

0 commit comments

Comments
 (0)