Skip to contentSkip to conversation

ceph:Remove unneeded locking/unlocking of session mutex in the function drop_leases

PATCH RESEND Yan, Zheng 1 participant 1 message Jan 13, 2016 1 message not in the archive

lore
Share & tools
lore

Yan, Zheng

author
#1 lore raw
In reply to a message not in the archive
Quoted 19 lines · Nicholas Krause

This removes the unneeded lock/unlocking of the session mutex as part of the structure pointer s of type ceph_mds_session as this locking/unlocking of the session mutex does not protect any critical region and thus only wastes time in acquiring and unlocking this mutex in the function drop_leases.

---
fs/ceph/mds_client.c | 2 --

1 file changed, 2 deletions(-)
fs/ceph/mds_client.c +0 -0
index 51cb02d..f987054 100644

fs/ceph/mds_client.c static void drop_leases(struct ceph_mds_client *mdsc) · line 3327

Quoted 8 lines
fs/ceph/mds_client.c +0 -2
@@ -3322,8 +3322,6 @@ static void drop_leases(struct ceph_mds_client *mdsc)
 		if (!s)
 			continue;
 		mutex_unlock(&mdsc->mutex);
-		mutex_lock(&s->s_mutex);
-		mutex_unlock(&s->s_mutex);
 		ceph_put_mds_session(s);
 		mutex_lock(&mdsc->mutex);
 	}

the lock/unlock waits any code in critical region to exit

Quoted 3 lines
Signature · 1 line
2.1.4