aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorGravatar Jeff Layton <jlayton@primarydata.com> 2015-01-16 15:05:55 -0500
committerGravatar Jeff Layton <jeff.layton@primarydata.com> 2015-01-16 15:09:25 -0500
commitc362781cadd37858c3d8f5d18b1e9957d4671298 (patch)
treead072eccf039314a24ad9314e7e249722d44ddb8 /fs/ceph/mds_client.c
parentlocks: add a new struct file_locking_context pointer to struct inode (diff)
downloadlinux-c362781cadd37858c3d8f5d18b1e9957d4671298.tar.gz
linux-c362781cadd37858c3d8f5d18b1e9957d4671298.tar.bz2
linux-c362781cadd37858c3d8f5d18b1e9957d4671298.zip
ceph: move spinlocking into ceph_encode_locks_to_buffer and ceph_count_locks
There is only a single call site for each of these functions, and the caller takes the i_lock prior to calling them and drops it just afterward. Move the spinlocking into the functions instead. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Acked-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index d2171f4a6980..5f62fb7a5d0a 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2700,20 +2700,16 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
struct ceph_filelock *flocks;
encode_again:
- spin_lock(&inode->i_lock);
ceph_count_locks(inode, &num_fcntl_locks, &num_flock_locks);
- spin_unlock(&inode->i_lock);
flocks = kmalloc((num_fcntl_locks+num_flock_locks) *
sizeof(struct ceph_filelock), GFP_NOFS);
if (!flocks) {
err = -ENOMEM;
goto out_free;
}
- spin_lock(&inode->i_lock);
err = ceph_encode_locks_to_buffer(inode, flocks,
num_fcntl_locks,
num_flock_locks);
- spin_unlock(&inode->i_lock);
if (err) {
kfree(flocks);
if (err == -ENOSPC)