summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-03-13 03:42:44 +0100
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 10:12:49 +0200
commitbb48bd4dc45f9ee1e44d8e9fcb01023e0d0ba80d (patch)
treeb844653552011036270e965137f7af0ea4345291 /fs/ceph/super.h
parentceph: optimize mds session register (diff)
downloadlinux-bb48bd4dc45f9ee1e44d8e9fcb01023e0d0ba80d.tar.xz
linux-bb48bd4dc45f9ee1e44d8e9fcb01023e0d0ba80d.zip
ceph: optimize memory usage
In current code, regular file and directory use same struct ceph_file_info to store fs specific data so the struct has to include some fields which are only used for directory (e.g., readdir related info), when having plenty of regular files, it will lead to memory waste. This patch introduces dedicated ceph_dir_file_info cache for readdir related thins. So that regular file does not include those unused fields anymore. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 1c2086e0fec2..ff49433014e9 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -671,6 +671,10 @@ struct ceph_file_info {
spinlock_t rw_contexts_lock;
struct list_head rw_contexts;
+};
+
+struct ceph_dir_file_info {
+ struct ceph_file_info file_info;
/* readdir: position within the dir */
u32 frag;