Commit cd718046 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher
Browse files

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: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarAndrew Price <anprice@redhat.com>
parent 13c00041
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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();
}

/**