ext4_free_blocks() now takes a buffer_head and explicit flags instead
of just metadata. Test the presence of the buffer_head argument to
determine which ext4_free_blocks() is available.
see kernel commit
e6362609b6c71c5b802026be9cf263bbdd67a50e
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Change-Id: I925df73a054613469866ec025ae412ead0ce9e56
Reviewed-on: http://review.whamcloud.com/4991
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
AC_SUBST(LDISKFS_SERIES)
])
+#
+# 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
+#
+AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD],
+[AC_MSG_CHECKING([if ext4_free_blocks needs struct buffer_head])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include "$EXT_DIR/ext4.h"
+],[
+ ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
+ [ext4_free_blocks do not require struct buffer_head])
+],[
+ AC_MSG_RESULT([no])
+])
+])
#
# LDISKFS_AC_PATCH_PROGRAM
])
AC_MSG_RESULT([$enable_server])
-LB_CONFIG_HEADERS
-
LDISKFSDIR="$PWD/ldiskfs"
AC_SUBST(LDISKFSDIR)
if test x$enable_server$enable_dist = xyesno ; then
LB_LDISKFS_EXT_DIR
LB_LDISKFS_EXT_SOURCE
+LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
fi
+LB_CONFIG_HEADERS
+
AC_SUBST(ac_configure_args)
AC_CONFIG_FILES([Makefile ldiskfs/Makefile]
/* - enable extended attributes for ldiskfs */
#define CONFIG_LDISKFS_FS_XATTR 1
+
+/* ext4_free_blocks do not require struct buffer_head */
+#undef HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD
#ifdef EXT3_MB_HINT_GROUP_ALLOC
ext3_mb_discard_inode_preallocations(inode);
#endif
- ext3_free_blocks(handle, inode, ext_pblock(&nex),
- cpu_to_le16(nex.ee_len), 0);
+#ifdef HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD /* Introduced in 2.6.32-rc7 */
+ ext3_free_blocks(handle, inode, NULL, ext_pblock(&nex),
+ cpu_to_le16(nex.ee_len), 0);
+#else
+ ext3_free_blocks(handle, inode, ext_pblock(&nex),
+ cpu_to_le16(nex.ee_len), 0);
+#endif
goto out;
}