aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents_status.c
diff options
context:
space:
mode:
authorZheng Liu <wenqing.lz@taobao.com>2013-08-28 14:47:06 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-08-28 14:47:06 -0400
commitd7b2a00c2e2eedf460ce2a15237f28de40412d86 (patch)
tree5a6b062e0973a84cab9b66f75a7a573361ccdf69 /fs/ext4/extents_status.c
parent70261f568f3c08552f034742e3d5cb78c3877766 (diff)
ext4: isolate ext4_extents.h file
After applied the commit (4a092d73), we have reduced the number of source files that need to #include ext4_extents.h. But we can do better. This commit defines ext4_zeroout_es() in extents.c and move EXT_MAX_BLOCKS into ext4.h in order not to include ext4_extents.h in indirect.c and ioctl.c. Meanwhile we just need to include this file in extent_status.c when ES_AGGRESSIVE_TEST is defined. Otherwise, this commit removes a duplicated declaration in trace/events/ext4.h. After applied this patch, we just need to include ext4_extents.h file in {super,migrate,move_extents,extents}.c, and it is easy for us to define a new extent disk layout. Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents_status.c')
-rw-r--r--fs/ext4/extents_status.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 0e88a367b535..2d1bdbe78c04 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -13,7 +13,6 @@
13#include <linux/list_sort.h> 13#include <linux/list_sort.h>
14#include "ext4.h" 14#include "ext4.h"
15#include "extents_status.h" 15#include "extents_status.h"
16#include "ext4_extents.h"
17 16
18#include <trace/events/ext4.h> 17#include <trace/events/ext4.h>
19 18
@@ -409,6 +408,8 @@ ext4_es_try_to_merge_right(struct inode *inode, struct extent_status *es)
409} 408}
410 409
411#ifdef ES_AGGRESSIVE_TEST 410#ifdef ES_AGGRESSIVE_TEST
411#include "ext4_extents.h" /* Needed when ES_AGGRESSIVE_TEST is defined */
412
412static void ext4_es_insert_extent_ext_check(struct inode *inode, 413static void ext4_es_insert_extent_ext_check(struct inode *inode,
413 struct extent_status *es) 414 struct extent_status *es)
414{ 415{
@@ -903,23 +904,6 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk,
903 return err; 904 return err;
904} 905}
905 906
906int ext4_es_zeroout(struct inode *inode, struct ext4_extent *ex)
907{
908 ext4_lblk_t ee_block;
909 ext4_fsblk_t ee_pblock;
910 unsigned int ee_len;
911
912 ee_block = le32_to_cpu(ex->ee_block);
913 ee_len = ext4_ext_get_actual_len(ex);
914 ee_pblock = ext4_ext_pblock(ex);
915
916 if (ee_len == 0)
917 return 0;
918
919 return ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
920 EXTENT_STATUS_WRITTEN);
921}
922
923static int ext4_inode_touch_time_cmp(void *priv, struct list_head *a, 907static int ext4_inode_touch_time_cmp(void *priv, struct list_head *a,
924 struct list_head *b) 908 struct list_head *b)
925{ 909{