Skip to content

Commit cd71804

Browse files
author
Andreas Gruenbacher
committed
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>
1 parent 13c0004 commit cd71804

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/gfs2/glock.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,10 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
646646
}
647647

648648
/* Fast path - we got what we asked for */
649-
if (test_and_clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags))
649+
if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) {
650+
clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
650651
gfs2_demote_wake(gl);
652+
}
651653
if (gl->gl_state != LM_ST_UNLOCKED) {
652654
if (glops->go_xmote_bh) {
653655
int rv;
@@ -891,14 +893,12 @@ __acquires(&gl->gl_lockref.lock)
891893

892894
out_sched:
893895
clear_bit(GLF_LOCK, &gl->gl_flags);
894-
smp_mb__after_atomic();
895896
gl->gl_lockref.count++;
896897
gfs2_glock_queue_work(gl, 0);
897898
return;
898899

899900
out_unlock:
900901
clear_bit(GLF_LOCK, &gl->gl_flags);
901-
smp_mb__after_atomic();
902902
}
903903

904904
/**

0 commit comments

Comments
 (0)