From: James Simmons Date: Sun, 31 Mar 2013 13:29:12 +0000 (-0400) Subject: LU-1812 fsfilt: ext_pblock renamed to ext4_ext_pblock X-Git-Tag: 2.3.64~44 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6a95f4546b50d63b9cf7e97c931f694bc25a9704 LU-1812 fsfilt: ext_pblock renamed to ext4_ext_pblock For kernels 2.6.35 and above ext_pblock was renamed to ext4_ext_pblock. With no more RHEL5 kernel support for ldiskfs we also clean up more macros. see kernel commit bf89d16f6ef5389f1b9d8046e838ec87b9b3f8b9 for pblock change. Signed-off-by: James Simmons Signed-off-by: chas williams - CONTRACTOR Change-Id: I3ce7f27f6fd6826380e6f2f54b2d50d09d36f78a Reviewed-on: http://review.whamcloud.com/5001 Tested-by: Hudson Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/config/ldiskfs-build.m4 b/ldiskfs/config/ldiskfs-build.m4 index d87e9f8..fc2d772 100644 --- a/ldiskfs/config/ldiskfs-build.m4 +++ b/ldiskfs/config/ldiskfs-build.m4 @@ -726,6 +726,25 @@ AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD], ]) # +# 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex) +# +AC_DEFUN([LB_EXT_PBLOCK], +[AC_MSG_CHECKING([if kernel has ext_pblocks]) + LB_LINUX_TRY_COMPILE([ + #include + #include "$EXT_DIR/ext4_extents.h" +],[ + ext_pblock(NULL); +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_EXT_PBLOCK, 1, + [kernel has ext_pblocks]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# # LDISKFS_AC_PATCH_PROGRAM # # Determine which program should be used to apply the patches to diff --git a/ldiskfs/configure.ac b/ldiskfs/configure.ac index 0ef1c1d..8a3c805 100644 --- a/ldiskfs/configure.ac +++ b/ldiskfs/configure.ac @@ -75,6 +75,7 @@ if test x$enable_server$enable_dist = xyesno ; then LB_LDISKFS_EXT_DIR LB_LDISKFS_EXT_SOURCE LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD +LB_EXT_PBLOCK fi LB_CONFIG_HEADERS diff --git a/ldiskfs/ldiskfs/ldiskfs_config.h.in b/ldiskfs/ldiskfs/ldiskfs_config.h.in index c0fe952..e8d72bc 100644 --- a/ldiskfs/ldiskfs/ldiskfs_config.h.in +++ b/ldiskfs/ldiskfs/ldiskfs_config.h.in @@ -18,3 +18,6 @@ /* ext4_free_blocks do not require struct buffer_head */ #undef HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD + +/* kernel has ext_pblocks */ +#undef HAVE_EXT_PBLOCK diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index d2ff06d..d99e005 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -60,6 +60,10 @@ #include +#ifdef HAVE_EXT_PBLOCK /* Name changed to ext4_ext_pblock for kernel 2.6.35 */ +#define ext3_ext_pblock(ex) ext_pblock((ex)) +#endif + /* for kernels 2.6.18 and later */ #define FSFILT_SINGLEDATA_TRANS_BLOCKS(sb) EXT3_SINGLEDATA_TRANS_BLOCKS(sb) @@ -216,7 +220,7 @@ static long ext3_ext_find_goal(struct inode *inode, struct ext3_ext_path *path, /* try to predict block placement */ if ((ex = path[depth].p_ext)) - return ext_pblock(ex) + (block - le32_to_cpu(ex->ee_block)); + return ext4_ext_pblock(ex) + (block - le32_to_cpu(ex->ee_block)); /* it looks index is empty * try to find starting from index itself */ @@ -372,10 +376,10 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, ext3_mb_discard_inode_preallocations(inode); #endif #ifdef HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD /* Introduced in 2.6.32-rc7 */ - ext3_free_blocks(handle, inode, NULL, ext_pblock(&nex), + ext3_free_blocks(handle, inode, NULL, ext4_ext_pblock(&nex), cpu_to_le16(nex.ee_len), 0); #else - ext3_free_blocks(handle, inode, ext_pblock(&nex), + ext3_free_blocks(handle, inode, ext4_ext_pblock(&nex), cpu_to_le16(nex.ee_len), 0); #endif goto out; @@ -387,7 +391,7 @@ static int ext3_ext_new_extent_cb(struct ext3_ext_base *base, * scaning after that block */ cex->ec_len = le16_to_cpu(nex.ee_len); - cex->ec_start = ext_pblock(&nex); + cex->ec_start = ext4_ext_pblock(&nex); BUG_ON(le16_to_cpu(nex.ee_len) == 0); BUG_ON(le32_to_cpu(nex.ee_block) != cex->ec_block);