summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2025-08-05 01:58:47 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2025-09-12 12:02:18 +0200
commitcd718046646593ced5ad98f9cde22aaf2a2eb8f2 (patch)
tree774b79ad9aad55b6ae5073f4d8ccf16be2c431ce
parent13c0004168633845fba328edf2cdec0de0292307 (diff)
gfs2: Do not use atomic operations unnecessarily
The GLF_DEMOTE_IN_PROGRESS and GLF_LOCK flags and the glock refcount are all protected by the glock spin lock, so there is no need for atomic operations / barriers here. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andrew Price <anprice@redhat.com>
-rw-r--r--fs/gfs2/glock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 5bdb11de5b13..1ced38b9a5a2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -646,8 +646,10 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
}
/* Fast path - we got what we asked for */
- if (test_and_clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags))
+ if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) {
+ clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
gfs2_demote_wake(gl);
+ }
if (gl->gl_state != LM_ST_UNLOCKED) {
if (glops->go_xmote_bh) {
int rv;
@@ -891,14 +893,12 @@ __acquires(&gl->gl_lockref.lock)
out_sched:
clear_bit(GLF_LOCK, &gl->gl_flags);
- smp_mb__after_atomic();
gl->gl_lockref.count++;
gfs2_glock_queue_work(gl, 0);
return;
out_unlock:
clear_bit(GLF_LOCK, &gl->gl_flags);
- smp_mb__after_atomic();
}
/**