diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2012-11-08 21:57:32 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-11-08 21:57:32 -0500 |
commit | 51865fda28e585bdcc164474ff6438a9ccdbfada (patch) | |
tree | c4450c21bdbce0750543d8b1cd59992fb342a650 /fs/ext4/extents.c | |
parent | 9a26b66175e1c221f39bbe09e2e1d0a31a14ba6d (diff) |
ext4: let ext4 maintain extent status tree
This patch lets ext4 maintain extent status tree.
Currently it only tracks delay extent status in extent status tree. When a
delay allocation is issued, the related delay extent will be inserted into
extent status tree. When a delay extent is written out or invalidated, it will
be removed from this tree.
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>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index dce97de6a409..67660fa2a7e6 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -4344,6 +4344,8 @@ void ext4_ext_truncate(struct inode *inode) | |||
4344 | 4344 | ||
4345 | last_block = (inode->i_size + sb->s_blocksize - 1) | 4345 | last_block = (inode->i_size + sb->s_blocksize - 1) |
4346 | >> EXT4_BLOCK_SIZE_BITS(sb); | 4346 | >> EXT4_BLOCK_SIZE_BITS(sb); |
4347 | err = ext4_es_remove_extent(inode, last_block, | ||
4348 | EXT_MAX_BLOCKS - last_block); | ||
4347 | err = ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1); | 4349 | err = ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1); |
4348 | 4350 | ||
4349 | /* In a multi-transaction truncate, we only make the final | 4351 | /* In a multi-transaction truncate, we only make the final |
@@ -4971,6 +4973,8 @@ int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length) | |||
4971 | ext4_ext_invalidate_cache(inode); | 4973 | ext4_ext_invalidate_cache(inode); |
4972 | ext4_discard_preallocations(inode); | 4974 | ext4_discard_preallocations(inode); |
4973 | 4975 | ||
4976 | err = ext4_es_remove_extent(inode, first_block, | ||
4977 | stop_block - first_block); | ||
4974 | err = ext4_ext_remove_space(inode, first_block, stop_block - 1); | 4978 | err = ext4_ext_remove_space(inode, first_block, stop_block - 1); |
4975 | 4979 | ||
4976 | ext4_ext_invalidate_cache(inode); | 4980 | ext4_ext_invalidate_cache(inode); |