Skip to content

Commit 262ee3a

Browse files
author
Andreas Gruenbacher
committed
gfs2: Get rid of unnecessary test_and_set_bit
The GLF_LOCK flag is protected by the gl->gl_lockref.lock spin lock which is held when entering run_queue(), so we can use test_bit() and set_bit() here. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 927cfc9 commit 262ee3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/gfs2/glock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,9 @@ __acquires(&gl->gl_lockref.lock)
842842
{
843843
struct gfs2_holder *gh = NULL;
844844

845-
if (test_and_set_bit(GLF_LOCK, &gl->gl_flags))
845+
if (test_bit(GLF_LOCK, &gl->gl_flags))
846846
return;
847+
set_bit(GLF_LOCK, &gl->gl_flags);
847848

848849
GLOCK_BUG_ON(gl, test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags));
849850

0 commit comments

Comments
 (0)