[RFC,2/5] ext4: add a delayed extents list in inode

Submitted by Yongqiang Yang on Aug. 30, 2011, 9 a.m.

Details

Message ID 1314694821-17213-3-git-send-email-xiaoqiangnk@gmail.com
State Superseded, archived
Headers show

Commit Message

Yongqiang Yang Aug. 30, 2011, 9 a.m.
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(-)

Patch hide | download patch | download mbox

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b4bff1a..6c5bfd6 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -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;
 
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c3e3a80..f0b6fe6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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;