Skip to content

Commit 08d7366

Browse files
committed
gfs2: Remove redundant check from gfs2_glock_dq
In function gfs2_glock_dq, it checks to see if this is the fast path. Before this patch, it checked both "find_first_holder(gl) == NULL" and list_empty(&gl->gl_holders), which is redundant. If gl_holders is empty then find_first_holder must return NULL. This patch removes the redundancy. Signed-off-by: Bob Peterson <[email protected]>
1 parent fffe9be commit 08d7366

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

fs/gfs2/glock.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,12 +1494,11 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
14941494

14951495
list_del_init(&gh->gh_list);
14961496
clear_bit(HIF_HOLDER, &gh->gh_iflags);
1497-
if (find_first_holder(gl) == NULL) {
1498-
if (list_empty(&gl->gl_holders) &&
1499-
!test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
1500-
!test_bit(GLF_DEMOTE, &gl->gl_flags))
1501-
fast_path = 1;
1502-
}
1497+
if (list_empty(&gl->gl_holders) &&
1498+
!test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
1499+
!test_bit(GLF_DEMOTE, &gl->gl_flags))
1500+
fast_path = 1;
1501+
15031502
if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl))
15041503
gfs2_glock_add_to_lru(gl);
15051504

0 commit comments

Comments
 (0)