diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-06-10 05:26:13 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-06-25 04:49:31 -0400 |
commit | f66fd9f0952187d274c13c136b74548f792c1925 (patch) | |
tree | c021f04f69b116f2673fdfb2354a99871f8f03a4 /fs/ceph/mds_client.c | |
parent | e548e9b93d3e565e42b938a99804114565be1f81 (diff) |
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.c | 6 |
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, | |||
1189 | } | 1189 | } |
1190 | spin_unlock(&mdsc->cap_dirty_lock); | 1190 | spin_unlock(&mdsc->cap_dirty_lock); |
1191 | 1191 | ||
1192 | if (!ci->i_dirty_caps && ci->i_prealloc_cap_flush) { | ||
1193 | list_add(&ci->i_prealloc_cap_flush->list, &to_remove); | ||
1194 | ci->i_prealloc_cap_flush = NULL; | ||
1195 | } | ||
1192 | } | 1196 | } |
1193 | spin_unlock(&ci->i_ceph_lock); | 1197 | spin_unlock(&ci->i_ceph_lock); |
1194 | while (!list_empty(&to_remove)) { | 1198 | while (!list_empty(&to_remove)) { |
@@ -1196,7 +1200,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
1196 | cf = list_first_entry(&to_remove, | 1200 | cf = list_first_entry(&to_remove, |
1197 | struct ceph_cap_flush, list); | 1201 | struct ceph_cap_flush, list); |
1198 | list_del(&cf->list); | 1202 | list_del(&cf->list); |
1199 | kfree(cf); | 1203 | ceph_free_cap_flush(cf); |
1200 | } | 1204 | } |
1201 | while (drop--) | 1205 | while (drop--) |
1202 | iput(inode); | 1206 | iput(inode); |