Skip to contentSkip to conversation

NFSd: simplify locking in nfsd_recall_delegations()

PATCH Superseded Stanislav Kinsbursky 2 participants 2 messages May 22, 2012 – May 24, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSd: simplify locking in nfsd_recall_delegations()

Holding of client_mutex looks redundant here - holding of recall_lock looks enough.

---
 fs/nfsd/nfs4state.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +0 -2
index f004e61..fdef9fc 100644
@@ -4744,11 +4744,9 @@ void nfsd_recall_delegations(u64 num)
 {
 	unsigned int count;
 
-	nfs4_lock_state();
 	spin_lock(&recall_lock);
 	count = nfsd_process_n_delegations(num, nfsd_break_one_deleg, NULL);
 	spin_unlock(&recall_lock);
-	nfs4_unlock_state();
 
 	printk(KERN_INFO "NFSD: Recalled %d delegations", count);
 }
#1 lore raw
Quoted 2 lines · Stanislav Kinsbursky

Holding of client_mutex looks redundant here - holding of recall_lock looks enough.

Looking at the code, agreed.

Benny

Quoted 27 lines
---
 fs/nfsd/nfs4state.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +0 -3
index f004e61..fdef9fc 100644
@@ -4744,11 +4744,9 @@ void nfsd_recall_delegations(u64 num)
 {
 	unsigned int count;
 
-	nfs4_lock_state();
 	spin_lock(&recall_lock);
 	count = nfsd_process_n_delegations(num, nfsd_break_one_deleg, NULL);
 	spin_unlock(&recall_lock);
-	nfs4_unlock_state();
 
 	printk(KERN_INFO "NFSD: Recalled %d delegations", count);
 }
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html