aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-09-21 22:15:58 -0400
committerSage Weil <sage@inktank.com>2013-11-23 14:00:59 -0500
commita096b09aeec6ff99edfdfd8cee24d6f25377d585 (patch)
treed32a4a15cd391c2c84205c855e7d997070279cc6 /fs/ceph/mds_client.c
parent81c6aea5275eae453719d7f3924da07e668265c5 (diff)
ceph: queue cap release in __ceph_remove_cap()
call __queue_cap_release() in __ceph_remove_cap(), this avoids acquiring s_cap_lock twice. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index f51ab2627b41..8f8f5c043c37 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -986,7 +986,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
986 dout("removing cap %p, ci is %p, inode is %p\n", 986 dout("removing cap %p, ci is %p, inode is %p\n",
987 cap, ci, &ci->vfs_inode); 987 cap, ci, &ci->vfs_inode);
988 spin_lock(&ci->i_ceph_lock); 988 spin_lock(&ci->i_ceph_lock);
989 __ceph_remove_cap(cap); 989 __ceph_remove_cap(cap, false);
990 if (!__ceph_is_any_real_caps(ci)) { 990 if (!__ceph_is_any_real_caps(ci)) {
991 struct ceph_mds_client *mdsc = 991 struct ceph_mds_client *mdsc =
992 ceph_sb_to_client(inode->i_sb)->mdsc; 992 ceph_sb_to_client(inode->i_sb)->mdsc;
@@ -1231,9 +1231,7 @@ static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg)
1231 session->s_trim_caps--; 1231 session->s_trim_caps--;
1232 if (oissued) { 1232 if (oissued) {
1233 /* we aren't the only cap.. just remove us */ 1233 /* we aren't the only cap.. just remove us */
1234 __queue_cap_release(session, ceph_ino(inode), cap->cap_id, 1234 __ceph_remove_cap(cap, true);
1235 cap->mseq, cap->issue_seq);
1236 __ceph_remove_cap(cap);
1237 } else { 1235 } else {
1238 /* try to drop referring dentries */ 1236 /* try to drop referring dentries */
1239 spin_unlock(&ci->i_ceph_lock); 1237 spin_unlock(&ci->i_ceph_lock);