Skip to content

Commit d3b39fc

Browse files
author
Andreas Gruenbacher
committed
gfs2: gfs2_glock_hold cleanup
Use lockref_get_not_dead() instead of an unguarded __lockref_is_dead() check. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 536f48e commit d3b39fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/gfs2/glock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ static void gfs2_free_dead_glocks(struct gfs2_sbd *sdp)
185185

186186
struct gfs2_glock *gfs2_glock_hold(struct gfs2_glock *gl)
187187
{
188-
GLOCK_BUG_ON(gl, __lockref_is_dead(&gl->gl_lockref));
189-
lockref_get(&gl->gl_lockref);
188+
if (!lockref_get_not_dead(&gl->gl_lockref))
189+
GLOCK_BUG_ON(gl, 1);
190190
return gl;
191191
}
192192

0 commit comments

Comments
 (0)