summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2024-03-29 15:46:32 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2024-04-09 18:35:58 +0200
commit262ee3a07e98e8e56230547d4fe75d485348a55a (patch)
treef3aa758a7d7be67229646fba8a55ae6f7c755fe1 /fs
parent927cfc90d27cb7732a62464f95fd9aa7edfa9b70 (diff)
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 <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index a700e424f790..fa047331ea3c 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -842,8 +842,9 @@ __acquires(&gl->gl_lockref.lock)
{
struct gfs2_holder *gh = NULL;
- if (test_and_set_bit(GLF_LOCK, &gl->gl_flags))
+ if (test_bit(GLF_LOCK, &gl->gl_flags))
return;
+ set_bit(GLF_LOCK, &gl->gl_flags);
GLOCK_BUG_ON(gl, test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags));