Whamcloud - gitweb
LU-1812 fsfilt: ext4_free_blocks() has changed slightly
[fs/lustre-release.git] / ldiskfs / config / ldiskfs-build.m4
index 878fa99..d87e9f8 100644 (file)
@@ -495,7 +495,7 @@ AS_VAR_POPDEF([lb_File])dnl
 # add -include config.h
 #
 AC_DEFUN([LB_CONFIG_HEADERS],[
-       AC_CONFIG_HEADERS([config.h])
+       AC_CONFIG_HEADERS([config.h ldiskfs/ldiskfs_config.h])
        CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
        EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
        AC_SUBST(EXTRA_KCFLAGS)
@@ -608,59 +608,6 @@ and kernel-debuginfo-common-<arch> packages are installed.
 fi
 ])
 
-#
-# LB_LDISKFS_DEFINE_OPTIONS
-#
-# Enable config options related to ldiskfs.  These are used by ldiskfs,
-# lvfs, and the osd-ldiskfs code (which includes ldiskfs headers.)
-#
-AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS],
-[
-AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
-
-with_ldiskfs_pdo=no
-case $LINUXRELEASE in
-2.6.32*)
-       if test x$RHEL_KERNEL = xyes; then
-               with_ldiskfs_pdo=yes
-               AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch])
-       fi
-       if test x$SUSE_KERNEL = xyes; then
-               with_ldiskfs_pdo=yes
-               AC_DEFINE(HAVE_LDISKFS_PDO, 1, [have ldiskfs PDO patch])
-       fi
-       ;;
-esac
-LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET
-
-AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1,
-       [enable extended attributes for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1,
-       [enable posix acls for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1,
-       [enable fs security for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_POSIX_ACL, 1,
-       [enable posix acls for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_XATTR, 1,
-       [enable extented attributes for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1,
-       [enable fs security for ldiskfs])
-])
-
-#
-# Check for jbd2_journal_callback_set(), which is needed for commit
-# callbacks.  When LU-433 lands jbd2_journal_callback_set() will only
-# remain for legacy reasons and AC_MSG_ERROR can be removed.
-#
-AC_DEFUN([LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET],
-[
-       LB_CHECK_SYMBOL_EXPORT([jbd2_journal_callback_set],
-               [fs/jbd2/journal.c],
-               [AC_DEFINE(HAVE_JBD2_JOURNAL_CALLBACK_SET, 1,
-                       [kernel exports jbd2_journal_callback_set])])
-])
-
-
 AC_DEFUN([LB_LDISKFS_SYMVERS],
 [
 AC_MSG_CHECKING([ldiskfs module symbols])
@@ -734,11 +681,6 @@ AC_DEFUN([LB_LDISKFS_SERIES],
 if $1; then
        AC_MSG_CHECKING([which ldiskfs series to use])
        case $LINUXRELEASE in
-       2.6.18*)
-               if test x$RHEL_KERNEL = xyes; then
-                       LDISKFS_SERIES="2.6-rhel5-ext4.series"
-               fi
-               ;;
        2.6.32*)
                if test x$RHEL_KERNEL = xyes; then
                        LDISKFS_SERIES="2.6-rhel6.series"
@@ -747,6 +689,11 @@ if $1; then
                        LDISKFS_SERIES="2.6-sles11.series"
                fi
                ;;
+       3.0.*)
+               if test x$SUSE_KERNEL = xyes; then
+                       LDISKFS_SERIES="3.0-sles11.series"
+               fi
+               ;;
        *)
                AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])
                LDISKFS_SERIES=
@@ -759,6 +706,24 @@ fi
 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