Skip to contentSkip to conversation

NFSd: simplify locking in nfsd_recall_delegations()

PATCH In review Stanislav Kinsbursky 2 participants 2 messages Jul 3, 2012 – Jul 18, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

v2: rebased on 3.5-rc3 kernel

Holding of client_mutex looks redundant here - recall_lock looks enough.

---
 fs/nfsd/nfs4state.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +0 -2
index 33eccee..480ecc9 100644
@@ -4622,7 +4622,6 @@ void nfsd_recall_delegations(u64 num)
 	LIST_HEAD(victims);
 	struct nfs4_delegation *dp, *dnext;
 
-	nfs4_lock_state();
 	spin_lock(&recall_lock);
 	count = nfsd_process_n_delegations(num, &victims);
 	list_for_each_entry_safe(dp, dnext, &victims, dl_recall_lru) {
@@ -4630,7 +4629,6 @@ void nfsd_recall_delegations(u64 num)
 		nfsd_break_one_deleg(dp);
 	}
 	spin_unlock(&recall_lock);
-	nfs4_unlock_state();
 
 	printk(KERN_INFO "NFSD: Recalled %d delegations", count);
 }
#1 lore raw
Quoted 3 lines · Stanislav Kinsbursky

v2: rebased on 3.5-rc3 kernel

Holding of client_mutex looks redundant here - recall_lock looks enough.

Yep, thanks.--b.

Quoted 27 lines
---
 fs/nfsd/nfs4state.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +0 -2
index 33eccee..480ecc9 100644
@@ -4622,7 +4622,6 @@ void nfsd_recall_delegations(u64 num)
 	LIST_HEAD(victims);
 	struct nfs4_delegation *dp, *dnext;
 
-	nfs4_lock_state();
 	spin_lock(&recall_lock);
 	count = nfsd_process_n_delegations(num, &victims);
 	list_for_each_entry_safe(dp, dnext, &victims, dl_recall_lru) {
@@ -4630,7 +4629,6 @@ void nfsd_recall_delegations(u64 num)
 		nfsd_break_one_deleg(dp);
 	}
 	spin_unlock(&recall_lock);
-	nfs4_unlock_state();
 
 	printk(KERN_INFO "NFSD: Recalled %d delegations", count);
 }