SUBDIRS := @LDISKFS_SUBDIR@ @SPL_SUBDIR@ @ZFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
-DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs lustre-iokit @LIBCFS_SUBDIR@ lnet lustre
+DIST_SUBDIRS := @LDISKFS_DIST_SUBDIR@ @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre
SOURCES_SUBDIRS := @LDISKFS_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
RPM_SUBDIRS := @LDISKFS_SUBDIR@ @LUSTREIOKIT_SUBDIR@
-if LDISKFS_ENABLED
-if !LDISKFS_IN_KERNEL
-SYMVERFILE_DEPENDECY := @SYMVERFILE@
-endif
-endif
+MODULE_SYMVERS_DEPS = module-symvers
@TESTS_TRUE@BUILD_TESTS = true
@TESTS_FALSE@BUILD_TESTS = false
EXTRA_DIST += debian/*
endif
+module-symvers-ldiskfs:
if LDISKFS_ENABLED
-if !LDISKFS_IN_KERNEL
-
-EXTRA_DIST += @SYMVERFILE@
+ @if [ -f @LDISKFS_DIR@/@SYMVERFILE@ ]; then \
+ cat @LDISKFS_DIR@/@SYMVERFILE@ >>@SYMVERFILE@; \
+ elif [ -f @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ ]; then \
+ cat @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ >>@SYMVERFILE@; \
+ else \
+ echo -e "\n" \
+ "*** Missing ldiskfs symbols. Ensure you have built ldiskfs:\n"\
+ "*** - @LDISKFS_OBJ@/ldiskfs/@SYMVERFILE@\n"; \
+ exit 1; \
+ fi
+endif # LDISKFS_ENABLED
-@SYMVERFILE@: @LDISKFS_DIR@/@SYMVERFILE@
- touch @SYMVERFILE@
- -grep -v ldiskfs @SYMVERFILE@ > @SYMVERFILE@.old
- cat @SYMVERFILE@.old @LDISKFS_DIR@/@SYMVERFILE@ > @SYMVERFILE@
-endif
-endif
+module-symvers: module-symvers-ldiskfs
CSTK=/tmp/checkstack
CSTKO=/tmp/checkstack.orig
if MODULES
sources: all-sources
-all-sources: $(SYMVERFILE_DEPENDECY)
+all-sources: $(MODULE_SYMVERS_DEPS)
for dir in $(SOURCES_SUBDIRS) ; do \
$(MAKE) sources -C $$dir || exit $$? ; \
done
-EXTRA_DIST := lustre-build.m4 lustre-build-linux.m4 lustre-build-darwin.m4
+EXTRA_DIST = lustre-build.m4 lustre-build-linux.m4 lustre-build-darwin.m4
+EXTRA_DIST += lustre-build-ldiskfs.m4
--- /dev/null
+#
+# LB_PATH_LDISKFS
+#
+# --without-ldiskfs - Disable ldiskfs support.
+# --with-ldiskfs=no
+#
+# --with-ldiskfs - Enable ldiskfs support and attempt to autodetect the
+# --with-ldiskfs=yes headers in one of the following places in this order:
+# * ./ldiskfs
+# * /usr/src/ldiskfs-*/$LINUXRELEASE
+# * ../ldiskfs
+#
+# --with-ldiskfs=path - Enable ldiskfs support and use the headers in the
+# provided path. No autodetection is performed.
+#
+# --with-ldiskfs-obj - When ldiskfs support is enabled the object directory
+# will be based on the --with-ldiskfs directory. If
+# this is detected incorrectly it can be explicitly
+# specified using this option.
+#
+# NOTE: As with all external packages ldiskfs is expected to already be
+# configured and built. However, if the ldiskfs tree is located in-tree
+# (./ldiskfs) then it will be configured and built recursively as part of
+# the lustre build system.
+#
+# NOTE: The lustre and in-tree ldiskfs build systems both make use these
+# macros. This is undesirable and confusing at best, it is potentially
+# danagerous at worst. The ldiskfs build system should be entirely stand
+# alone without dependency on the lustre build system.
+#
+AC_DEFUN([LB_PATH_LDISKFS],
+[
+AC_ARG_WITH([ldiskfs],
+ AC_HELP_STRING([--with-ldiskfs=path], [set path to ldiskfs source]),
+ [],[
+ if test x$enable_server = xyes && test x$enable_dist = xno; then
+ with_ldiskfs='yes'
+ else
+ with_ldiskfs='no'
+ fi
+ ])
+
+case x$with_ldiskfs in
+ xno)
+ LDISKFS_DIR=
+ ;;
+ xyes)
+ LDISKFS_DIR=
+
+ # Check ./ldiskfs
+ ldiskfs_src=$PWD/ldiskfs
+ if test -e "$ldiskfs_src"; then
+ LDISKFS_DIR=$(readlink -f $ldiskfs_src)
+ else
+ # Check /usr/src/ldiskfs-*/$LINUXRELEASE
+ ldiskfs_src=$(ls -1d \
+ /usr/src/ldiskfs-*/$LINUXRELEASE \
+ 2>/dev/null | tail -1)
+ if test -e "$ldiskfs_src"; then
+ LDISKFS_DIR=$(readlink -f $ldiskfs_src)
+ else
+ # Check ../ldiskfs
+ ldiskfs_src=$PWD/../ldiskfs
+ if test -e "$ldiskfs_src"; then
+ LDISKFS_DIR=$(readlink -f $ldiskfs_src)
+ else
+ # Disable ldiskfs failed to detect
+ with_ldiskfs='no'
+ fi
+ fi
+ fi
+
+ ;;
+ *)
+ LDISKFS_DIR=$(readlink -f $with_ldiskfs)
+ with_ldiskfs='yes'
+ ;;
+esac
+
+AC_MSG_CHECKING([whether to enable ldiskfs])
+AC_MSG_RESULT([$with_ldiskfs])
+
+AC_ARG_WITH([ldiskfs-obj],
+ AC_HELP_STRING([--with-ldiskfs-obj=path],[set path to ldiskfs objects]),
+ [
+ if test x$with_ldiskfs = xyes; then
+ LDISKFS_OBJ="$withval"
+ fi
+ ],[
+ if test x$with_ldiskfs = xyes; then
+ LDISKFS_OBJ=$LDISKFS_DIR
+ fi
+ ])
+
+if test x$with_ldiskfs = xyes; then
+ AC_MSG_CHECKING([ldiskfs source directory])
+ AC_MSG_RESULT([$LDISKFS_DIR])
+ AC_SUBST(LDISKFS_DIR)
+
+ AC_MSG_CHECKING([ldiskfs object directory])
+ AC_MSG_RESULT([$LDISKFS_OBJ])
+ AC_SUBST(LDISKFS_OBJ)
+
+ LB_LDISKFS_SYMVERS
+ LB_LDISKFS_RELEASE
+ LB_LDISKFS_EXT_RELEASE
+ LB_LDISKFS_EXT_DIR
+ LB_LDISKFS_BUILD
+ LB_LDISKFS_DEFINE_OPTIONS
+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
+# 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.
+#
+# Longer term this could be removed by moving the ldiskfs patching in to
+# the configure phase. Or better yet ldiskfs could be updated to generate
+# a ldiskfs_config.h which clearly defines how it was built. This can
+# then be directly included by Lustre to avoid all the autoconf guess work.
+# For an example of this behavior consult the lustre/zfs build integration.
+#
+AM_CONDITIONAL(LDISKFS_DEVEL, \
+ test x$LDISKFS_DIR = x$(readlink -f $PWD/ldiskfs) || \
+ test x$LDISKFS_DIR = x$(readlink -f $PWD/../ldiskfs))
+
+AM_CONDITIONAL(LDISKFS_BUILD, test x$enable_ldiskfs_build = xyes)
+AM_CONDITIONAL(LDISKFS_ENABLED, test x$with_ldiskfs = xyes)
+
+if test -e "$PWD/ldiskfs"; then
+ LDISKFS_DIST_SUBDIR="ldiskfs"
+ AC_SUBST(LDISKFS_DIST_SUBDIR)
+ AC_CONFIG_SUBDIRS("ldiskfs")
+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
+# 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
+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
+ else
+ EXT_DIR=
+ fi
+fi
+
+AC_MSG_CHECKING([$LDISKFS_BACKFS source directory])
+AC_MSG_RESULT([$EXT_DIR])
+AC_SUBST(EXT_DIR)
+])
+
+#
+# LB_LDISKFS_EXT_SOURCE
+#
+# Spot check the existance of several source files common to ext3/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.])
+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])])
+])
+
+#
+# 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)
+
+if test $LDISKFS_BACKFS = 'ext4'; then
+ AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [build ext4 based ldiskfs])
+fi
+
+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.
+#
+# 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])])
+])
+
+#
+# Optionally configure/make the ldiskfs sources. If the sources are
+# determined to reside in-tree this feature will automatically be
+# enabled. If the sources are not in-tree it will be disabled.
+# Use --enable-ldiskfs-build or --disable-ldiskfs-build if you need
+# to override this behavior.
+#
+AC_DEFUN([LB_LDISKFS_BUILD],
+[
+AC_ARG_ENABLE([ldiskfs-build],
+ AC_HELP_STRING([--enable-ldiskfs-build],
+ [enable ldiskfs configure/make]),
+ [], [
+ LDISKFS_DIR_INTREE=$(readlink -f $PWD/ldiskfs)
+ if test x$LDISKFS_DIR = x$LDISKFS_DIR_INTREE; then
+ enable_ldiskfs_build='yes'
+ else
+ enable_ldiskfs_build='no'
+ fi
+ ])
+
+AC_MSG_CHECKING([whether to build ldiskfs])
+if test x$enable_ldiskfs_build = xyes; then
+ AC_MSG_RESULT([$enable_ldiskfs_build])
+
+ 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'
+ AC_MSG_RESULT([$enable_ldiskfs_build])
+fi
+])
+
+AC_DEFUN([LB_LDISKFS_SYMVERS],
+[
+AC_MSG_CHECKING([ldiskfs module symbols])
+if test -r $LDISKFS_OBJ/Module.symvers; then
+ LDISKFS_SYMBOLS=Module.symvers
+elif test -r $LDISKFS_OBJ/Modules.symvers; then
+ LDISKFS_SYMBOLS=Modules.symvers
+elif test -r $LDISKFS_OBJ/ldiskfs/Module.symvers; then
+ LDISKFS_SYMBOLS=Module.symvers
+elif test -r $LDISKFS_OBJ/ldiskfs/Modules.symvers; then
+ LDISKFS_SYMBOLS=Modules.symvers
+else
+ LDISKFS_SYMBOLS=$SYMVERFILE
+fi
+
+AC_MSG_RESULT([$LDISKFS_SYMBOLS])
+AC_SUBST(LDISKFS_SYMBOLS)
+])
+
+AC_DEFUN([LB_LDISKFS_RELEASE],
+[
+AC_MSG_CHECKING([ldiskfs source release])
+if test -r $LDISKFS_OBJ/config.h; then
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-I$LDISKFS_DIR $EXTRA_KCFLAGS"
+ LB_LINUX_TRY_MAKE([
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE
+ #undef VERSION
+ #undef STDC_HEADERS
+
+ #include <$LDISKFS_OBJ/config.h>
+ ],[
+ char *LDISKFS_RELEASE;
+ LDISKFS_RELEASE=VERSION;
+ ],[
+ $makerule LUSTRE_KERNEL_TEST=conftest.i
+ ],[
+ test -s build/conftest.i
+ ],[
+ eval $(grep "LDISKFS_RELEASE=" build/conftest.i)
+ ],[
+ AC_MSG_RESULT([unknown])
+ AC_MSG_ERROR([Could not preprocess test program.])
+ ])
+ EXTRA_KCFLAGS="$tmp_flags"
+ rm build/conftest.i
+elif test -r $LDISKFS_DIR/configure.ac; then
+ LDISKFS_RELEASE=$(awk '/AC\_INIT/ { print [$]3 }' \
+ $LDISKFS_DIR/configure.ac | tr ',' '\n')
+else
+ AC_MSG_RESULT([unknown])
+ AC_MSG_ERROR([Could not locate config.h, META, or configure.ac to check release.])
+fi
+
+if test x$LDISKFS_RELEASE = x; then
+ AC_MSG_RESULT([unknown])
+ AC_MSG_ERROR([Could not determine ldiskfs release.])
+fi
+
+AC_MSG_RESULT([$LDISKFS_RELEASE])
+AC_SUBST(LDISKFS_RELEASE)
+])
+
+#
+# LB_DEFINE_E2FSPROGS_NAMES
+#
+# Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
+#
+AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES],
+[
+AC_ARG_WITH([ldiskfsprogs],
+ AC_HELP_STRING([--with-ldiskfsprogs],
+ [use alternate names for ldiskfs-enabled e2fsprogs]),
+ [],[withval='no'])
+
+AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
+if test x$withval = xyes ; then
+ AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
+ E2FSPROGS="ldiskfsprogs"
+ MKE2FS="mkfs.ldiskfs"
+ DEBUGFS="debugfs.ldiskfs"
+ TUNE2FS="tunefs.ldiskfs"
+ E2LABEL="label.ldiskfs"
+ DUMPE2FS="dumpfs.ldiskfs"
+ E2FSCK="fsck.ldiskfs"
+ PFSCK="pfsck.ldiskfs"
+ AC_MSG_RESULT([enabled])
+else
+ E2FSPROGS="e2fsprogs"
+ MKE2FS="mke2fs"
+ DEBUGFS="debugfs"
+ TUNE2FS="tune2fs"
+ E2LABEL="e2label"
+ DUMPE2FS="dumpe2fs"
+ E2FSCK="e2fsck"
+ PFSCK="fsck"
+ AC_MSG_RESULT([disabled])
+fi
+
+AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
+AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
+AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
+AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
+AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
+AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
+AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
+AC_DEFINE_UNQUOTED(PFSCK, "$PFSCK", [name of parallel fsck program])
+
+AC_SUBST([E2FSPROGS], [$E2FSPROGS])
+AC_SUBST([MKE2FS], [$MKE2FS])
+AC_SUBST([DEBUGFS], [$DEBUGFS])
+AC_SUBST([TUNE2FS], [$TUNE2FS])
+AC_SUBST([E2LABEL], [$E2LABEL])
+AC_SUBST([DUMPE2FS], [$DUMPE2FS])
+AC_SUBST([E2FSCK], [$E2FSCK])
+AC_SUBST([PFSCK], [$PFSCK])
+])
+
+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"
+ fi
+ ;;
+ *)
+ AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])
+ LDISKFS_SERIES=
+ ;;
+ esac
+ AC_MSG_RESULT([$LDISKFS_SERIES])
+else
+ LDISKFS_SERIES=
+fi
+AC_SUBST(LDISKFS_SERIES)
+])
AC_CONFIG_SUBDIRS(lustre-iokit)
])
-#
-# LB_PATH_LDISKFS
-#
-# Handle internal/external ldiskfs
-#
-AC_DEFUN([LB_PATH_LDISKFS],
-[AC_ARG_WITH([ldiskfs],
- AC_HELP_STRING([--with-ldiskfs=path],
- [set path to ldiskfs source (default is included ldiskfs)]),
- [],[
- if test x$linux25$enable_server = xyesyes ; then
- with_ldiskfs=yes
- else
- with_ldiskfs=no
- fi
- ])
-AC_ARG_WITH([ldiskfs-inkernel],
- AC_HELP_STRING([--with-ldiskfs-inkernel],
- [use ldiskfs built in to the kernel]),
- [with_ldiskfs=inkernel], [])
-AC_MSG_CHECKING([location of ldiskfs])
-case x$with_ldiskfs in
- xyes)
- AC_MSG_RESULT([internal])
- LB_CHECK_FILE([$srcdir/ldiskfs/lustre-ldiskfs.spec.in],[],[
- AC_MSG_ERROR([A complete internal ldiskfs was not found.])
- ])
- LDISKFS_SUBDIR="ldiskfs"
- LDISKFS_DIR="$PWD/ldiskfs"
- ;;
- xno)
- AC_MSG_RESULT([disabled])
- ;;
- xinkernel)
- AC_MSG_RESULT([inkernel])
- LB_CHECK_FILE([$LINUX/include/linux/ldiskfs_fs.h],[],[
- AC_MSG_ERROR([ldiskfs was not found in $LINUX])
- ])
- ;;
- *)
- AC_MSG_RESULT([$with_ldiskfs])
- LB_CHECK_FILE([$with_ldiskfs/ldiskfs/inode.c],[],[
- AC_MSG_ERROR([A complete (built) external ldiskfs was not found.])
- ])
- LDISKFS_DIR=$with_ldiskfs
- ;;
-esac
-AC_SUBST(LDISKFS_DIR)
-AC_SUBST(LDISKFS_SUBDIR)
-AM_CONDITIONAL(LDISKFS_ENABLED, test x$with_ldiskfs != xno)
-AM_CONDITIONAL(LDISKFS_IN_KERNEL, test x$with_ldiskfs = xinkernel)
-
-if test x$with_ldiskfs != xno ; then
- LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET
-fi
-
-if test x$enable_ext4 = xyes ; then
- AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [build ext4 based ldiskfs])
-fi
-
-# We have to configure even if we don't build here for make dist to work
-AC_CONFIG_SUBDIRS(ldiskfs)
-])
-
-AC_DEFUN([LC_KERNEL_WITH_EXT4],
-[if test -f $LINUX/fs/ext4/ext4.h ; then
-$1
-else
-$2
-fi
-])
-
-#
-# LB_HAVE_EXT4_ENABLED
-#
-AC_DEFUN([LB_HAVE_EXT4_ENABLED],
-[
-if test x$RHEL_KERNEL = xyes; then
- AC_ARG_ENABLE([ext4],
- AC_HELP_STRING([--enable-ext4],
- [enable building of ldiskfs based on ext4]),
- [],
- [
- if test x$ldiskfs_is_ext4 = xyes; then
- enable_ext4=yes
- else
- enable_ext4=no
- fi
- ])
-else
- case $LINUXRELEASE in
- # ext4 was in 2.6.22-2.6.26 but not stable enough to use
- 2.6.2[[0-9]]*) enable_ext4='no' ;;
- *) LC_KERNEL_WITH_EXT4([enable_ext4='yes'],
- [enable_ext4='no']) ;;
- esac
-fi
-if test x$enable_ext4 = xyes; then
- ac_configure_args="$ac_configure_args --enable-ext4"
-fi
-AC_MSG_CHECKING([whether to build ldiskfs based on ext4])
-AC_MSG_RESULT([$enable_ext4])
-])
-
# Define no libcfs by default.
AC_DEFUN([LB_LIBCFS_DIR],
[
AC_SUBST(LIBCFS_SUBDIR)
AC_SUBST(LIBCFS_INCLUDE_DIR)
])
-
-#
-# 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.
-#
-# 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])])
-])
-
-#
-# LB_DEFINE_LDISKFS_OPTIONS
-#
-# Enable config options related to ldiskfs. These are used both by ldiskfs
-# and lvfs (which includes ldiskfs headers.)
-#
-AC_DEFUN([LB_DEFINE_LDISKFS_OPTIONS],
-[
- AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
- 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])
-])
-
-#
-# LB_DEFINE_E2FSPROGS_NAMES
-#
-# Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
-#
-AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES],
-[AC_ARG_WITH([ldiskfsprogs],
- AC_HELP_STRING([--with-ldiskfsprogs],
- [use alternate names for ldiskfs-enabled e2fsprogs]),
- [],[withval='no'])
-
-AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
-if test x$withval = xyes ; then
- AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
- E2FSPROGS="ldiskfsprogs"
- MKE2FS="mkfs.ldiskfs"
- DEBUGFS="debugfs.ldiskfs"
- TUNE2FS="tunefs.ldiskfs"
- E2LABEL="label.ldiskfs"
- DUMPE2FS="dumpfs.ldiskfs"
- E2FSCK="fsck.ldiskfs"
- AC_MSG_RESULT([enabled])
-else
- E2FSPROGS="e2fsprogs"
- MKE2FS="mke2fs"
- DEBUGFS="debugfs"
- TUNE2FS="tune2fs"
- E2LABEL="e2label"
- DUMPE2FS="dumpe2fs"
- E2FSCK="e2fsck"
- AC_MSG_RESULT([disabled])
-fi
- AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
- AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
- AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
- AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
- AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
- AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
- AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
-])
#
# LB_CONFIG_CRAY_XT3
LB_CONFIG_MODULES
LN_CONFIG_USERSPACE
-LB_HAVE_EXT4_ENABLED
LB_PATH_DMU
LB_PATH_LIBSYSIO
AC_INIT([Lustre ldiskfs], 3.3.0, [http://bugs.whamcloud.com/])
AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
-ldiskfs_is_ext4=yes
# Don't look for install-sh, etc. in ..
AC_CONFIG_AUX_DIR([.])
esac
])
-
AC_MSG_CHECKING([whether to build kernel modules])
AC_ARG_ENABLE([modules],
AC_HELP_STRING([--disable-modules],
fi
fi
+LB_LDISKFS_SERIES([test x$enable_dist = xno])
+
+AC_MSG_CHECKING([whether to build Lustre server support])
+AC_ARG_ENABLE([server],
+ AC_HELP_STRING([--disable-server],
+ [disable Lustre server support]),
+ [],[
+ if test -n "$LDISKFS_SERIES"; then
+ enable_server='yes'
+ else
+ enable_server='no'
+ fi
+ ])
+AC_MSG_RESULT([$enable_server])
+
LB_CONFIG_HEADERS
# These allow Lustre Makefiles and autoMakefiles to be used unchanged.
AC_PATH_PROG(QUILT, quilt, [no])
fi
-if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
+if test x$enable_server$PATCH$QUILT = xyesnono ; then
AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
fi
AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
+AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
-LB_DEFINE_LDISKFS_OPTIONS
-
-LB_HAVE_EXT4_ENABLED
-
-if test x$enable_ext4 = xyes ; then
- AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [ldiskfs based on ext4])
- BACKFS=ext4
-else
- BACKFS=ext3
-fi
+if test x$enable_server$enable_dist = xyesno ; then
+LB_LDISKFS_EXT_RELEASE
+LB_LDISKFS_EXT_DIR
+LB_LDISKFS_EXT_SOURCE
+LB_LDISKFS_DEFINE_OPTIONS
+BACKFS=$LDISKFS_BACKFS
AC_SUBST(BACKFS)
BACKFSU=${BACKFS/ext/EXT}
AC_SUBST(BACKFSU) # We need a Upper string
-
-AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
-
-if test x$enable_dist != xyes; then
- # don't need to do this if only configuring for make dist
-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"
- fi
- ;;
-*) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
-esac
-AC_MSG_RESULT([$LDISKFS_SERIES])
fi
-AC_SUBST(LDISKFS_SERIES)
AC_SUBST(ac_configure_args)
-
LB_CONFIG_FILES
AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
# copy makefile over to not break patches
backfs_extra := $(wildcard @LINUX@/fs/@BACKFS@/Makefile)
-backfs_headers := $(wildcard @LINUX@/fs/@BACKFS@/*.h)
+backfs_headers := $(wildcard @EXT_DIR@/*.h)
linux_headers := $(wildcard @LINUX@/include/linux/@BACKFS@*.h)
trace_headers := $(wildcard @LINUX@/include/trace/events/@BACKFS@*.h)
-backfs_sources := $(filter-out %.mod.c,$(wildcard @LINUX@/fs/@BACKFS@/*.c))
+backfs_sources := $(filter-out %.mod.c,$(wildcard @EXT_DIR@/*.c))
ext3_new_sources := extents.c mballoc.c group.h dynlocks.c fiemap.h
ext3_new_headers := ext3_extents.h
])
#
-# LC_CONFIG_BACKINGFS
-#
-# setup, check the backing filesystem
-#
-AC_DEFUN([LC_CONFIG_BACKINGFS],
-[
-BACKINGFS="ldiskfs"
-
-if test x$with_ldiskfs = xno ; then
- if test x$linux25$enable_server = xyesyes ; then
- AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
- fi
-else
- # ldiskfs is enabled
- LB_DEFINE_LDISKFS_OPTIONS
-fi #ldiskfs
-
-AC_MSG_CHECKING([which backing filesystem to use])
-AC_MSG_RESULT([$BACKINGFS])
-AC_SUBST(BACKINGFS)
-])
-
-#
# LC_CONFIG_PINGER
#
# the pinger is temporary, until we have the recovery node in place
])
#
-# LC_HEADER_LDISKFS_XATTR
-#
-# CHAOS kernel-devel package will not include fs/ldiskfs/xattr.h
-#
-AC_DEFUN([LC_HEADER_LDISKFS_XATTR],
-[AC_MSG_CHECKING([if ldiskfs has xattr.h header])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs -I$LDISKFS_DIR -I$LDISKFS_DIR/ldiskfs"
-LB_LINUX_TRY_COMPILE([
- #include <ldiskfs/xattr.h>
-],[
- ldiskfs_xattr_get(NULL, 0, "", NULL, 0);
- ldiskfs_xattr_set_handle(NULL, NULL, 0, "", NULL, 0, 0);
-
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_LDISKFS_XATTR_H, 1, [ldiskfs/xattr.h found])
-],[
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-#
# LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
#
# Check for our patched grab_cache_page_nowait_gfp() function
],[])
])
-#
-# LC_EXT4_DISCARD_PREALLOCATIONS
-#
-AC_DEFUN([LC_EXT4_DISCARD_PREALLOCATIONS],
-[AC_MSG_CHECKING([if ext4_discard_preallocatoins defined])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs"
-LB_LINUX_TRY_COMPILE([
- #include <ext4/ext4.h>
-],[
- struct inode i;
- ext4_discard_preallocations(&i);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(LDISKFS_DISCARD_PREALLOCATIONS, 1,
- [ext4_discard_preacllocations defined])
-],[
- AC_MSG_RESULT(no)
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-#
-# LC_EXT_INSERT_EXTENT_WITH_5ARGS
-#
-AC_DEFUN([LC_EXT_INSERT_EXTENT_WITH_5ARGS],
-[AC_MSG_CHECKING([ext4_ext_insert_extent needs 5 arguments])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs"
-LB_LINUX_TRY_COMPILE([
- #include <ext4/ext4_extents.h>
-],[
- ext4_ext_insert_extent(NULL, NULL, NULL, NULL, 0);
-],[
- AC_DEFINE([EXT_INSERT_EXTENT_WITH_5ARGS], 1,
- [ext4_ext_insert_exent needs 5 arguments])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
#2.6.18 + RHEL5 (fc6)
# RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
])
#
-# LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB
-#
-AC_DEFUN([LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB],
-[AC_MSG_CHECKING([if EXT4_SINGLEDATA_TRANS_BLOCKS takes the sb as argument])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs"
-LB_LINUX_TRY_COMPILE([
- #include <ext4/ext4.h>
- #include <ext4/ext4_jbd2.h>
-],[
- struct super_block sb;
- EXT4_SINGLEDATA_TRANS_BLOCKS(&sb);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(LDISKFS_SINGLEDATA_TRANS_BLOCKS_HAS_SB, 1,
- [EXT4_SINGLEDATA_TRANS_BLOCKS takes sb as argument])
-],[
- AC_MSG_RESULT(no)
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-#
-# LC_WALK_SPACE_HAS_DATA_SEM
-#
-# 2.6.32 ext4_ext_walk_space() takes i_data_sem internally.
-#
-AC_DEFUN([LC_WALK_SPACE_HAS_DATA_SEM],
-[AC_MSG_CHECKING([if ext4_ext_walk_space() takes i_data_sem])
-WALK_SPACE_DATA_SEM="$(awk 'BEGIN { in_walk_space = 0 } \
- /^int ext4_ext_walk_space\(/ { in_walk_space = 1 } \
- /^}/ { if (in_walk_space) in_walk_space = 0 } \
- /i_data_sem/ { if (in_walk_space) { print("yes"); exit } }' \
- $LINUX/fs/ext4/extents.c)"
-if test x"$WALK_SPACE_DATA_SEM" == xyes ; then
- AC_DEFINE(WALK_SPACE_HAS_DATA_SEM, 1,
- [ext4_ext_walk_space takes i_data_sem])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-])
-
-#
# LC_QUOTA64
#
# Check if kernel has been patched for 64-bit quota limits support.
LC_EXPORT___D_REHASH
LC_EXPORT_NODE_TO_CPUMASK
- LC_HEADER_LDISKFS_XATTR
LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
LC_STRUCT_STATFS
LC_FILEMAP_POPULATE
if test x$enable_server = xyes ; then
LC_EXPORT_INVALIDATE_MAPPING_PAGES
fi
- LC_EXT4_DISCARD_PREALLOCATIONS
- LC_EXT_INSERT_EXTENT_WITH_5ARGS
#2.6.18 + RHEL5 (fc6)
LC_PG_FS_MISC
LC_SB_BDI
LC_BLK_QUEUE_MAX_SECTORS
LC_BLK_QUEUE_MAX_SEGMENTS
- LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB
- LC_WALK_SPACE_HAS_DATA_SEM
#
if test x$enable_server = xyes ; then
AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
LC_FUNC_DEV_SET_RDONLY
LC_STACK_SIZE
- LC_CONFIG_BACKINGFS
LC_QUOTA64
fi
])
MODULES := lvfs
-@SERVER_TRUE@MODULES += fsfilt_@BACKINGFS@
+@SERVER_TRUE@MODULES += fsfilt_ldiskfs
@QUOTA_TRUE@MODULES += quotafmt_test
lvfs-objs := lvfs_common.o lvfs_linux.o fsfilt.o lvfs_lib.o
@QUOTA_TRUE@quotafmt-objs := quotafmt_test.o
-fsfilt_@BACKINGFS@-objs := fsfilt-@BACKINGFS@.o
-@QUOTA_TRUE@fsfilt_@BACKINGFS@-objs += lustre_quota_fmt.o
+fsfilt_ldiskfs-objs := fsfilt-ldiskfs.o
+@QUOTA_TRUE@fsfilt_ldiskfs-objs += lustre_quota_fmt.o
$(obj)/fsfilt-%.c: $(obj)/fsfilt_%.c
ln -s $< $@
modulefs_DATA := lvfs$(KMODEXT)
if SERVER
-modulefs_DATA += fsfilt_$(BACKINGFS)$(KMODEXT)
+modulefs_DATA += fsfilt_ldiskfs$(KMODEXT)
-sources: fsfilt_$(BACKINGFS).c
+sources: fsfilt_ldiskfs.c
touch sources
else #SERVER
#define FSFILT_DELETE_TRANS_BLOCKS(sb) EXT3_DELETE_TRANS_BLOCKS(sb)
#endif
-#ifdef EXT3_SINGLEDATA_TRANS_BLOCKS_HAS_SB
/* for kernels 2.6.18 and later */
#define FSFILT_SINGLEDATA_TRANS_BLOCKS(sb) EXT3_SINGLEDATA_TRANS_BLOCKS(sb)
-#else
-#define FSFILT_SINGLEDATA_TRANS_BLOCKS(sb) EXT3_SINGLEDATA_TRANS_BLOCKS
-#endif
-#ifdef EXT_INSERT_EXTENT_WITH_5ARGS
#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
ext3_ext_insert_extent(handle, inode, path, newext, flag)
-#else
-#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
- ext3_ext_insert_extent(handle, inode, path, newext)
-#endif
-#ifdef EXT3_DISCARD_PREALLOCATIONS
#define ext3_mb_discard_inode_preallocations(inode) \
ext3_discard_preallocations(inode)
-#endif
#ifdef HAVE_EXT4_LDISKFS
#define fsfilt_log_start_commit(journal, tid) jbd2_log_start_commit(journal, tid)
# define fsfilt_down_truncate_sem(inode) down(&LDISKFS_I(inode)->truncate_sem);
#else
# ifdef HAVE_EXT4_LDISKFS
-# ifdef WALK_SPACE_HAS_DATA_SEM /* We only use it in fsfilt_map_nblocks() for now */
# define fsfilt_up_truncate_sem(inode) do{ }while(0)
# define fsfilt_down_truncate_sem(inode) do{ }while(0)
-# else
-# define fsfilt_up_truncate_sem(inode) up_write((&EXT4_I(inode)->i_data_sem))
-# define fsfilt_down_truncate_sem(inode) down_write((&EXT4_I(inode)->i_data_sem))
-# endif
# else
# define fsfilt_up_truncate_sem(inode) mutex_unlock(&EXT3_I(inode)->truncate_mutex)
# define fsfilt_down_truncate_sem(inode) mutex_lock(&EXT3_I(inode)->truncate_mutex)
ext3_ext_walk_space(tree, block, num, cb);
#endif
-#ifdef EXT_INSERT_EXTENT_WITH_5ARGS
-#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
- ext3_ext_insert_extent(handle, inode, path, newext, flag)
-#else
-#define fsfilt_ext3_ext_insert_extent(handle, inode, path, newext, flag) \
- ext3_ext_insert_extent(handle, inode, path, newext)
-#endif
-
#include <linux/lustre_version.h>
struct bpointers {
#endif
struct inode *inode = ext3_ext_base2inode(base);
struct ext3_extent nex;
-#if defined(HAVE_EXT4_LDISKFS) && defined(WALK_SPACE_HAS_DATA_SEM)
+#if defined(HAVE_EXT4_LDISKFS)
struct ext4_ext_path *tmppath = NULL;
struct ext4_extent *tmpex;
#endif
return EXT_REPEAT;
}
-#if defined(HAVE_EXT4_LDISKFS) && defined(WALK_SPACE_HAS_DATA_SEM)
+#if defined(HAVE_EXT4_LDISKFS)
/* In 2.6.32 kernel, ext4_ext_walk_space()'s callback func is not
* protected by i_data_sem, we need revalidate extent to be created */
down_write((&EXT4_I(inode)->i_data_sem));
BUG_ON(le32_to_cpu(nex.ee_block) != cex->ec_block);
out:
-#if defined(HAVE_EXT4_LDISKFS) && defined(WALK_SPACE_HAS_DATA_SEM)
+#if defined(HAVE_EXT4_LDISKFS)
ext4_ext_drop_refs(tmppath);
kfree(tmppath);
up_write((&EXT4_I(inode)->i_data_sem));