summaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2015-01-16 21:05:57 +0100
committerJeff Layton <jeff.layton@primarydata.com>2015-01-16 22:08:49 +0100
commit6109c85037e53443f29fd39c0de69f578a1cf285 (patch)
tree56823d1615acbba20c858eed9d16cf443cd55872 /fs/nfs/delegation.c
parentlocks: remove i_flock field from struct inode (diff)
downloadlinux-6109c85037e53443f29fd39c0de69f578a1cf285.tar.xz
linux-6109c85037e53443f29fd39c0de69f578a1cf285.zip
locks: add a dedicated spinlock to protect i_flctx lists
We can now add a dedicated spinlock without expanding struct inode. Change to using that to protect the various i_flctx lists. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Acked-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 3fb1caa3874d..8cdb2b28a104 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -93,22 +93,22 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
goto out;
list = &flctx->flc_posix;
- spin_lock(&inode->i_lock);
+ spin_lock(&flctx->flc_lock);
restart:
list_for_each_entry(fl, list, fl_list) {
if (nfs_file_open_context(fl->fl_file) != ctx)
continue;
- spin_unlock(&inode->i_lock);
+ spin_unlock(&flctx->flc_lock);
status = nfs4_lock_delegation_recall(fl, state, stateid);
if (status < 0)
goto out;
- spin_lock(&inode->i_lock);
+ spin_lock(&flctx->flc_lock);
}
if (list == &flctx->flc_posix) {
list = &flctx->flc_flock;
goto restart;
}
- spin_unlock(&inode->i_lock);
+ spin_unlock(&flctx->flc_lock);
out:
return status;
}