From f364042c3329559ccdbfddd8b35e8289179ee1bc Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Mon, 11 Jun 2012 09:48:25 -0700 Subject: [PATCH] LU-723 fsfilt: Remove EXT4_EXT_HAS_NO_TREE macro This change removes the EXT4_EXT_HAS_NO_TREE macro and any logic which is based on the definition of this macro. From now on, this macro is assumed to be defined. Signed-off-by: Prakash Surya Change-Id: I13af4c44d7cafef53fe45cf5e143053054d6ee50 Reviewed-on: http://review.whamcloud.com/3080 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- .../kernel_patches/patches/ext4-misc-rhel5.patch | 10 +----- .../kernel_patches/patches/ext4-misc-rhel6.patch | 10 +----- lustre/lvfs/fsfilt_ext3.c | 36 ---------------------- 3 files changed, 2 insertions(+), 54 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/ext4-misc-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-misc-rhel5.patch index b481aca..e77314e 100644 --- a/ldiskfs/kernel_patches/patches/ext4-misc-rhel5.patch +++ b/ldiskfs/kernel_patches/patches/ext4-misc-rhel5.patch @@ -141,15 +141,7 @@ Index: linux-stage/fs/ext4/ext4_extents.h /* * ext4_inode has i_block array (60 bytes total). -@@ -160,6 +166,7 @@ typedef int (*ext_prepare_callback)(stru - #define EXT_INIT_MAX_LEN (1UL << 15) - #define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1) - -+#define EXT4_EXT_HAS_NO_TREE /* ext4_extents_tree struct is not used*/ - - #define EXT_FIRST_EXTENT(__hdr__) \ - ((struct ext4_extent *) (((char *) (__hdr__)) + \ -@@ -231,6 +238,8 @@ extern ext4_fsblk_t ext_pblock(struct ex +@@ -231,6 +237,8 @@ extern ext4_fsblk_t ext_pblock(struct ex extern ext4_fsblk_t idx_pblock(struct ext4_extent_idx *); extern void ext4_ext_store_pblock(struct ext4_extent *, ext4_fsblk_t); extern int ext4_extent_tree_init(handle_t *, struct inode *); diff --git a/ldiskfs/kernel_patches/patches/ext4-misc-rhel6.patch b/ldiskfs/kernel_patches/patches/ext4-misc-rhel6.patch index 9ac2611..eac6168 100644 --- a/ldiskfs/kernel_patches/patches/ext4-misc-rhel6.patch +++ b/ldiskfs/kernel_patches/patches/ext4-misc-rhel6.patch @@ -39,15 +39,7 @@ Index: linux-stage/fs/ext4/ext4_extents.h /* * ext4_inode has i_block array (60 bytes total). -@@ -160,6 +166,7 @@ typedef int (*ext_prepare_callback)(stru - #define EXT_INIT_MAX_LEN (1UL << 15) - #define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1) - -+#define EXT4_EXT_HAS_NO_TREE /* ext4_extents_tree struct is not used*/ - - #define EXT_FIRST_EXTENT(__hdr__) \ - ((struct ext4_extent *) (((char *) (__hdr__)) + \ -@@ -239,6 +246,8 @@ extern int ext4_extent_tree_init(handle_ +@@ -239,6 +245,8 @@ extern int ext4_extent_tree_init(handle_ extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode, int num, struct ext4_ext_path *path); diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index ac96837..406e744 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -821,20 +821,12 @@ static int fsfilt_ext3_sync(struct super_block *sb) #define EXT_ASSERT(cond) BUG_ON(!(cond)) #endif -#ifdef EXT3_EXT_HAS_NO_TREE -/* for kernels 2.6.18 and later */ #define EXT_GENERATION(inode) (EXT4_I(inode)->i_ext_generation) #define ext3_ext_base inode #define ext3_ext_base2inode(inode) (inode) #define EXT_DEPTH(inode) ext_depth(inode) #define fsfilt_ext3_ext_walk_space(inode, block, num, cb, cbdata) \ ext3_ext_walk_space(inode, block, num, cb, cbdata); -#else -#define ext3_ext_base ext3_extents_tree -#define ext3_ext_base2inode(tree) (tree->inode) -#define fsfilt_ext3_ext_walk_space(tree, block, num, cb, cbdata) \ - ext3_ext_walk_space(tree, block, num, cb); -#endif struct bpointers { unsigned long *blocks; @@ -925,7 +917,6 @@ static unsigned long new_blocks(handle_t *handle, struct ext3_ext_base *base, } #endif -#ifdef EXT3_EXT_HAS_NO_TREE static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, struct ext3_ext_path *path, struct ext3_ext_cache *cex, @@ -935,17 +926,6 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, void *cbdata) { struct bpointers *bp = cbdata; -#else -static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, - struct ext3_ext_path *path, - struct ext3_ext_cache *cex -#ifdef HAVE_EXT_PREPARE_CB_EXTENT - , struct ext3_extent *ex -#endif - ) -{ - struct bpointers *bp = base->private; -#endif struct inode *inode = ext3_ext_base2inode(base); struct ext3_extent nex; unsigned long pblock; @@ -1083,22 +1063,13 @@ int fsfilt_map_nblocks(struct inode *inode, unsigned long block, unsigned long num, unsigned long *blocks, int *created, int create) { -#ifdef EXT3_EXT_HAS_NO_TREE struct ext3_ext_base *base = inode; -#else - struct ext3_extents_tree tree; - struct ext3_ext_base *base = &tree; -#endif struct bpointers bp; int err; CDEBUG(D_OTHER, "blocks %lu-%lu requested for inode %u\n", block, block + num - 1, (unsigned) inode->i_ino); -#ifndef EXT3_EXT_HAS_NO_TREE - ext3_init_tree_desc(base, inode); - tree.private = &bp; -#endif bp.blocks = blocks; bp.created = created; bp.start = block; @@ -2144,14 +2115,7 @@ static int fsfilt_ext3_dquot(struct lustre_dquot *dquot, int cmd) static int fsfilt_ext3_get_mblk(struct super_block *sb, int *count, struct inode *inode, int frags) { -#ifdef EXT3_EXT_HAS_NO_TREE struct ext3_ext_base *base = inode; -#else - struct ext3_extents_tree tree; - struct ext3_ext_base *base = &tree; - - ext3_init_tree_desc(base, inode); -#endif /* for an ost_write request, it needs <#fragments> * * metablocks at maxium b=16542 */ *count = frags * (EXT_DEPTH(base) + 1) * EXT3_BLOCK_SIZE(sb); -- 1.8.3.1