Whamcloud - gitweb
LU-1648 llog: prevent journal to restart for llog cancel
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 1168898..9603e50 100644 (file)
@@ -1848,6 +1848,26 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
+# 3.1.1 has ext4_blocks_for_truncate
+#
+AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
+[AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
+LB_LINUX_TRY_COMPILE([
+       #include <linux/fs.h>
+       #include "$LINUX/fs/ext4/ext4_jbd2.h"
+       #include "$LINUX/fs/ext4/truncate.h"
+],[
+       ext4_blocks_for_truncate(NULL);
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
+                 [kernel has ext4_blocks_for_truncate])
+],[
+       AC_MSG_RESULT([no])
+])
+])
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -1994,6 +2014,9 @@ AC_DEFUN([LC_PROG_LINUX],
        LC_HAVE_MIGRATE_HEADER
        LC_MIGRATEPAGE_4ARGS
 
+        # 3.1.1
+        LC_BLOCKS_FOR_TRUNCATE
+
          #
          if test x$enable_server = xyes ; then
              AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])