summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-02-07 16:53:46 -0500
committerJ. Bruce Fields <bfields@redhat.com>2011-02-14 10:35:19 -0500
commit5d926e8c2f46dc09f4ddde86644a5f1d0726a470 (patch)
treeef30c949c75ee204c3108159caf9eeb22daf8418 /fs/nfsd
parent65bc58f5187e2ff4011ef1bd3082e83cd1b036f1 (diff)
nfsd4: modify fi_delegations under recall_lock
Modify fi_delegations only under the recall_lock, allowing us to use that list on lease breaks. Also some trivial cleanup to simplify later changes. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d978192838a3..8b6cd3cf4835 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -277,9 +277,9 @@ nfs4_close_delegation(struct nfs4_delegation *dp)
static void
unhash_delegation(struct nfs4_delegation *dp)
{
- list_del_init(&dp->dl_perfile);
list_del_init(&dp->dl_perclnt);
spin_lock(&recall_lock);
+ list_del_init(&dp->dl_perfile);
list_del_init(&dp->dl_recall_lru);
spin_unlock(&recall_lock);
nfs4_close_delegation(dp);
@@ -2336,9 +2336,7 @@ static void nfsd_break_one_deleg(struct nfs4_delegation *dp)
* it's safe to take a reference: */
atomic_inc(&dp->dl_count);
- spin_lock(&recall_lock);
list_add_tail(&dp->dl_recall_lru, &del_recall_lru);
- spin_unlock(&recall_lock);
/* only place dl_time is set. protected by lock_flocks*/
dp->dl_time = get_seconds();
@@ -2363,8 +2361,10 @@ static void nfsd_break_deleg_cb(struct file_lock *fl)
*/
fl->fl_break_time = 0;
- nfsd_break_one_deleg(dp);
+ spin_lock(&recall_lock);
dp->dl_file->fi_had_conflict = true;
+ nfsd_break_one_deleg(dp);
+ spin_unlock(&recall_lock);
}
static