summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng2015-06-10 11:26:13 +0200
committerIlya Dryomov2015-06-25 10:49:31 +0200
commitf66fd9f0952187d274c13c136b74548f792c1925 (patch)
treec021f04f69b116f2673fdfb2354a99871f8f03a4 /fs/ceph/mds_client.c
parentceph: re-send flushing caps (which are revoked) in reconnect stage (diff)
downloadkernel-qcow2-linux-f66fd9f0952187d274c13c136b74548f792c1925.tar.gz
kernel-qcow2-linux-f66fd9f0952187d274c13c136b74548f792c1925.tar.xz
kernel-qcow2-linux-f66fd9f0952187d274c13c136b74548f792c1925.zip
ceph: pre-allocate data structure that tracks caps flushing
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 89e4305a94d4..8d73fe9d488b 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1189,6 +1189,10 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
}
spin_unlock(&mdsc->cap_dirty_lock);
+ if (!ci->i_dirty_caps && ci->i_prealloc_cap_flush) {
+ list_add(&ci->i_prealloc_cap_flush->list, &to_remove);
+ ci->i_prealloc_cap_flush = NULL;
+ }
}
spin_unlock(&ci->i_ceph_lock);
while (!list_empty(&to_remove)) {
@@ -1196,7 +1200,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
cf = list_first_entry(&to_remove,
struct ceph_cap_flush, list);
list_del(&cf->list);
- kfree(cf);
+ ceph_free_cap_flush(cf);
}
while (drop--)
iput(inode);