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>
This commit is contained in:

committed by
Ilya Dryomov

parent
47474d0b01
commit
bb48bd4dc4
@@ -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;
|
||||
|
Reference in New Issue
Block a user