aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton2015-01-16 15:05:57 -0500
committerJeff Layton2015-01-16 16:08:49 -0500
commit6109c85037e53443f29fd39c0de69f578a1cf285 (patch)
tree56823d1615acbba20c858eed9d16cf443cd55872 /fs/ceph
parenta7231a97467d5a0c36f82f581c76c12c034e4b80 (diff)
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/ceph')
-rw-r--r--fs/ceph/locks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index 19beeed83233..0303da8e3233 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -255,12 +255,12 @@ void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
ctx = inode->i_flctx;
if (ctx) {
- spin_lock(&inode->i_lock);
+ spin_lock(&ctx->flc_lock);
list_for_each_entry(lock, &ctx->flc_posix, fl_list)
++(*fcntl_count);
list_for_each_entry(lock, &ctx->flc_flock, fl_list)
++(*flock_count);
- spin_unlock(&inode->i_lock);
+ spin_unlock(&ctx->flc_lock);
}
dout("counted %d flock locks and %d fcntl locks",
*flock_count, *fcntl_count);
@@ -288,7 +288,7 @@ int ceph_encode_locks_to_buffer(struct inode *inode,
if (!ctx)
return 0;
- spin_lock(&inode->i_lock);
+ spin_lock(&ctx->flc_lock);
list_for_each_entry(lock, &ctx->flc_flock, fl_list) {
++seen_fcntl;
if (seen_fcntl > num_fcntl_locks) {
@@ -312,7 +312,7 @@ int ceph_encode_locks_to_buffer(struct inode *inode,
++l;
}
fail:
- spin_unlock(&inode->i_lock);
+ spin_unlock(&ctx->flc_lock);
return err;
}