Patchwork [3/8,v3] ext4: initialize extent status tree

login
register
mail settings
Submitter Zheng Liu
Date Oct. 26, 2012, 1:23 p.m.
Message ID <1351257825-3701-4-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/194471/
State Accepted, archived
Headers show

Comments

Zheng Liu - Oct. 26, 2012, 1:23 p.m.
From: Zheng Liu <wenqing.lz@taobao.com>

Let ext4 initialize extent status tree of an inode.

CC: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
v3 <- v2:
 - initialize i_es_lock

 fs/ext4/super.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 80928f7..e0c824b 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -943,6 +943,8 @@  static struct inode *ext4_alloc_inode(struct super_block *sb)
 	memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
 	INIT_LIST_HEAD(&ei->i_prealloc_list);
 	spin_lock_init(&ei->i_prealloc_lock);
+	ext4_es_init_tree(&ei->i_es_tree);
+	rwlock_init(&ei->i_es_lock);
 	ei->i_reserved_data_blocks = 0;
 	ei->i_reserved_meta_blocks = 0;
 	ei->i_allocated_meta_blocks = 0;