Skip to content

Commit d9b3a3c

Browse files
Andreas Gruenbacherbrauner
authored andcommitted
gfs2: use lockref_init for gl_lockref
Move the initialization of gl_lockref from gfs2_init_glock_once() to gfs2_glock_get(). This allows to use lockref_init() there. Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent e52e97f commit d9b3a3c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

fs/gfs2/glock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,8 +1201,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
12011201
if (glops->go_instantiate)
12021202
gl->gl_flags |= BIT(GLF_INSTANTIATE_NEEDED);
12031203
gl->gl_name = name;
1204+
lockref_init(&gl->gl_lockref, 1);
12041205
lockdep_set_subclass(&gl->gl_lockref.lock, glops->go_subclass);
1205-
gl->gl_lockref.count = 1;
12061206
gl->gl_state = LM_ST_UNLOCKED;
12071207
gl->gl_target = LM_ST_UNLOCKED;
12081208
gl->gl_demote_state = LM_ST_EXCLUSIVE;

fs/gfs2/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static void gfs2_init_glock_once(void *foo)
5151
{
5252
struct gfs2_glock *gl = foo;
5353

54-
spin_lock_init(&gl->gl_lockref.lock);
5554
INIT_LIST_HEAD(&gl->gl_holders);
5655
INIT_LIST_HEAD(&gl->gl_lru);
5756
INIT_LIST_HEAD(&gl->gl_ail_list);

0 commit comments

Comments
 (0)