Whamcloud - gitweb
LU-1199 build: Remove obsolete ext3 check
[fs/lustre-release.git] / build / autoconf / lustre-build-ldiskfs.m4
index c02f15a..db24ac5 100644 (file)
@@ -103,7 +103,6 @@ if test x$with_ldiskfs = xyes; then
 
        LB_LDISKFS_SYMVERS
        LB_LDISKFS_RELEASE
-       LB_LDISKFS_EXT_RELEASE
        LB_LDISKFS_EXT_DIR
        LB_LDISKFS_BUILD
        LB_LDISKFS_DEFINE_OPTIONS
@@ -111,7 +110,7 @@ fi
 
 #
 # LDISKFS_DEVEL is required because when using the ldiskfs-devel package the
-# ext3/4 source will be fully patched to ldiskfs.  When building with the
+# ext4 source will be fully patched to ldiskfs.  When building with the
 # in-tree ldiskfs this patching this will occur after the configure step.
 # We needed a way to determine if we should check the patched or unpatched
 # source files.
@@ -137,64 +136,29 @@ fi
 ])
 
 #
-# LB_LDISKFS_EXT_RELEASE
-#
-# Determine if ext3 or ext4 sources should be used for ldiskfs.
-#
-AC_DEFUN([LB_LDISKFS_EXT_RELEASE],
-[
-AC_ARG_ENABLE([ext4],
-        AC_HELP_STRING([--enable-ext4], [enable ldiskfs build using ext4]),
-       [],
-       [
-               if test x$RHEL_KERNEL = xyes; then
-                       enable_ext4='yes'
-               else
-                       # 2.6.22-2.6.26 ext4 available but unstable
-                       case x$LINUXRELEASE in
-                       x2.6.2[[0-6]]*)
-                               enable_ext4='no' ;;
-                       *)
-                               enable_ext4='yes' ;;
-                       esac
-               fi
-       ])
-
-if test x$enable_ext4 = xyes; then
-       LDISKFS_BACKFS='ext4'
-else
-       LDISKFS_BACKFS='ext3'
-fi
-
-AC_MSG_CHECKING([whether to use ext3 or ext4 source])
-AC_MSG_RESULT([$LDISKFS_BACKFS])
-AC_SUBST(LDISKFS_BACKFS)
-])
-
-#
 # LB_LDISKFS_EXT_DIR
 #
-# Determine the location of the ext3/ext4 source code.  It it required
+# Determine the location of the ext4 source code.  It it required
 # for several configure tests and to build ldiskfs.
 #
 AC_DEFUN([LB_LDISKFS_EXT_DIR],
 [
 # Kernel ext source located with devel headers
 linux_src=$LINUX
-if test -e "$linux_src/fs/$LDISKFS_BACKFS/super.c"; then
-       EXT_DIR=$linux_src/fs/$LDISKFS_BACKFS
+if test -e "$linux_src/fs/ext4/super.c"; then
+       EXT_DIR=$linux_src/fs/ext4
 else
        # Kernel ext source provided by kernel-debuginfo-common package
        linux_src=$(ls -1d /usr/src/debug/*/linux-$LINUXRELEASE \
                2>/dev/null | tail -1)
-       if test -e "$linux_src/fs/$LDISKFS_BACKFS/super.c"; then
-               EXT_DIR=$linux_src/fs/$LDISKFS_BACKFS
+       if test -e "$linux_src/fs/ext4/super.c"; then
+               EXT_DIR=$linux_src/fs/ext4
        else
                EXT_DIR=
        fi
 fi
 
-AC_MSG_CHECKING([$LDISKFS_BACKFS source directory])
+AC_MSG_CHECKING([ext4 source directory])
 AC_MSG_RESULT([$EXT_DIR])
 AC_SUBST(EXT_DIR)
 ])
@@ -202,28 +166,46 @@ AC_SUBST(EXT_DIR)
 #
 # LB_LDISKFS_EXT_SOURCE
 #
-# Spot check the existance of several source files common to ext3/ext4.
+# Spot check the existance of several source files common to ext4.
 # Detecting this at configure time allows us to avoid a potential build
 # failure and provide a useful error message to explain what is wrong.
 #
 AC_DEFUN([LB_LDISKFS_EXT_SOURCE],
 [
 if test x$EXT_DIR = x; then
-       AC_MSG_ERROR([Complete $LDISKFS_BACKFS source must exist.
-
-If you are building using kernel-devel packages then ensure that the
-matching kernel-debuginfo-common and kernel-debuginfo-common-<arch>
-packages are installed.])
+       enable_ldiskfs_build='no'
+else
+       LB_CHECK_FILE([$EXT_DIR/dir.c], [], [
+               enable_ldiskfs_build='no'
+               AC_MSG_WARN([ext4 must exist for ldiskfs build])])
+       LB_CHECK_FILE([$EXT_DIR/file.c], [], [
+               enable_ldiskfs_build='no'
+               AC_MSG_WARN([ext4 must exist for ldiskfs build])])
+       LB_CHECK_FILE([$EXT_DIR/inode.c], [], [
+               enable_ldiskfs_build='no'
+               AC_MSG_WARN([ext4 must exist for ldiskfs build])])
+       LB_CHECK_FILE([$EXT_DIR/super.c], [], [
+               enable_ldiskfs_build='no'
+               AC_MSG_WARN([ext4 must exist for ldiskfs build])])
 fi
 
-LB_CHECK_FILE([$EXT_DIR/dir.c], [], [ AC_MSG_ERROR(
-       [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])])
-LB_CHECK_FILE([$EXT_DIR/file.c], [], [ AC_MSG_ERROR(
-       [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])])
-LB_CHECK_FILE([$EXT_DIR/inode.c], [], [ AC_MSG_ERROR(
-       [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])])
-LB_CHECK_FILE([$EXT_DIR/super.c], [], [ AC_MSG_ERROR(
-       [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])])
+if test x$enable_ldiskfs_build = xno; then
+       enable_server='no'
+       enable_ldiskfs_build='no'
+       with_ldiskfs='no'
+       LDISKFS_SUBDIR=
+
+       AC_MSG_WARN([
+
+Disabling server because complete ext4 source does not exist.
+
+If you are building using kernel-devel packages and require ldiskfs
+server support then ensure that the matching kernel-debuginfo-common
+and kernel-debuginfo-common-<arch> packages are installed.
+
+])
+
+fi
 ])
 
 #
@@ -237,22 +219,18 @@ AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS],
 AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
 
 with_ldiskfs_pdo=no
-if test $LDISKFS_BACKFS = 'ext4'; then
-       AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [build ext4 based ldiskfs])
-       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
-fi
-
+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,
@@ -274,21 +252,12 @@ AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1,
 # callbacks.  When LU-433 lands jbd2_journal_callback_set() will only
 # remain for legacy reasons and AC_MSG_ERROR can be removed.
 #
-# 2.6.18 with ext3 still uses journal_callback_set() for commit callbacks.
-#
 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])],
-       [LB_CHECK_SYMBOL_EXPORT([journal_callback_set],
-               [fs/jbd/journal.c],
-               [AC_DEFINE(HAVE_JOURNAL_CALLBACK_SET, 1,
-                       [kernel exports journal_callback_set])],
-               [if test x$with_ldiskfs != xno ; then
-                       AC_MSG_ERROR([ldiskfs needs jbd2-jcberr patch])
-               fi])])
+               [fs/jbd2/journal.c],
+               [AC_DEFINE(HAVE_JBD2_JOURNAL_CALLBACK_SET, 1,
+                       [kernel exports jbd2_journal_callback_set])])
 ])
 
 #
@@ -315,12 +284,12 @@ AC_ARG_ENABLE([ldiskfs-build],
 AC_MSG_CHECKING([whether to build ldiskfs])
 if test x$enable_ldiskfs_build = xyes; then
        AC_MSG_RESULT([$enable_ldiskfs_build])
+       LDISKFS_SUBDIR="ldiskfs"
 
        LB_CHECK_FILE([$LDISKFS_DIR/configure], [], [
                AC_MSG_ERROR([Complete ldiskfs build system must exist])])
        LB_LDISKFS_EXT_SOURCE
 
-       LDISKFS_SUBDIR="ldiskfs"
        AC_SUBST(LDISKFS_SUBDIR)
 else
        enable_ldiskfs_build='no'