@@ -759,6 +759,8 @@ struct ext4_ext_cache {
__u32 ec_len; /* must be 32bit to return holes */
};
+#include "delayed_extents.h"
+
/*
* fourth extended file system inode data in memory
*/
@@ -836,6 +838,9 @@ struct ext4_inode_info {
struct list_head i_prealloc_list;
spinlock_t i_prealloc_lock;
+ /* delayed_extents.c */
+ struct ext4_delayed_info i_delayed_info;
+
/* ialloc */
ext4_group_t i_last_alloc_group;
@@ -880,6 +880,8 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
ei->vfs_inode.i_version = 1;
ei->vfs_inode.i_data.writeback_index = 0;
memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
+ memset(&ei->i_delayed_info, 0, sizeof(struct ext4_delayed_info));
+ INIT_LIST_HEAD(&ei->i_delayed_info.de_list);
INIT_LIST_HEAD(&ei->i_prealloc_list);
spin_lock_init(&ei->i_prealloc_lock);
ei->i_reserved_data_blocks = 0;
This patch adds a delayed extents list in inode, so that delayed extents can be look up quickly. Without the tree delayed extents are identified by looking up page cache. With the list, FIEMAP, SEEK_HOLE/DATA, bigalloc and writeout path can be optimized a lot. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> --- fs/ext4/ext4.h | 5 +++++ fs/ext4/super.c | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-)