-subdir-m += @LIBCFS_SUBDIR@ lnet
+subdir-m += @LDISKFS_SUBDIR@ @LIBCFS_SUBDIR@ lnet
subdir-m += lustre
@INCLUDE_RULES@
SUBDIRS := @LDISKFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
-DIST_SUBDIRS := @LDISKFS_DIST_SUBDIR@ @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre config contrib
-SOURCES_SUBDIRS := @LIBCFS_SUBDIR@ lnet lustre
-RPM_SUBDIRS := @LDISKFS_SUBDIR@ @LUSTREIOKIT_SUBDIR@
-MODULE_SYMVERS_DEPS = module-symvers
+DIST_SUBDIRS := ldiskfs @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre config contrib
@TESTS_TRUE@BUILD_TESTS = true
@TESTS_FALSE@BUILD_TESTS = false
AUTOMAKE_OPTIONS = foreign
FIND_TAG_FILES_CMD = find $(top_srcdir) \
- -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage \
+ -path $(top_srcdir)/ldiskfs/linux-stage \
-prune -false -o -type f -name '*.[hc]'
-MAKEEACHSUBDIR = \
- for subdir in $(RPM_SUBDIRS) ; do \
- echo "Making $@ in $$subdir" ; \
- cd $$subdir ; \
- $(MAKE) $(AM_MAKEFLAGS) $@ ; \
- cd - ; \
- echo "Finished $@ in $$subdir" ; \
- done
-
# these empty rules are needed so that automake doesn't add its own
# recursive rules
etags-recursive:
if MODULES
sources: all-sources
-all-sources: $(MODULE_SYMVERS_DEPS)
- for dir in $(SOURCES_SUBDIRS) ; do \
- $(MAKE) sources -C $$dir || exit $$? ; \
- done
+all-sources: module-symvers
+ $(MAKE) sources -C lustre || exit $$?
if LINUX
all-am: modules
endif # MODULES
dist-hook:
- $(RM) $(distdir)/ldiskfs/*.spec
$(RM) $(distdir)/lustre-iokit/*.spec
find $(distdir) -name .deps -o \
-name CVS -o \
if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
RPMARGS="--without lustre_tests"; \
fi; \
- eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
+ eval rpmbuild $$RPMARGS -ts $(distdir).tar.gz
rpms:
- @$(MAKEEACHSUBDIR)
+if BUILD_LUSTREIOKIT
+ $(MAKE) -C @LUSTREIOKIT_SUBDIR@ $(AM_MAKEFLAGS) $@
+endif
$(MAKE) $(AM_MAKEFLAGS) rpms-real
srpm:
- @$(MAKEEACHSUBDIR)
+if BUILD_LUSTREIOKIT
+ $(MAKE) -C @LUSTREIOKIT_SUBDIR@ $(AM_MAKEFLAGS) $@
+endif
$(MAKE) $(AM_MAKEFLAGS) srpm-real
# In the debs target, first make sure what's in the changelog reflects
EXTRA_DIST += debian/*
endif
-module-symvers-ldiskfs:
-if LDISKFS_ENABLED
- @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
-
module-symvers-zfs:
if ZFS_ENABLED
@if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
fi
endif # ZFS_ENABLED
-module-symvers: module-symvers-ldiskfs module-symvers-zfs
+module-symvers: module-symvers-zfs
CSTK=/tmp/checkstack
CSTKO=/tmp/checkstack.orig
echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \
exit 1; \
fi
-if LDISKFS_ENABLED
- if [ -f $(distdir)/META -a -d $(distdir)/ldiskfs ]; then \
- cp $(distdir)/META $(distdir)/ldiskfs/META; \
- fi
-endif
echo "Checking for a complete tree..."
REQUIRED_DIRS="libcfs lnet lustre"
OPTIONAL_DIRS="snmp portals"
-CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
+CONFIGURE_DIRS="libsysio lustre-iokit"
for dir in $REQUIRED_DIRS ; do
test -d "$dir" || \
-#
-# 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_DEFUN([LDISKFS_LINUX_SERIES],
[
-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
- ])
+LDISKFS_SERIES=
+AC_MSG_CHECKING([which ldiskfs series to use])
-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])
+SER=
+AS_IF([test x$RHEL_KERNEL = xyes], [
+ AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32-343],[
+ AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32],[],
+ [SER="2.6-rhel6.series"],[SER="2.6-rhel6.series"])],
+ [SER="2.6-rhel6.4.series"],[SER="2.6-rhel6.4.series"])
+], [test x$SUSE_KERNEL = xyes], [
+ AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
+ AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
+ [SER="2.6-sles11.series"],[SER="2.6-sles11.series"])],
+ [SER="3.0-sles11.series"],[SER="3.0-sles11.series"])
+])
+LDISKFS_SERIES=$SER
-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
- ])
+AS_IF([test -z "$LDISKFS_SERIES"],
+ [AC_MSG_WARN([Unknown kernel version $LDISKFS_VERSIONRELEASE])])
+AC_MSG_RESULT([$LDISKFS_SERIES])
-if test x$with_ldiskfs = xyes; then
- AC_MSG_CHECKING([ldiskfs source directory])
- AC_MSG_RESULT([$LDISKFS_DIR])
- AC_SUBST(LDISKFS_DIR)
+AC_SUBST(LDISKFS_SERIES)
+])
- AC_MSG_CHECKING([ldiskfs object directory])
- AC_MSG_RESULT([$LDISKFS_OBJ])
- AC_SUBST(LDISKFS_OBJ)
+#
+# 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 "$EXT4_SRC_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])
+])
+])
- LB_LDISKFS_SYMVERS
- LB_LDISKFS_EXT_DIR
- LB_LDISKFS_BUILD
- AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
-fi
+#
+# 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
+#
+AC_DEFUN([LB_EXT_PBLOCK],
+[AC_MSG_CHECKING([if kernel has ext_pblocks])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include "$EXT4_SRC_DIR/ext4_extents.h"
+],[
+ ext_pblock(NULL);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_EXT_PBLOCK, 1,
+ [kernel has ext_pblocks])
+],[
+ AC_MSG_RESULT([no])
+])
+])
#
-# LDISKFS_DEVEL is required because when using the ldiskfs-devel package 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.
+# LDISKFS_AC_PATCH_PROGRAM
#
-# 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.
+# Determine which program should be used to apply the patches to
+# the ext4 source code to produce the ldiskfs source code.
#
-AM_CONDITIONAL(LDISKFS_DEVEL, \
- test x$LDISKFS_DIR = x$(readlink -f $PWD/ldiskfs) || \
- test x$LDISKFS_DIR = x$(readlink -f $PWD/../ldiskfs))
+AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
+ AC_ARG_ENABLE([quilt],
+ [AC_HELP_STRING([--disable-quilt],
+ [disable use of quilt for ldiskfs])],
+ [AS_IF([test "x$enableval" = xno],
+ [use_quilt=no],
+ [use_quilt=maybe])],
+ [use_quilt=maybe]
+ )
-AM_CONDITIONAL(LDISKFS_BUILD, test x$enable_ldiskfs_build = xyes)
-AM_CONDITIONAL(LDISKFS_ENABLED, test x$with_ldiskfs = xyes)
+ AS_IF([test x$use_quilt = xmaybe], [
+ AC_PATH_PROG([quilt_avail], [quilt], [no])
+ AS_IF([test x$quilt_avail = xno], [
+ use_quilt=no
+ ], [
+ use_quilt=yes
+ ])
+ ])
-if test -e "$PWD/ldiskfs"; then
- LDISKFS_DIST_SUBDIR="ldiskfs"
- AC_SUBST(LDISKFS_DIST_SUBDIR)
- AC_CONFIG_SUBDIRS("ldiskfs")
-fi
+ AS_IF([test x$use_quilt = xno], [
+ AC_PATH_PROG([patch_avail], [patch], [no])
+ AS_IF([test x$patch_avail = xno], [
+ AC_MSG_ERROR([*** Need "quilt" or "patch" command])
+ ])
+ ])
])
#
-# LB_LDISKFS_EXT_DIR
+# LB_CONDITIONAL_LDISKFS
#
-# 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],
+AC_DEFUN([LB_CONFIG_LDISKFS],
[
-# Kernel ext source located with devel headers
-linux_src=$LINUX
-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/ext4/super.c"; then
- EXT_DIR=$linux_src/fs/ext4
- else
- EXT_DIR=
- fi
-fi
+# --with-ldiskfs is deprecated now that ldiskfs is fully merged with lustre.
+# However we continue to support this option through Lustre 2.5.
+AC_ARG_WITH([ldiskfs],
+ [],
+ [AC_MSG_WARN([--with-ldiskfs is deprecated, please use --enable-ldiskfs])
+ AS_IF([test x$withval != xyes -a x$withval != xno],
+ [AC_MSG_ERROR([the ldiskfs option is deprecated, and
+ no longer supports paths to external ldiskfs source])])
+ ]
+)
-AC_MSG_CHECKING([ext4 source directory])
-AC_MSG_RESULT([$EXT_DIR])
-AC_SUBST(EXT_DIR)
+AC_ARG_ENABLE([ldiskfs],
+ [AS_HELP_STRING([--disable-ldiskfs],
+ [disable ldiskfs osd (default is enable)])],
+ [AS_IF([test x$enable_ldiskfs != xyes -a x$enable_ldiskfs != xno],
+ [AC_MSG_ERROR([ldiskfs valid options are "yes" or "no"])])],
+ [AS_IF([test "${with_ldiskfs+set}" = set],
+ [enable_ldiskfs=$with_ldiskfs],
+ [enable_ldiskfs=maybe])
+ ]
+)
+
+AS_IF([test x$enable_server = xno],
+ [AS_CASE([$enable_ldiskfs],
+ [maybe], [enable_ldiskfs=no],
+ [yes], [AC_MSG_ERROR([cannot build ldiskfs when servers are disabled])]
+ )]
+)
+
+AS_IF([test x$enable_ldiskfs != xno],[
+ # In the future, we chould change enable_ldiskfs from maybe to
+ # either yes or no based on additional tests, e.g. whether a patch
+ # set is available for the detected kernel. For now, we just always
+ # set it to "yes".
+ AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes])
+
+ LDISKFS_LINUX_SERIES
+ LDISKFS_AC_PATCH_PROGRAM
+ LB_EXT4_SRC_DIR
+ LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
+ LB_EXT_PBLOCK
+ AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
+ AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
+ AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
+ AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
+ AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
+])
+
+AC_MSG_CHECKING([whether to build ldiskfs])
+AC_MSG_RESULT([$enable_ldiskfs])
+
+AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes])
])
#
-# LB_LDISKFS_EXT_SOURCE
+# LB_VALIDATE_EXT4_SRC_DIR
#
# 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],
+AC_DEFUN([LB_VALIDATE_EXT4_SRC_DIR],
[
-if test x$EXT_DIR = x; then
+if test x$EXT4_SRC_DIR = x; then
enable_ldiskfs_build='no'
else
- LB_CHECK_FILE([$EXT_DIR/dir.c], [], [
+ LB_CHECK_FILE([$EXT4_SRC_DIR/dir.c], [], [
enable_ldiskfs_build='no'
AC_MSG_WARN([ext4 must exist for ldiskfs build])])
- LB_CHECK_FILE([$EXT_DIR/file.c], [], [
+ LB_CHECK_FILE([$EXT4_SRC_DIR/file.c], [], [
enable_ldiskfs_build='no'
AC_MSG_WARN([ext4 must exist for ldiskfs build])])
- LB_CHECK_FILE([$EXT_DIR/inode.c], [], [
+ LB_CHECK_FILE([$EXT4_SRC_DIR/inode.c], [], [
enable_ldiskfs_build='no'
AC_MSG_WARN([ext4 must exist for ldiskfs build])])
- LB_CHECK_FILE([$EXT_DIR/super.c], [], [
+ LB_CHECK_FILE([$EXT4_SRC_DIR/super.c], [], [
enable_ldiskfs_build='no'
AC_MSG_WARN([ext4 must exist for ldiskfs build])])
fi
if test x$enable_ldiskfs_build = xno; then
- enable_ldiskfs_build='no'
- with_ldiskfs='no'
- LDISKFS_SUBDIR=
+ enable_ldiskfs='no'
AC_MSG_WARN([
-Disabling server because complete ext4 source does not exist.
+Disabling ldiskfs support 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
])
#
-# 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.
+# LB_EXT4_SRC_DIR
#
-AC_DEFUN([LB_LDISKFS_BUILD],
+# Determine the location of the ext4 source code. It it required
+# for several configure tests and to build ldiskfs.
+#
+AC_DEFUN([LB_EXT4_SRC_DIR],
[
-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])
- LDISKFS_SUBDIR="ldiskfs"
-
- LB_CHECK_FILE([$LDISKFS_DIR/configure], [], [
- AC_MSG_ERROR([Complete ldiskfs build system must exist])])
- LB_LDISKFS_EXT_SOURCE
-
- AC_SUBST(LDISKFS_SUBDIR)
+# Kernel ext source located with devel headers
+linux_src=$LINUX
+if test -e "$linux_src/fs/ext4/super.c"; then
+ EXT4_SRC_DIR=$linux_src/fs/ext4
else
- enable_ldiskfs_build='no'
- AC_MSG_RESULT([$enable_ldiskfs_build])
+ # 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/ext4/super.c"; then
+ EXT4_SRC_DIR=$linux_src/fs/ext4
+ else
+ EXT4_SRC_DIR=
+ fi
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_CHECKING([ext4 source directory])
+AC_MSG_RESULT([$EXT4_SRC_DIR])
+AC_SUBST(EXT4_SRC_DIR)
-AC_MSG_RESULT([$LDISKFS_SYMBOLS])
-AC_SUBST(LDISKFS_SYMBOLS)
+LB_VALIDATE_EXT4_SRC_DIR
])
#
])
#
+# LB_LINUX_UTSRELEASE
+#
+# Determine the Linux kernel version string from the utsrelease
+#
+AC_DEFUN([LB_LINUX_UTSRELEASE], [
+ AC_MSG_CHECKING([kernel source version])
+
+ utsrelease1=${LINUX_OBJ}/include/generated/utsrelease.h
+ utsrelease2=${LINUX_OBJ}/include/linux/utsrelease.h
+ utsrelease3=${LINUX_OBJ}/include/linux/version.h
+ AS_IF([test -r ${utsrelease1} && fgrep -q UTS_RELEASE ${utsrelease1}], [
+ utsrelease=${utsrelease1}
+ ], [test -r ${utsrelease2} && fgrep -q UTS_RELEASE ${utsrelease2}], [
+ utsrelease=${utsrelease2}
+ ], [test -r ${utsrelease3} && fgrep -q UTS_RELEASE ${utsrelease3}], [
+ utsrelease=${utsrelease3}
+ ])
+
+ AS_IF([test ! -z "${utsrelease}"], [
+ UTS_RELEASE=$(awk -F \" '/ UTS_RELEASE / { print [$]2 }' \
+ ${utsrelease})
+ AS_IF([test -z "$UTS_RELEASE"], [
+ AC_MSG_RESULT([Not found])
+ AC_MSG_ERROR([*** Cannot determine kernel version.])
+ ])
+ ], [
+ AC_MSG_RESULT([Not found])
+ AC_MSG_ERROR([
+ *** Cannot find UTS_RELEASE definition.
+ *** This is often provided by the kernel-devel package.])
+ ])
+
+ AC_MSG_RESULT([${UTS_RELEASE}])
+
+ LINUX_VERSION=${UTS_RELEASE}
+ AC_SUBST(LINUX_VERSION)
+ LINUXRELEASE=${UTS_RELEASE}
+ AC_SUBST(LINUXRELEASE)
+])
+
+
+#
# LB_LINUX_RELEASE
#
# get the release version of linux
#
AC_DEFUN([LB_LINUX_RELEASE],
-[LINUXRELEASE=
-rm -f build/conftest.i
-AC_MSG_CHECKING([for Linux release])
-if test -s $LINUX_OBJ/include/$AUTOCONF_HDIR/utsrelease.h ; then
- LINUXRELEASEHEADER=$AUTOCONF_HDIR/utsrelease.h
-else
- LINUXRELEASEHEADER=$VERSION_HDIR/version.h
-fi
-LB_LINUX_TRY_MAKE([
- #include <$LINUXRELEASEHEADER>
-],[
- char *LINUXRELEASE;
- LINUXRELEASE=UTS_RELEASE;
-],[
- $makerule LUSTRE_KERNEL_TEST=conftest.i
-],[
- test -s build/conftest.i
-],[
- # LINUXRELEASE="UTS_RELEASE"
- eval $(grep "LINUXRELEASE=" build/conftest.i)
-],[
- AC_MSG_RESULT([unknown])
- AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.])
-])
-rm -f build/conftest.i
-if test x$LINUXRELEASE = x ; then
- AC_MSG_RESULT([unknown])
- AC_MSG_ERROR([Could not determine Linux release version from $LINUXRELEASEHEADER.])
-fi
-AC_MSG_RESULT([$LINUXRELEASE])
-AC_SUBST(LINUXRELEASE)
+[
+LB_LINUX_UTSRELEASE
moduledir='$(CROSS_PATH)/lib/modules/$(LINUXRELEASE)/updates/kernel'
AC_SUBST(moduledir)
# ------------ RELEASE --------------------------------
AC_MSG_CHECKING([for Lustre release])
-AC_ARG_WITH([release],
+AC_ARG_WITH([release],[
AC_HELP_STRING([--with-release=string],
[set the release string (default=$kvers_YYYYMMDDhhmm)]),
[RELEASE=$withval],
if test -n "$DOWNSTREAM_RELEASE"; then
RELEASE="${DOWNSTREAM_RELEASE}_"
fi
- RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID")
+ RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID"
+])
AC_MSG_RESULT($RELEASE)
AC_SUBST(RELEASE)
-# check is redhat/suse kernels
+# check if the kernel is one from RHEL or SUSE
AC_MSG_CHECKING([for RedHat kernel version])
- AS_IF([fgrep -q RHEL_RELEASE ${LINUX_OBJ}/include/linux/version.h], [
+ AS_IF([fgrep -q RHEL_RELEASE ${LINUX_OBJ}/include/$VERSION_HDIR/version.h], [
RHEL_KERNEL="yes"
RHEL_RELEASE=$(expr 0$(awk -F \" '/ RHEL_RELEASE / { print [$]2 }' \
- ${LINUX_OBJ}/include/linux/version.h) + 1)
+ ${LINUX_OBJ}/include/$VERSION_HDIR/version.h) + 1)
KERNEL_VERSION=$(sed -e 's/\(@<:@23@:>@\.@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/' <<< ${LINUXRELEASE})
RHEL_KERNEL_VERSION=${KERNEL_VERSION}-${RHEL_RELEASE}
AC_SUBST(RHEL_KERNEL_VERSION)
# need to produce special section for debuginfo extraction
LDFLAGS="${LDFLAGS} -Wl,--build-id"
EXTRA_KLDFLAGS="${EXTRA_KLDFLAGS} -Wl,--build-id"
- if test x$enable_server = xyes ; then
+ if test x$enable_server != xno ; then
AC_MSG_WARN([Disabling server (not supported for x86_64-$host_vendor-linux).])
enable_server='no'
fi
AC_SUBST(ZFS_LIBZFS_INCLUDE)
])
-AC_DEFUN([LB_PATH_ZFS], [
+AC_DEFUN([LB_CONFIG_ZFS], [
AC_ARG_WITH([zfs],
[AS_HELP_STRING([--with-zfs=PATH], [Path to zfs source])],
[
zfssrc="$withval"
])
], [
- AS_IF([test x$enable_server = xyes &&
- test x$enable_dist = xno], [
+ AS_IF([test x$enable_server != xno], [
require_zfs=no
enable_zfs=yes
], [
;;
solaris*)
lb_target_os="SunOS"
- ;;esac
+ ;;
+esac
AC_SUBST(lb_target_os)
])
ver=${ver//_/.}
fi
- # only do this test for lustre (not ldiskfs)
- if test "$PACKAGE" = "lustre" -a "$ver" != "$VERSION"; then
+ if test "$ver" != "$VERSION"; then
AC_MSG_WARN([most recent tag found: $ver does not match current version $VERSION.])
fi
AC_SUBST(LUSTREIOKIT_SUBDIR)
# We have to configure even if we don't build here for make dist to work
AC_CONFIG_SUBDIRS(lustre-iokit)
+AM_CONDITIONAL(BUILD_LUSTREIOKIT, [test "x$with_lustre_iokit" != xno])
])
# Define no libcfs by default.
AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
AM_CONDITIONAL(ARCH_x86, test x$target_cpu = "xx86_64" -o x$target_cpu = "xi686")
AM_CONDITIONAL(ARCH_MIC, test x$target_cpu = "xx86_64" -a x$target_vendor = "xk1om")
+AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])
+
# Sanity check for PCLMULQDQ instruction availability
# PCLMULQDQ instruction is a new instruction available beginning with
contrib/Makefile
contrib/lbuild/Makefile
contrib/scripts/Makefile
+ ldiskfs/Makefile
+ ldiskfs/autoMakefile
)
])
#
+# LB_CONFIG_SERVERS
+#
+AC_DEFUN([LB_CONFIG_SERVERS],
+[
+AC_ARG_ENABLE([server],
+ AC_HELP_STRING([--disable-server],
+ [disable Lustre server support]),
+ [AS_IF([test x$enable_server != xyes -a x$enable_server != xno],
+ [AC_MSG_ERROR([server valid options are "yes" or "no"])])
+ AS_IF([test x$enable_server = xyes -a x$enable_dist = xyes],
+ [AC_MSG_ERROR([--enable-server cannot be used with --enable-dist])])
+ ],
+ [AS_IF([test x$enable_dist = xyes],
+ [enable_server=no],
+ [enable_server=maybe])
+ ]
+)
+
+# There are at least two good reasons why we should really run
+# LB_CONFIG_MODULES elsewhere before the call to LB_CONFIG_SERVERS:
+# LB_CONFIG_MODULES needs to be run for client support even when
+# servers are disabled, and because module support is actually a
+# prerequisite of server support. However, some things under
+# LB_CONFIG_MODULES need us to already have checked for --disable-server,
+# before running, so until LB_CONFIG_MODULES can be reorganized, we
+# call it here.
+LB_CONFIG_MODULES
+AS_IF([test x$enable_modules = xno],[enable_server=no])
+LB_CONFIG_LDISKFS
+LB_CONFIG_ZFS
+
+# If no backends were configured, and the user did not explicitly
+# require servers to be enabled, we just disable servers.
+AS_IF([test x$enable_ldiskfs = xno -a x$enable_zfs = xno],
+ [AS_CASE([$enable_server],
+ [maybe], [enable_server=no],
+ [yes], [AC_MSG_ERROR([cannot enable servers, no backends were configured])])
+ ],
+ [AS_IF([test x$enable_server = xmaybe], [enable_server=yes])]
+)
+
+AC_MSG_CHECKING([whether to build Lustre server support])
+AC_MSG_RESULT([$enable_server])
+AS_IF([test x$enable_server = xyes],
+ [AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])]
+)
+])
+
+#
# LB_CONFIGURE
#
# main configure steps
LB_CONFIG_DOCS
LB_CONFIG_UTILS
LB_CONFIG_TESTS
-LC_CONFIG_CLIENT_SERVER
+LC_CONFIG_CLIENT
+LB_CONFIG_SERVERS
# two macros for cmd3
m4_ifdef([LC_CONFIG_SPLIT], [LC_CONFIG_SPLIT])
LN_CONFIG_CDEBUG
LC_QUOTA
-LB_CONFIG_MODULES
LN_CONFIG_USERSPACE
LB_PATH_LIBSYSIO
LB_PATH_SNMP
-LB_PATH_LDISKFS
-LB_PATH_ZFS
LB_PATH_LUSTREIOKIT
LB_DEFINE_E2FSPROGS_NAMES
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
-# Overridden by --without-ldiskfs/--with-zfs configure options
-AM_CONDITIONAL(LDISKFS_ENABLED, true)
-AM_CONDITIONAL(ZFS_ENABLED, false)
-
LB_CHECK_VERSION
LC_CONFIG_SRCDIR
# what does this do exactly? does it imply no kernel build?
NORPM=false
IOKITRPM=true
-LDISKFSRPM=true
OSDLDISKFSRPM=true
OSDZFSRPM=false
SMPTYPES="smp bigsmp default ''"
tarball.
--ldiskfs
- Do ldiskfs RPM. Now true by default
+ Build with ldiskfs support. (Deprecated, always true)
--noiokit
Do not build lustre-iokit RPM. Now true by default
fi
fi
- ( $(skeep_ldiskfs_rpm) ) || {
-
- pushd ldiskfs > /dev/null || return 255
-
- if ! ./configure --enable-dist; then
- echo "failed to configure in ldiskfs"
- popd >/dev/null # pushd ldiskfs
- popd >/dev/null # pushd lustre
- return 255
- fi
-
- if ! make dist 2>&1; then
- popd >/dev/null # pushd ldiskfs
- popd >/dev/null # pushd lustre
- return 255
- fi
-
- #cp lustre-ldiskfs*.tar.gz $TOPDIR/SOURCES || \
- # fatal 1 "Could not copy lustre-ldiskfs*.tar.gz to $TOPDIR/SOURCES"
-
- if ! $RPMBUILD $targets $rpmbuildopt lustre-ldiskfs*.tar.gz \
- --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \
- --define "kdir $linux" \
- ${linuxobj:+--define "kobjdir $linuxobj"} \
- --define "_tmppath /var/tmp" \
- --define "_topdir $TOPDIR" 2>&1; then
- popd >/dev/null # pushd ldiskfs
- popd >/dev/null # pushd lustre
- return 255
- fi
-
- if $DO_SRC; then
- if ! $RPMBUILD -ts lustre-ldiskfs*.tar.gz \
- --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \
- --define "kdir $linux" \
- ${linuxobj:+--define "kobjdir $linuxobj"} \
- --define "_tmppath /var/tmp" \
- --define "_topdir $TOPDIR" 2>&1; then
- popd >/dev/null # pushd ldiskfs
- popd >/dev/null # pushd lustre
- return 255
- fi
- fi
- popd >/dev/null # pushd ldiskfs
-
- # tell lustre where ldiskfs is
- # XXX - pointing to the RPM BUILD dir is a hack. we need to flesh
- # out the ldiskfs RPM build so that it builds a
- # lustre-ldiskfs-devel RPM and install that and point lustre
- # to that instead
- confoptions="$confoptions --with-ldiskfs=$(ls -d $TOPDIR/BUILD/lustre-ldiskfs-*)"
- }
-
if $IOKITRPM; then
if ! build_iokit $rpmbuildopt; then
echo "failed to build lustre-iokit"
}
-#check if we need to build separate ldiskfs RPM
-skeep_ldiskfs_rpm() {
- local skip=false
-
- if ! $LDISKFSRPM; then
- skip=true
- elif $PATCHLESS; then
- skip=true
- fi
-
- echo $skip
-
-}
-
set_rpm_smp_type() {
local infact_arch="${TARGET_ARCH}"
shift
;;
--ldiskfs)
- LDISKFSRPM=true
+ echo "WARNING: \"--ldiskfs\" is deprecated" > 2
shift
;;
--noiokit)
--disable-utils \
--disable-liblustre \
--disable-snmp \
- --enable-ldiskfs \
--disable-zerocopy \
--disable-tests \
--enable-quota
-kdist_configure: kdist_config
+kdist_configure: kdist_config
# the binary-modules rule is invoked by module-assistant while processing the
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
-/Makefile.in
-/aclocal.m4
-/autom4te.cache
-/config.h
-/config.h.in
-/lustre-ldiskfs-*.tar.gz
-/lustre-ldiskfs.spec
-/mkinstalldirs
-/module.order
+/linux-stage
+/linux
/modules.order
/Module.symvers
-/Module.markers
-/Modules.symvers
-/Rules
-/stamp-h1
+/stamp-h2
+/*.c
+/*.h
+/sources
+/trace
+++ /dev/null
-
- NOTE! This copyright does *not* cover user programs that use kernel
- services by normal system calls - this is merely considered normal use
- of the kernel, and does *not* fall under the heading of "derived work".
- Also note that the GPL below is copyrighted by the Free Software
- Foundation, but the instance of code that it refers to (the Linux
- kernel) is copyrighted by me and others who actually wrote it.
-
- Linus Torvalds
-
-----------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-\f
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-\f
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+++ /dev/null
-TBD Oracle, Inc.
- * version 3.3.0
-
-Severity : enhancement
-Bugzilla : 17670
-Description: FID_in_Dirent feature for OSD.
-Details : Support for storing the FID in the directory entry has
- been added to ext3 and ext4.
-
--------------------------------------------------------------------------------
-
-2010-07-15 Oracle, Inc.
- * version 3.2.0
-
-Severity : enhancement
-Bugzilla : 17670
-Description: FID_in_Dirent feature for OSD.
-Details : Support for storing the FID in the directory entry has
- been added to ext3 and ext4.
-
--------------------------------------------------------------------------------
-
-2009-11-05 Sun Microsystems, Inc.
- * version 3.1.0
-
-Severity : normal
-Frequency : in recovery
-Bugzilla : 21031
-Description: ext3-corrupted-orphans-2.6.patch added.
-Details : Backport of ext3 patch to handle corrupted orphans.
-
--------------------------------------------------------------------------------
-
-2009-07-31 Sun Microsystems, Inc.
- * version 3.0.9
-
-Severity : minor
-Frequency : in recovery
-Bugzilla : 18192
-Description: don't mix llog inodes with normal.
-Details : allocate inodes for log in last inode group
-
--------------------------------------------------------------------------------
-
-2009-04-20 Sun Microsystems, Inc.
- * version 3.0.8
-
-Severity : minor
-Bugzilla : 16114
-Description: minor fixes and cleanups
-Details : use EXT_UNSET_BLOCK to avoid confusion with EXT_MAX_BLOCK.
- Initialize 'ix' variable in extents patch to stop compiler warning.
-
-Severity : feature
-Bugzilla : 17942
-Description: update FIEMAP ioctl to match upstream kernel version
-Details : the FIEMAP block-mapping ioctl had a prototype version in
- ldiskfs 3.0.7 but this release updates it to match the
- interface in the upstream kernel, with a new ioctl number.
-
-Severity : normal
-Frequency : only if MMP is active and detects filesystem is in use
-Bugzilla : 18173
-Description: if MMP startup fails, an oops is triggered
-Details : if ldiskfs mounting doesn't succeed the error handling doesn't
- clean up the MMP data correctly, causing an oops.
-
--------------------------------------------------------------------------------
-
-2009-04-06 Sun Microsystems, Inc.
- * version 3.0.7.1
-
-Severity : major
-Frequency : rare
-Bugzilla : 18810
-Description: fix racy locking of mballoc block bitmaps causing BUG
-Details : The locking of the mballoc buddy bitmap and the in-memory
- block bitmap was using two different spin locks in some
- cases. This made it possible to incorrectly access the
- mballoc bitmap while another process was modifying it,
- causing a sanity assertion to fail. While no on-disk corruption
- was reported, there was some risk of this happening.
-
--------------------------------------------------------------------------------
-
-2009-02-07 Sun Microsystems, Inc.
- * version 3.0.7
-
-Severity : enhancement
-Bugzilla : 16498
-Description: Get RAID stripe size from superblock
-Details : RAID striping parameters are now saved in the superblock itself,
- so we should use these parameters instead of having to specify
- a mount option each time.
-
-Severity : major
-Frequency : only if server is running on unsupported big-endian machine
-Bugzilla : 16438
-Description: Disable big-endian ldiskfs server support.
-Details : The ldiskfs code is not tested on big-endian machines, and
- there are known compatibility problems in the extents code
- when running for most of the kernels. Print an error message
- and refuse to mount, in case anyone tests this. For existing
- filesystems that might have been created in this way it is
- possible to mount with the "bigendian_extents" option to
- force the mount.
-
-Severity : major
-Frequency : only with software RAID-5
-Bugzilla : 17895
-Description: MMP block reads may fail to detect another user of the filesystem
-Details : with software RAID it is possible that the RAID driver will
- cache the MMP block and not refetch it from disk. Force the
- read to invalidate the RAID page cache and go directly to disk.
-
--------------------------------------------------------------------------------
-
-2008-08-31 Sun Microsystems, Inc.
- * version 3.0.6
-
-Severity : enhancement
-Bugzilla : 11826
-Description: Interoperability at server side (Disk interoperability)
-Details : Exported some ldiskfs functions which are required for iop
-
-Severity : normal
-Bugzilla : 15320
-Description: OSS crashes frequently, e2fsck does not fix
-Details : Add an extra check to ldiskfs extents code for the condition,
- eh_entries = 0 & eh_depth != 0
-
-Severity : normal
-Bugzilla : 15459
-Description: migrate ldiskfs - ldiskfs2 (extents on directories)
-Details : disable preallocation for non-regular files.
-
-Severity : normal
-Frequency : blocks per group < blocksize*8 and uninit_groups is enabled
-Bugzilla : 15932
-Description: ldiskfs error: XXX blocks in bitmap, YYY in gd
-Details : If blocks per group is less than blocksize*8, set rest of the
- bitmap to 1.
-
-Severity : normal
-Frequency : only for filesystems larger than 8TB
-Bugzilla : 16101
-Description: ldiskfs BUG ldiskfs_mb_use_best_found()
-Details : The ldiskfs mballoc3 code was using a __u16 to store the group
- number, but with 8TB+ filesystems there are more than 65536
- groups, causing an oops.
-
-Severity : enhancement
-Bugzilla : 10555
-Description: Add a FIEMAP(FIle Extent MAP) ioctl for ldiskfs
-Details : FIEMAP ioctl will allow an application to efficiently fetch the
- extent information of a file. It can be used to map logical blocks
- in a file to physical blocks in the block device.
-
-Severity : normal
-Bugzilla : 17490
-Description: mkfs.lustre: Unable to mount /dev/cciss/c0d1:Cannot allocate memory
-Details : correctly handle device paths using a subdirectory in /dev when
- creating the per-device procfs directory under /proc/fs/ldiskfs.
-
--------------------------------------------------------------------------------
-
-2008-04-26 Sun Microsystems, Inc.
- * version 3.0.5
-
-Severity : normal
-Bugzilla : 14493
-Description: Kernel BUG at ... ldiskfs/ldiskfs/mballoc.c:3853
-Details : Removing the underlying device (e.g. via a SCSI rescan) can cause a
- kernel BUG in ldiskfs_mb_discard_inode_preallocations().
-
-Severity : major
-Bugzilla : 14596
-Description: deadlock in ext3_expand_extra_isize
-Details : Inode expansion during ext3_mark_inode_dirty may lead to deadlock.
- This is solved by making sure that ext3_expand_extra_isize isn't
- called from ext3_xattr_set_handle.
-
-Severity : normal
-Bugzilla : 14594
-Description: soft lockups on 1.6.2 MDS (is_subdir)
-Details : don't add dentries with ".." to dcache and ignore such dentries in
- iopen_lookup().
-
-Severity : critical
-Frequency : very rare, if additional xattrs are used on kernels >= 2.6.12
-Bugzilla : 15777
-Description: files may lose file attributes in some cases
-Details : If there are multiple extended attributes stored on the inode,
- in particular ACLs, SELinux, or user attributes (if user_xattr
- is specified for the client mount options) then there is a risk
- of attribute loss. If an additional attribute is be stored
- initially in the inode and then increase in size enough to be
- moved to the external attribute block (e.g. ACL growing in size)
- for the attribute to be lost.
-
-Severity : normal
-Bugzilla : 15604
-Description: inode version not being initialized on new inodes
-Details : The inode i_version field was not being initialized on disk.
- This field is currently unused but will be needed for VBR.
-
---------------------------------------------------------------------------------
-
-2008-01-11 Sun Microsystems, Inc.
- * version 3.0.4
-
-Severity : normal
-Bugzilla : 13397
-Description: Add support for vanilla-2.6.22 kernel.
-
---------------------------------------------------------------------------------
-
-2007-12-07 Cluster File Systems, Inc. <info@clusterfs.com>
- * version 3.0.3
-
-Severity : normal
-Bugzilla : 13164
-Description: statfs speedup patches.
-Details : The patches improve statfs performance for very large
- filesystems.
-
-Severity : normal
-Frequency : if the uninit_groups feature is enabled on ldiskfs
-Bugzilla : 13706
-Description: e2fsck reports "invalid unused inodes count"
-Details : If a new ldiskfs filesystem is created with the "uninit_groups"
- feature and only a single inode is created in a group then the
- "bg_unused_inodes" count is incorrectly updated. Creating a
- second inode in that group would update it correctly.
-
---------------------------------------------------------------------------------
-
-2007-09-27 Cluster File Systems, Inc. <info@clusterfs.com>
- * version 3.0.2
-
-Severity : enhancement
-Bugzilla : 10555
-Description: Add a FIEMAP(FIle Extent MAP) ioctl for ldiskfs
-Details : FIEMAP ioctl will allow an application to efficiently fetch the
- extent information of a file. It can be used to map logical blocks
- in a file to physical blocks in the block device.
-
---------------------------------------------------------------------------------
-
-2007-08-29 Cluster File Systems, Inc. <info@clusterfs.com>
- * version 3.0.1
-
-Severity : major
-Frequency : rare
-Bugzilla : 6334
-Description: Multiple mount protection(MMP) support.
-Details : This feature will protect the filesystem from being mounted more
- than once simultaneously. It will also protect changes by e2fsprogs
- to the filesystem if it is mounted. This assumes high importance
- in a shared storage environment where multiple mounts can severely
- corrupt the filesystem.
-
---------------------------------------------------------------------------------
-
-2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com>
- * version 3.0.0
- * Initial release of ldiskfs as a separate package.
-
-Severity : normal
-Frequency : rare
-Bugzilla : 12415
-Description: Updated patchess for new RHEL4 kernel
-Details : Add patch ext3-unlink-race.patch
- Updated series file ldiskfs-2.6-rhel4.series
-
+++ /dev/null
-AUTOMAKE_OPTIONS = foreign
-SUBDIRS = ldiskfs
-EXTRA_DIST = @PACKAGE_TARNAME@.spec
-EXTRA_DIST += kernel_patches
-EXTRA_DIST += config
-
-dist-hook:
- find $(distdir) -name .deps -o \
- -name .git -o \
- -name .#* | xargs rm -rf
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- module-dist-hook
-
-rpms: @PACKAGE_TARNAME@.spec dist Makefile
- CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
- sed -re 's/--(en|dis)able-tests//'); \
- if [ -n "@LINUX@" ]; then \
- CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
- sed -re 's/--with-linux=[^ ][^ ]*//'); \
- RPMARGS="--define \"kdir @LINUX@\""; \
- CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
- sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
- if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
- RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
- fi; \
- fi; \
- CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
- sed -re 's/--with-release=[^ ][^ ]*//'); \
- RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
- echo "Building ldiskfs RPM with $$RPMARGS"; \
- eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
-
-srpm: @PACKAGE_TARNAME@.spec dist Makefile
- eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
-
-# this only needs to be done if disting stand-alone (i.e. not as a
-# subdir of lustre
-module-dist-hook:
- if ! grep "AC_INIT(\[Lustre\], \[LUSTRE_VERSION\], \[http:\/\/bugs\.whamcloud\.com\/], \[lustre\])" ../configure.ac; then \
- if [ -f META ]; then \
- cp META $(distdir)/META; \
- fi; \
- fi
--- /dev/null
+default: all
+
+MODULES := ldiskfs
+
+# copy makefile over to not break patches
+backfs_extra := $(wildcard @LINUX@/fs/ext4/Makefile)
+
+backfs_headers := $(wildcard @EXT4_SRC_DIR@/*.h)
+linux_headers := $(wildcard @LINUX@/include/linux/ext4*.h)
+linux_new_headers := dynlocks.h
+linux_new_headers += htree_lock.h
+trace_headers := $(wildcard @LINUX@/include/trace/events/ext4*.h)
+
+backfs_sources := $(filter-out %.mod.c,$(wildcard @EXT4_SRC_DIR@/*.c))
+
+ext3_new_sources := extents.c mballoc.c group.h dynlocks.c fiemap.h
+ext3_new_headers := ext3_extents.h
+
+ext4_new_sources := dynlocks.c fiemap.h mmp.c
+ext4_new_sources += htree_lock.c
+ext4_new_headers :=
+
+new_sources := $(ext4_new_sources)
+new_headers := $(ext4_new_headers)
+
+ldiskfs_patched_sources := $(notdir $(backfs_sources) $(backfs_headers)) $(new_sources) $(new_headers)
+ldiskfs_sources := $(ldiskfs_patched_sources)
+
+ldiskfs-objs := $(filter %.o,$(ldiskfs_sources:.c=.o))
+
+EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@abs_top_srcdir@/ldiskfs
+
+@INCLUDE_RULES@
--- /dev/null
+EXTRA_DIST = kernel_patches
+
+if MODULES
+if LDISKFS_ENABLED
+all-local: sources
+
+modulefs_DATA = ldiskfs$(KMODEXT)
+
+ldiskfs$(KMODEXT): sources
+endif
+endif
+
+ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,ldiskfs,$(notdir $(linux_headers))))
+
+$(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
+
+ldiskfs_sed_flags = \
+ -e "s/dx_hash_info/ext4_dx_hash_info/g" \
+ -e "s/DX_HASH/EXT4_DX_HASH/g" \
+ -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g"
+
+%.c: linux-stage/fs/ext4/%.c
+ sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+%.h: linux-stage/fs/ext4/%.h
+ sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h
+ sed $(strip $(ldiskfs_sed_flags)) $< > $@
+
+series := @top_srcdir@/ldiskfs/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
+patches := @top_srcdir@/ldiskfs/kernel_patches/patches
+
+sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers)
+ rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES)
+ mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \
+ linux-stage/include/trace/events
+ cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4
+ if test -n "$(linux_headers)" ; then \
+ cp $(linux_headers) linux-stage/include/linux; \
+ fi
+ if test -n "$(trace_headers)" ; then \
+ cp $(trace_headers) linux-stage/include/trace/events; \
+ fi
+if USE_QUILT
+ ln -s ../$(patches) linux-stage/patches
+ ln -s ../$(series) linux-stage/series
+ cd linux-stage && quilt push -a -q
+else
+ @echo -n "Applying ext4 patches:"
+ @cd linux-stage && for i in $$(<../$(series)) ; do \
+ echo -n " $$i" ; \
+ patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
+ done
+ @echo
+endif
+ mkdir -p linux trace/events
+ @echo -n "Replacing 'ext4' with 'ldiskfs':"
+ for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \
+ echo -n " $$i" ; \
+ sed $(strip $(ldiskfs_sed_flags)) \
+ linux-stage/fs/ext4/$$i > $$i ; \
+ done
+ for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \
+ if test -f "ext4$$i" ; then \
+ echo -n " ext4$$i" ; \
+ mv ext4$$i ldiskfs$$i ; \
+ fi ; \
+ done
+ for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \
+ echo -n " ext4$$i" ; \
+ sed $(strip $(ldiskfs_sed_flags)) \
+ linux-stage/include/linux/ext4$$i \
+ > linux/ldiskfs$$i ; \
+ done
+ for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \
+ echo -n " ext4$$i"; \
+ sed $(strip $(ldiskfs_sed_flags)) \
+ linux-stage/include/trace/events/ext4$$i \
+ > trace/events/ldiskfs$$i ; \
+ done
+ for i in $(notdir $(linux_new_headers)) ; do \
+ echo -n " $$i"; \
+ sed $(strip $(ldiskfs_sed_flags)) \
+ linux-stage/include/linux/$$i \
+ > linux/$$i ; \
+ done
+
+ @echo
+ touch sources
+
+foo-check:
+ @echo "ldiskfs_sources: $(ldiskfs_sources)"
+ @echo "ldiskfs_SOURCES: $(ldiskfs_SOURCES)"
+ @echo "ldiskfs_headers: $(ldiskfs_headers)"
+ @echo "ldiskfs_objects: $(ldiskfs_objects)"
+ @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
+ @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
+
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
+CLEANFILES = sources $(notdir $(linux_new_headers) $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers) $(trace_headers))
+
+clean-local:
+ rm -rf linux linux-stage ldiskfs*.h trace modules.order
+++ /dev/null
-#!/bin/sh
-
-# NOTE: Please avoid bashisms (bash specific syntax) in this script
-
-# enable execution tracing
-set -x
-
-error()
-{
- rc=$?
- echo "$1 failed (rc=$rc). Aborting."
- exit 1
-}
-
-aclocal -I $PWD/config || error "aclocal"
-autoheader || error "autoheader"
-automake -a -c -W no-portability || error "automake"
-autoconf || error "autoconf"
+++ /dev/null
-/config.guess
-/config.sub
-/install-sh
-/missing
+++ /dev/null
-AC_DEFUN([LDISKFS_AC_LINUX_VERSION], [
- AC_MSG_CHECKING([kernel source version])
-
- utsrelease1=${LINUX_OBJ}/include/generated/utsrelease.h
- utsrelease2=${LINUX_OBJ}/include/linux/utsrelease.h
- utsrelease3=${LINUX_OBJ}/include/linux/version.h
- AS_IF([test -r ${utsrelease1} && fgrep -q UTS_RELEASE ${utsrelease1}], [
- utsrelease=${utsrelease1}
- ], [test -r ${utsrelease2} && fgrep -q UTS_RELEASE ${utsrelease2}], [
- utsrelease=${utsrelease2}
- ], [test -r ${utsrelease3} && fgrep -q UTS_RELEASE ${utsrelease3}], [
- utsrelease=${utsrelease3}
- ])
-
- AS_IF([test ! -z "${utsrelease}"], [
- UTS_RELEASE=$(awk -F \" '/ UTS_RELEASE / { print [$]2 }' \
- ${utsrelease})
- AS_IF([test -z "$UTS_RELEASE"], [
- AC_MSG_RESULT([Not found])
- AC_MSG_ERROR([*** Cannot determine kernel version.])
- ])
- ], [
- AC_MSG_RESULT([Not found])
- AC_MSG_ERROR([
- *** Cannot find UTS_RELEASE definition.
- *** This is often provided by the kernel-devel package.])
- ])
-
- AC_MSG_RESULT([${UTS_RELEASE}])
-
- LINUX_VERSION=${UTS_RELEASE}
- AC_SUBST(LINUX_VERSION)
- LINUXRELEASE=${UTS_RELEASE}
- AC_SUBST(LINUXRELEASE)
-])
-
-#
-# LB_LINUX_RELEASE
-#
-# get the release version of linux
-#
-
-AC_DEFUN([LB_LINUX_RELEASE],
-[
-LDISKFS_AC_LINUX_VERSION
-
-# ------------ RELEASE --------------------------------
-AC_MSG_CHECKING([for ldiskfs release])
-AC_ARG_WITH([release],
- AC_HELP_STRING([--with-release=string],
- [set the release string (default=$kvers_YYYYMMDDhhmm)]),
- [RELEASE=$withval],
- RELEASE=""
- if test -n "$DOWNSTREAM_RELEASE"; then
- RELEASE="${DOWNSTREAM_RELEASE}_"
- fi
- RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID")
-AC_MSG_RESULT($RELEASE)
-AC_SUBST(RELEASE)
-
-# check is redhat/suse kernels
-AC_MSG_CHECKING([for RedHat kernel version])
- AS_IF([fgrep -q RHEL_RELEASE ${LINUX_OBJ}/include/$VERSION_HDIR/version.h], [
- RHEL_KERNEL="yes"
- RHEL_RELEASE=$(expr 0$(awk -F \" '/ RHEL_RELEASE / { print [$]2 }' \
- ${LINUX_OBJ}/include/$VERSION_HDIR/version.h) + 1)
- KERNEL_VERSION=$(sed -e 's/\(@<:@23@:>@\.@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/' <<< ${LINUXRELEASE})
- RHEL_KERNEL_VERSION=${KERNEL_VERSION}-${RHEL_RELEASE}
- AC_SUBST(RHEL_KERNEL_VERSION)
- AC_MSG_RESULT([${RHEL_KERNEL_VERSION}])
- ], [
- AC_MSG_RESULT([not found])
- LB_LINUX_CONFIG([SUSE_KERNEL],[SUSE_KERNEL="yes"],[])
- ])
-])
-
-# LB_ARG_REPLACE_PATH(PACKAGE, PATH)
-AC_DEFUN([LB_ARG_REPLACE_PATH],[
- new_configure_args=
- eval "set x $ac_configure_args"
- shift
- for arg; do
- case $arg in
- --with-[$1]=*)
- arg=--with-[$1]=[$2]
- ;;
- *\'*)
- arg=$(printf %s\n ["$arg"] | \
- sed "s/'/'\\\\\\\\''/g")
- ;;
- esac
- dnl AS_VAR_APPEND([new_configure_args], [" '$arg'"])
- new_configure_args="$new_configure_args \"$arg\""
- done
- ac_configure_args=$new_configure_args
-])
-
-# this is the work-horse of the next function
-AC_DEFUN([__LB_ARG_CANON_PATH], [
- [$3]=$(readlink -f $with_$2)
- LB_ARG_REPLACE_PATH([$1], $[$3])
-])
-
-# a front-end for the above function that transforms - and . in the
-# PACKAGE portion of --with-PACKAGE into _ suitable for variable names
-AC_DEFUN([LB_ARG_CANON_PATH], [
- __LB_ARG_CANON_PATH([$1], m4_translit([$1], [-.], [__]), [$2])
-])
-
-#
-#
-# LB_LINUX_PATH
-#
-# Find paths for linux, handling kernel-source rpms
-#
-AC_DEFUN([LB_LINUX_PATH],
-[# prep some default values
-for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
- if readlink -q -e $DEFAULT_LINUX; then
- break
- fi
-done
-if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
- PATHS="/lib/modules/$(uname -r)/build"
-fi
-PATHS+=" $DEFAULT_LINUX"
-for DEFAULT_LINUX_OBJ in $PATHS; do
- if readlink -q -e $DEFAULT_LINUX_OBJ; then
- break
- fi
-done
-AC_MSG_CHECKING([for Linux sources])
-AC_ARG_WITH([linux],
- AC_HELP_STRING([--with-linux=path],
- [set path to Linux source (default=/lib/modules/$(uname -r)/{source,build},/usr/src/linux)]),
- [LB_ARG_CANON_PATH([linux], [LINUX])
- DEFAULT_LINUX_OBJ=$LINUX],
- [LINUX=$DEFAULT_LINUX])
-AC_MSG_RESULT([$LINUX])
-AC_SUBST(LINUX)
-
-# -------- check for linux --------
-LB_CHECK_FILE([$LINUX],[],
- [AC_MSG_ERROR([Kernel source $LINUX could not be found.])])
-
-# -------- linux objects (for 2.6) --
-AC_MSG_CHECKING([for Linux objects dir])
-AC_ARG_WITH([linux-obj],
- AC_HELP_STRING([--with-linux-obj=path],
- [set path to Linux objects dir (default=/lib/modules/$(uname -r)/build,/usr/src/linux)]),
- [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])],
- [LINUX_OBJ=$DEFAULT_LINUX_OBJ])
-
-AC_MSG_RESULT([$LINUX_OBJ])
-AC_SUBST(LINUX_OBJ)
-
-# -------- check for .config --------
-AC_ARG_WITH([linux-config],
- [AC_HELP_STRING([--with-linux-config=path],
- [set path to Linux .conf (default=$LINUX_OBJ/.config)])],
- [LB_ARG_CANON_PATH([linux-config], [LINUX_CONFIG])],
- [LINUX_CONFIG=$LINUX_OBJ/.config])
-AC_SUBST(LINUX_CONFIG)
-
-LB_CHECK_FILE([/boot/kernel.h],
- [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
- [LB_CHECK_FILE([/var/adm/running-kernel.h],
- [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h'])])
-
-AC_ARG_WITH([kernel-source-header],
- AC_HELP_STRING([--with-kernel-source-header=path],
- [Use a different kernel version header. Consult build/README.kernel-source for details.]),
- [LB_ARG_CANON_PATH([kernel-source-header], [KERNEL_SOURCE_HEADER])])
-
-# ------------ .config exists ----------------
-LB_CHECK_FILE([$LINUX_CONFIG],[],
- [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult build/README.kernel-source])])
-
-# ----------- make dep run? ------------------
-# at 2.6.19 # $LINUX/include/linux/config.h is removed
-# and at more old has only one line
-# include <autoconf.h>
-LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated],
- [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
- [AC_MSG_ERROR([Run make config in $LINUX.])])])
- AC_SUBST(AUTOCONF_HDIR)
-LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h], [VERSION_HDIR=linux],
- [LB_CHECK_FILE([$LINUX_OBJ/include/generated/uapi/linux/version.h],
- [VERSION_HDIR=generated/uapi/linux],
- [AC_MSG_ERROR([Run make config in $LINUX.])])
- ])
- AC_SUBST(VERSION_HDIR)
-
-
-
-# ----------- kconfig.h exists ---------------
-# kernel 3.1, $LINUX/include/linux/kconfig.h is added
-# see kernel commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
-LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h],
- [CONFIG_INCLUDE=include/linux/kconfig.h],
- [CONFIG_INCLUDE=include/$AUTOCONF_HDIR/autoconf.h])
- AC_SUBST(CONFIG_INCLUDE)
-
-# ------------ rhconfig.h includes runtime-generated bits --
-# red hat kernel-source checks
-
-# we know this exists after the check above. if the user
-# tarred up the tree and ran make dep etc. in it, then
-# version.h gets overwritten with a standard linux one.
-
-if grep rhconfig $LINUX_OBJ/include/$VERSION_HDIR/version.h >/dev/null ; then
- # This is a clean kernel-source tree, we need to
- # enable extensive workarounds to get this to build
- # modules
- LB_CHECK_FILE([$KERNEL_SOURCE_HEADER],
- [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
- AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
- AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
- AC_MSG_WARN([Consult build/README.kernel-source for details.])
- fi],
- [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult build/README.kernel-source for details.])])
- EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
-fi
-
-# --- check that we can build modules at all
-AC_MSG_CHECKING([that modules can be built at all])
-LB_LINUX_TRY_COMPILE([],[],[
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
- AC_MSG_WARN([Consult config.log for details.])
- AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
- AC_MSG_ERROR([Kernel modules cannot be built.])
-])
-
-LB_LINUX_RELEASE
-]) # end of LB_LINUX_PATH
-
-# LB_LINUX_SYMVERFILE
-# SLES 9 uses a different name for this file - unsure about vanilla kernels
-# around this version, but it matters for servers only.
-AC_DEFUN([LB_LINUX_SYMVERFILE],
- [AC_MSG_CHECKING([name of module symbol version file])
- if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
- SYMVERFILE=Modules.symvers
- else
- SYMVERFILE=Module.symvers
- fi
- AC_MSG_RESULT($SYMVERFILE)
- AC_SUBST(SYMVERFILE)
-])
-
-# these are like AC_TRY_COMPILE, but try to build modules against the
-# kernel, inside the build directory
-
-# LB_LANG_PROGRAM(C)([PROLOGUE], [BODY])
-# --------------------------------------
-m4_define([LB_LANG_PROGRAM],
-[
-#include <linux/kernel.h>
-$1
-int
-main (void)
-{
-dnl Do *not* indent the following line: there may be CPP directives.
-dnl Don't move the `;' right after for the same reason.
-$2
- ;
- return 0;
-}])
-
-#
-# LB_LINUX_COMPILE_IFELSE
-#
-# like AC_COMPILE_IFELSE
-#
-AC_DEFUN([LB_LINUX_COMPILE_IFELSE], [
- m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])
- rm -Rf build-test && mkdir -p build-test
- echo "obj-m := conftest.o" >build-test/Makefile
- AS_IF(
- [AC_TRY_COMMAND(cp conftest.c build-test && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" M=$PWD/build-test) >/dev/null && AC_TRY_COMMAND([$3])],
- [$4],
- [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
- )
- rm -Rf build-test
-])
-
-
-#
-# LB_LINUX_TRY_COMPILE
-#
-# like AC_TRY_COMPILE
-#
-AC_DEFUN([LB_LINUX_TRY_COMPILE],
-[LB_LINUX_COMPILE_IFELSE(
- [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
- [modules],
- [test -s build-test/conftest.o],
- [$3], [$4])])
-
-#
-# LB_LINUX_CONFIG
-#
-# check if a given config option is defined
-#
-AC_DEFUN([LB_LINUX_CONFIG],[
- AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
- LB_LINUX_TRY_COMPILE([
- #include <$AUTOCONF_HDIR/autoconf.h>
- ],[
- #ifndef CONFIG_$1
- #error CONFIG_$1 not #defined
- #endif
- ],[
- AC_MSG_RESULT([yes])
- $2
- ],[
- AC_MSG_RESULT([no])
- $3
- ])
-])
-
-#
-# LB_LINUX_CONFIG_IM
-#
-# check if a given config option is builtin or as module
-#
-AC_DEFUN([LB_LINUX_CONFIG_IM],[
- AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
- LB_LINUX_TRY_COMPILE([
- #include <$AUTOCONF_HDIR/autoconf.h>
- ],[
- #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
- #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
- #endif
- ],[
- AC_MSG_RESULT([yes])
- $2
- ],[
- AC_MSG_RESULT([no])
- $3
- ])
-])
-
-#
-# LB_CHECK_SYMBOL_EXPORT
-# check symbol exported or not
-# $1 - symbol
-# $2 - file(s) for find.
-# $3 - do 'yes'
-# $4 - do 'no'
-#
-# 2.6 based kernels - put modversion info into $LINUX/Module.modvers
-# or check
-AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
-[AC_MSG_CHECKING([if Linux was built with symbol $1 exported])
-grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
-rc=$?
-if test $rc -ne 0; then
- export=0
- for file in $2; do
- grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null
- rc=$?
- if test $rc -eq 0; then
- export=1
- break;
- fi
- done
- if test $export -eq 0; then
- AC_MSG_RESULT([no])
- $4
- else
- AC_MSG_RESULT([yes])
- $3
- fi
-else
- AC_MSG_RESULT([yes])
- $3
-fi
-])
-
-#
-# Like AC_CHECK_HEADER but checks for a kernel-space header
-#
-m4_define([LB_CHECK_LINUX_HEADER],
-[AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
-AC_CACHE_CHECK([for $1], ac_Header,
- [LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
- [modules],
- [test -s build-test/conftest.o],
- [AS_VAR_SET(ac_Header, [yes])],
- [AS_VAR_SET(ac_Header, [no])])])
-AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl
-AS_VAR_POPDEF([ac_Header])dnl
-])
-#
-# LB_DOWNSTREAM_RELEASE
-#
-AC_DEFUN([LB_DOWNSTREAM_RELEASE],
-[AC_ARG_WITH([downstream-release],
- AC_HELP_STRING([--with-downstream-release=string],
- [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]),
- [DOWNSTREAM_RELEASE=$with_downstream_release],
- [
- # if not specified, see if it's in the META file
- if test -f META; then
- DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)
- fi
- ])
-AC_SUBST(DOWNSTREAM_RELEASE)
-])
-
-#
-# LB_BUILDID
-#
-# Check if the source is a GA release and if not, set a "BUILDID"
-#
-# Currently there are at least two ways/modes of/for doing this. One
-# is if we are in a valid git repository, the other is if we are in a
-# non-git source tree of some form. Building the latter from the former
-# will be handled here.
-AC_DEFUN([LB_BUILDID],
-[
-AC_MSG_CHECKING([for buildid])
-BUILDID=""
-if git branch >/dev/null 2>&1; then
- ffw=0
- hash=""
- ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags)
- if [[[ $ver = *-*-* ]]]; then
- hash=${ver##*-}
- ffw=${ver#*-}
- ffw=${ffw%-*}
- ver=${ver%%-*}
- fi
- # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]]
- # here but the portability of the regex on the right is dismal
- # (thanx suse)
- if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then
- ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \
- -e 's/_RC[[0-9]].*$//' -e 's/_/./g')
- fi
-
- # a "lustre fix" value of .0 should be truncated
- if [[[ $ver = *.*.*.0 ]]]; then
- ver=${ver%.0}
- fi
- # ditto for a "lustre fix" value of _0
- if [[[ $ver = v*_*_*_0 ]]]; then
- ver=${ver%_0}
- fi
- if [[[ $ver = v*_*_* ]]]; then
- ver=${ver#v}
- ver=${ver//_/.}
- fi
-
- if test "$ffw" != "0"; then
- BUILDID="$hash"
- msg="$BUILDID (ahead by $ffw commits)"
- AC_MSG_RESULT([$msg])
- else
- AC_MSG_RESULT([none... congratulations, you must be on a tag])
- fi
-elif test -f META; then
- BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
- msg="$BUILDID (from META file)"
- AC_MSG_RESULT([$msg])
-else
- AC_MSG_WARN([FIXME: I don't know how to deal with source trees outside of git that don't have a META file. Not setting a buildid.])
-fi
-AC_SUBST(BUILDID)
-])
-
-#
-# LB_CHECK_FILE
-#
-# Check for file existance even when cross compiling
-#
-AC_DEFUN([LB_CHECK_FILE],
-[AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
-AC_CACHE_CHECK([for $1], lb_File,
-[if test -r "$1"; then
- AS_VAR_SET(lb_File, yes)
-else
- AS_VAR_SET(lb_File, no)
-fi])
-AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
-AS_VAR_POPDEF([lb_File])dnl
-])# LB_CHECK_FILE
-
-#
-# LB_CONFIG_HEADERS
-#
-# add -include config.h
-#
-AC_DEFUN([LB_CONFIG_HEADERS],[
- 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)
-])
-
-#
-# LB_PROG_CC
-#
-# checks on the C compiler
-#
-AC_DEFUN([LB_PROG_CC],
-[AC_PROG_RANLIB
-
-# --------- unsigned long long sane? -------
-AC_CHECK_SIZEOF(unsigned long long, 0)
-echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
-echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
-if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
- AC_MSG_ERROR([** we assume that sizeof(long long) == 8.])
-fi
-
-if test $target_cpu == "powerpc64"; then
- AC_MSG_WARN([set compiler with -m64])
- CFLAGS="$CFLAGS -m64"
- CC="$CC -m64"
-fi
-
-LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
-AC_SUBST(LLCPPFLAGS)
-
-# Add _GNU_SOURCE for strnlen on linux
-LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
-AC_SUBST(LLCFLAGS)
-
-CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
-AC_SUBST(CCASFLAGS)
-])
-
-
-#
-# LB_LDISKFS_EXT_DIR
-#
-# Determine the location of the ext4 source code. It is 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/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/ext4/super.c"; then
- EXT_DIR=$linux_src/fs/ext4
- else
- EXT_DIR=
- fi
-fi
-
-AC_MSG_CHECKING([ext4 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 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
- 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
-
-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
-])
-
-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_SERIES],
-[
-LDISKFS_SERIES=
-AS_IF([$1], [
- AC_MSG_CHECKING([which ldiskfs series to use])
-
- SER=
- AS_IF([test x$RHEL_KERNEL = xyes], [
- AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32-343],[
- AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32],[],
- [SER="2.6-rhel6.series"],[SER="2.6-rhel6.series"])],
- [SER="2.6-rhel6.4.series"],[SER="2.6-rhel6.4.series"])
- ], [test x$SUSE_KERNEL = xyes], [
- AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
- AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
- [SER="2.6-sles11.series"],[SER="2.6-sles11.series"])],
- [SER="3.0-sles11.series"],[SER="3.0-sles11.series"])
- ])
- LDISKFS_SERIES=$SER
-
- AS_IF([test -z "$LDISKFS_SERIES"],
- [AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])])
- AC_MSG_RESULT([$LDISKFS_SERIES])
-])
-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])
-])
-])
-
-#
-# 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
-#
-AC_DEFUN([LB_EXT_PBLOCK],
-[AC_MSG_CHECKING([if kernel has ext_pblocks])
- LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include "$EXT_DIR/ext4_extents.h"
-],[
- ext_pblock(NULL);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_EXT_PBLOCK, 1,
- [kernel has ext_pblocks])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LDISKFS_AC_PATCH_PROGRAM
-#
-# Determine which program should be used to apply the patches to
-# the ext4 source code to produce the ldiskfs source code.
-#
-AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
- AC_ARG_ENABLE([quilt],
- [AC_HELP_STRING([--disable-quilt],
- [disable use of quilt for ldiskfs])],
- [AS_IF([test "x$enableval" = xno],
- [use_quilt=no],
- [use_quilt=maybe])],
- [use_quilt=maybe]
- )
-
- AS_IF([test x$use_quilt = xmaybe], [
- AC_PATH_PROG([quilt_avail], [quilt], [no])
- AS_IF([test x$quilt_avail = xno], [
- use_quilt=no
- ], [
- use_quilt=yes
- ])
- ])
-
- AS_IF([test x$use_quilt = xno], [
- AC_PATH_PROG([patch_avail], [patch], [no])
- AS_IF([test x$patch_avail = xno], [
- AC_MSG_ERROR([*** Need "quilt" or "patch" command])
- ])
- ])
-
- AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])
-])
+++ /dev/null
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.57])
-AC_INIT([Lustre ldiskfs], 4.1.0, [http://bugs.whamcloud.com/])
-AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
-
-# Don't look for install-sh, etc. in ..
-AC_CONFIG_AUX_DIR([config])
-
-AC_CONFIG_MACRO_DIR([config])
-
-AC_CANONICAL_SYSTEM
-
-AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability])
-AM_MAINTAINER_MODE([enable])
-
-AC_PROG_CC
-
-LB_DOWNSTREAM_RELEASE
-
-LB_BUILDID
-
-LB_PROG_CC
-
-AC_ARG_ENABLE([dist],
- AC_HELP_STRING([--enable-dist],
- [only configure enough for make dist]),
- [enable_dist='yes'],[enable_dist='no'])
-AC_MSG_RESULT([$enable_dist])
-if test x$enable_dist != xno; then
- enable_modules='no'
-fi
-
-AC_MSG_CHECKING([whether to build kernel modules])
-AC_ARG_ENABLE([modules],
- AC_HELP_STRING([--disable-modules],
- [disable building of Lustre kernel modules]),[],
- [enable_modules='yes'],
- [enable_modules='no'])
-AC_MSG_RESULT([$enable_modules])
-
-if test x$enable_modules = xyes ; then
- LB_LINUX_PATH
- LB_LINUX_SYMVERFILE
- LB_LINUX_CONFIG([MODULES],[],[
- AC_MSG_ERROR([module support is required to build ldiskfs kernel module.])
- ])
- LB_LINUX_CONFIG([MODVERSIONS])
- LB_LINUX_CONFIG([KALLSYMS],[],[
- AC_MSG_ERROR([ldiskfs requires that CONFIG_KALLSYMS is enabled in your kernel.])
- ])
-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])
-
-LDISKFSDIR="$PWD/ldiskfs"
-AC_SUBST(LDISKFSDIR)
-
-LDISKFS_AC_PATCH_PROGRAM
-
-if test x$enable_server$enable_dist = xyesno ; then
-LB_LDISKFS_EXT_DIR
-LB_LDISKFS_EXT_SOURCE
-LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
-LB_EXT_PBLOCK
-fi
-
-LB_CONFIG_HEADERS
-
-AC_SUBST(ac_configure_args)
-
-AC_CONFIG_FILES([Makefile ldiskfs/Makefile]
- AC_PACKAGE_TARNAME[.spec])
-
-MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
-AC_SUBST(MOSTLYCLEANFILES)
-
-AC_OUTPUT
+++ /dev/null
-/linux-stage
-/linux
-/modules.order
-/Module.symvers
-/stamp-h2
-/*.c
-/*.h
-/sources
-/trace
+++ /dev/null
-all: modules
-install: modules_install
-distdir:
-
-# copy makefile over to not break patches
-backfs_extra := $(wildcard @LINUX@/fs/ext4/Makefile)
-
-backfs_headers := $(wildcard @EXT_DIR@/*.h)
-linux_headers := $(wildcard @LINUX@/include/linux/ext4*.h)
-linux_new_headers := dynlocks.h
-linux_new_headers += htree_lock.h
-trace_headers := $(wildcard @LINUX@/include/trace/events/ext4*.h)
-
-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
-
-ext4_new_sources := dynlocks.c fiemap.h mmp.c
-ext4_new_sources += htree_lock.c
-ext4_new_headers :=
-
-new_sources := $(ext4_new_sources)
-new_headers := $(ext4_new_headers)
-
-ldiskfs_patched_sources := $(notdir $(backfs_sources) $(backfs_headers)) $(new_sources) $(new_headers)
-ldiskfs_sources := $(ldiskfs_patched_sources)
-ldiskfs_obj := $(filter %.o,$(ldiskfs_sources:.c=.o))
-
-#--- autoMakefile cut-and-paste start
-
-ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,ldiskfs,$(notdir $(linux_headers))))
-
-$(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
-
-ldiskfs_sed_flags = \
- -e "s/dx_hash_info/ext4_dx_hash_info/g" \
- -e "s/DX_HASH/EXT4_DX_HASH/g" \
- -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g"
-
-%.c: linux-stage/fs/ext4/%.c
- sed $(strip $(ldiskfs_sed_flags)) $< > $@
-
-%.h: linux-stage/fs/ext4/%.h
- sed $(strip $(ldiskfs_sed_flags)) $< > $@
-
-linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h
- sed $(strip $(ldiskfs_sed_flags)) $< > $@
-
-series := @top_srcdir@/kernel_patches/series/ldiskfs-@LDISKFS_SERIES@
-patches := @top_srcdir@/kernel_patches/patches
-
-#install-data-local: sources
-# destname=@LDISKFS_META_NAME@-@LDISKFS_META_VERSION@/@LINUX_VERSION@; \
-# instdest=$(DESTDIR)/usr/src/$$destname; \
-# instfiles=$$(find . -name '*.h' | grep -v linux-stage); \
-# for instfile in $$instfiles; do \
-# if [ "$$(dirname $$instfile)" = "." ]; then \
-# /usr/bin/install -c -D $$instfile $$instdest/ldiskfs/$$instfile; \
-# else \
-# /usr/bin/install -c -D $$instfile $$instdest/$$instfile; \
-# fi \
-# done
-
-###############################
-# Kernel Build Infrastructure #
-###############################
-
-EXTRA_CFLAGS += -I@LINUX@/fs -I@LDISKFSDIR@
-EXTRA_CFLAGS += -include @abs_top_builddir@/ldiskfs/ldiskfs_config.h
-EXTRA_CFLAGS += -include @abs_top_builddir@/config.h
-
-obj-m := ldiskfs.o
-ldiskfs-objs := $(ldiskfs_obj)
-
-modules: sources
- $(MAKE) -C @LINUX_OBJ@ M=$(shell pwd) $@
-
-clean:
- $(MAKE) -C @LINUX_OBJ@ M=$(shell pwd) $@
- if [ -f Module.markers ]; then $(RM) Module.markers; fi
-
-distclean:
- -rm -f Makefile
-
-maintainer-clean:
- -rm -f Makefile
-
-modules_install:
- @# Install the kernel modules
- $(MAKE) -C @LINUX_OBJ@ M=$(shell pwd) \
- INSTALL_MOD_PATH=$(DESTDIR) \
- INSTALL_MOD_DIR=updates/kernel/fs/lustre-ldiskfs $@
- @# Remove extraneous build products when packaging
- if [ -n "$(DESTDIR)" ]; then \
- find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \
- -name 'modules.*' | xargs $(RM); \
- fi
- sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \
- if [ -f $$sysmap ]; then \
- depmod -ae -F $$sysmap @LINUX_VERSION@; \
- fi
-
-################################################
-# Patched ldiskfs Sources Build Infrastructure #
-################################################
-
-sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers)
- rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES)
- mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \
- linux-stage/include/trace/events
- cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4
- if test -n "$(linux_headers)" ; then \
- cp $(linux_headers) linux-stage/include/linux; \
- fi
- if test -n "$(trace_headers)" ; then \
- cp $(trace_headers) linux-stage/include/trace/events; \
- fi
-
-@USE_QUILT_TRUE@ ln -s ../$(patches) linux-stage/patches
-@USE_QUILT_TRUE@ ln -s ../$(series) linux-stage/series
-@USE_QUILT_TRUE@ cd linux-stage && quilt push -a -q
-
-@USE_QUILT_FALSE@ @echo -n "Applying ext4 patches:"
-@USE_QUILT_FALSE@ @cd linux-stage && for i in $$(<../$(series)) ; do \
-@USE_QUILT_FALSE@ echo -n " $$i" ; \
-@USE_QUILT_FALSE@ patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
-@USE_QUILT_FALSE@ done
-@USE_QUILT_FALSE@ @echo
-
- mkdir -p linux trace/events
- @echo -n "Replacing 'ext4' with 'ldiskfs':"
- for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \
- echo -n " $$i" ; \
- sed $(strip $(ldiskfs_sed_flags)) \
- linux-stage/fs/ext4/$$i > $$i ; \
- done
- for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \
- if test -f "ext4$$i" ; then \
- echo -n " ext4$$i" ; \
- mv ext4$$i ldiskfs$$i ; \
- fi ; \
- done
- for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \
- echo -n " ext4$$i" ; \
- sed $(strip $(ldiskfs_sed_flags)) \
- linux-stage/include/linux/ext4$$i \
- > linux/ldiskfs$$i ; \
- done
- for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \
- echo -n " ext4$$i"; \
- sed $(strip $(ldiskfs_sed_flags)) \
- linux-stage/include/trace/events/ext4$$i \
- > trace/events/ldiskfs$$i ; \
- done
- for i in $(notdir $(linux_new_headers)) ; do \
- echo -n " $$i"; \
- sed $(strip $(ldiskfs_sed_flags)) \
- linux-stage/include/linux/$$i \
- > linux/$$i ; \
- done
-
- @echo
- touch sources
-
-foo-check:
- @echo "ldiskfs_sources: $(ldiskfs_sources)"
- @echo "ldiskfs_SOURCES: $(ldiskfs_SOURCES)"
- @echo "ldiskfs_headers: $(ldiskfs_headers)"
- @echo "ldiskfs_objects: $(ldiskfs_objects)"
- @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
- @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
-
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
-CLEANFILES = sources $(notdir $(linux_new_headers) $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers) $(trace_headers))
-
-#--- autoMakefile cut-and-paste end
+++ /dev/null
-/* enable posix acls for ldiskfs */
-#define CONFIG_LDISKFS_FS_POSIX_ACL 1
-
-/* enable fs security for ldiskfs */
-#define CONFIG_LDISKFS_FS_SECURITY 1
-
-/* - 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
-
-/* kernel has ext_pblocks */
-#undef HAVE_EXT_PBLOCK
+++ /dev/null
-# lustre-ldiskfs.spec
-%{!?version: %define version @VERSION@}
-%{!?kdir: %define kdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else echo "/lib/modules/$(uname -r)/build"; fi)}
-
-%{!?kobjdir: %define kobjdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux-obj=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else echo "%kdir"; fi)}
-
-# as an alternative to this implementation we could simply "make -C $kdir kernelversion"
-%{!?kversion: %global kversion %(if test -s %kobjdir/include/generated/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/generated/utsrelease.h ; elif test -s %kobjdir/include/linux/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/linux/utsrelease.h ; else LINUXRELEASEHEADER=%kobjdir/include/linux/version.h; fi; sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' $LINUXRELEASEHEADER)}
-
-%{!?downstream_release: %define downstream_release "@DOWNSTREAM_RELEASE@"}
-
-%define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
-
-%{!?release: %define release %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; release=$(echo %kversion | tr '-' '_'); echo ${release})}
-
-# always append the buildid, even when the caller defines %release
-%define fullrelease %{release}%{buildid}
-
-Summary: ldiskfs backend file system
-Name: lustre-ldiskfs
-Version: %{version}
-Release: %{fullrelease}
-License: GPL
-Group: Development/Kernel
-Source: lustre-ldiskfs-%{version}.tar.gz
-URL: http://www.sun.com/software/products/lustre/index.xml
-BuildRoot: %{_tmppath}/lustre-ldiskfs-%{version}-root
-Requires: modutils >= 2.4.10, ldiskfsprogs >= 1.42.7.wc1
-Provides: lustre-backend-fs
-
-%description
-Provides the ldiskfs backend file system kernel module, used by
-servers in the Lustre file system, for Linux %{kversion}.
-
-%if 0%{?suse_version}
-%debug_package
-%endif
-%prep
-%setup -q
-
-%build
-# if RPM_BUILD_NCPUS unset, set it
-if [ -z "$RPM_BUILD_NCPUS" ] ; then
- RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
- if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
- RPM_BUILD_NCPUS=1
- fi
- if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
- RPM_BUILD_NCPUS=8
- fi
-fi
-
-rm -rf $RPM_BUILD_ROOT
-
-# Set an explicit path to our Linux tree, if we can.
-cd $RPM_BUILD_DIR/lustre-ldiskfs-%{version}
-CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
-
-# if %%kdir was given, make sure it's not in the configure arguments
-if [ -n "%kdir" ]; then
- CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
-fi
-# ditto for %%kobjdir
-if [ -n "%kobjdir" ]; then
- CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
-fi
-
-# we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
-# string in it which we don't want word splitted by the shell
-%define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#')
-
-eval ./configure %{?configure_args} \
- %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
- --sysconfdir=%{_sysconfdir} \
- --mandir=%{_mandir} \
- --libdir=%{_libdir} \
- $CONFIGURE_ARGS
-make -j $RPM_BUILD_NCPUS -s
-
-%install
-make install DESTDIR=$RPM_BUILD_ROOT
-# Kernel module needs to be executable at the end of the install
-# section to allow the find-debuginfo.sh to produce a proper
-# debuginfo package. Permissions will be corrected in the files
-# section.
-chmod 755 ${RPM_BUILD_ROOT}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs/ldiskfs.ko
-
-# mark modules executable for find-debuginfo.sh
-find $RPM_BUILD_ROOT/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
- xargs --no-run-if-empty chmod u+x
-
-%files
-%defattr(644, root, root, 755)
-/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs
-
-%post
-if [ -f /boot/System.map-%{kversion} ]; then
- depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
-else
- depmod -ae %{kversion} || exit 0
-fi
-
-%postun
-if [ -f /boot/System.map-%{kversion} ]; then
- depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
-else
- depmod -ae %{kversion} || exit 0
-fi
-
-%clean
-rm -rf $RPM_BUILD_ROOT
#
SUBDIRS = libcfs include autoconf
-
-sources:
- $(MAKE) sources -C libcfs
default: all
-sources:
-
libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs))
libcfs-all-objs := debug.o fail.o nidstrings.o module.o tracefile.o \
SUBDIRS = lnet klnds ulnds selftest doc utils include \
autoconf
-
-sources:
rpms rpm: dist
rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
+
+srpm: dist
+ rpmbuild -ts $(PACKAGE)-$(VERSION).tar.gz
%if %{with ldiskfs}
%package osd-ldiskfs
-Summary: osd-ldiskfs is the mandatory glue for LDISKFS support in Lustre.
-Requires: lustre-modules = %{version}, lustre-ldiskfs >= 4.1.0
+Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
+Requires: lustre-modules = %{version}
+Requires: modutils >= 2.4.10
+Requires: ldiskfsprogs >= 1.42.7.wc1
Provides: lustre-osd
+Obsoletes: lustre-ldiskfs
Group: Development/Kernel
%description osd-ldiskfs
make install DESTDIR=$RPM_BUILD_ROOT
# hack to avoid changing the libsysio code for "make install"
rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
-# Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
-rm -rf $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs
# hack to include the llog_test module in lustre-tests
llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
%exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
%endif
%if %{with ldiskfs}
+%exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
%exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
%exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
%endif
%if %{with ldiskfs}
%files osd-ldiskfs
+%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
%if %{defined rpm_post_base}
lvfs-sources:
$(MAKE) sources -C lvfs
-obdclass-sources:
- $(MAKE) sources -C obdclass
-sources: $(LDISKFS) lvfs-sources obdclass-sources lustre_build_version
+sources: $(LDISKFS) lvfs-sources lustre_build_version
all-recursive: lustre_build_version
LC_HAVE_IOP_ATOMIC_OPEN
# 3.7
- LC_HAVE_POSIXACL_USER_NS
+ LC_HAVE_POSIXACL_USER_NS
# 3.9
LC_HAVE_HLIST_FOR_EACH_3ARG
LC_HAVE_F_PATH_MNT
#
- if test x$enable_server = xyes ; then
- AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
+ if test x$enable_server != xno ; then
LC_FUNC_DEV_SET_RDONLY
LC_STACK_SIZE
LC_QUOTA64
])
#
-# LC_CONFIG_CLIENT_SERVER
+# LC_CONFIG_CLIENT
#
-# Build client/server sides of Lustre
+# Check whether to build the client side of Lustre
#
-AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
-[AC_MSG_CHECKING([whether to build Lustre server support])
-AC_ARG_ENABLE([server],
- AC_HELP_STRING([--disable-server],
- [disable Lustre server support]),
- [],[enable_server='yes'])
-AC_MSG_RESULT([$enable_server])
-
-AC_MSG_CHECKING([whether to build Lustre client support])
+AC_DEFUN([LC_CONFIG_CLIENT],
+[AC_MSG_CHECKING([whether to build Lustre client support])
AC_ARG_ENABLE([client],
AC_HELP_STRING([--disable-client],
[disable Lustre client support]),
[],[enable_client='yes'])
-AC_MSG_RESULT([$enable_client])])
+AC_MSG_RESULT([$enable_client])
+])
#
# LC_CONFIG_LIBLUSTRE
#
AC_DEFUN([LC_CONDITIONALS],
[AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
-AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
EXTRA_DIST = $(lvfs-objs:.o=.c) fsfilt_ext3.c
# for <ext3/xattr.h> on 2.6
-EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LDISKFS_DIR@ -I@LDISKFS_DIR@/ldiskfs
+EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@abs_top_builddir@ -I@abs_top_builddir@/ldiskfs
@INCLUDE_RULES@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
-#include <ldiskfs/ldiskfs_config.h>
#include <ext4/ext4.h>
#include <ext4/ext4_jbd2.h>
#include <linux/version.h>
default: all
-sources:
-
obdclass-all-objs := llog.o llog_cat.o llog_obd.o llog_swab.o
@LDISKFS_ENABLED_TRUE@ obdclass-all-objs += llog_lvfs.o
obdclass-all-objs += class_obd.o debug.o genops.o uuid.o llog_ioctl.o
osd_iam_lfix.o osd_iam_lvar.o osd_io.o osd_compat.o \
osd_scrub.o osd_quota.o osd_quota_fmt.o
-EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LDISKFS_DIR@ -I@LDISKFS_DIR@/ldiskfs
+EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@abs_top_builddir@ -I@abs_top_builddir@/ldiskfs
@INCLUDE_RULES@
/* struct dirent64 */
#include <linux/dirent.h>
-#include <ldiskfs/ldiskfs_config.h>
#include <ldiskfs/ldiskfs.h>
#include <ldiskfs/ldiskfs_jbd2.h>
/*.xml
/Makefile.in
/XMLCONFIG
+/checkfiemap
/checkstat
/chownmany
/cmknod
#
grep -q exportfs_decode_fh $SYMLIST ||
{ modprobe exportfs 2> /dev/null || true; }
- load_module ../ldiskfs/ldiskfs/ldiskfs
+ load_module ../ldiskfs/ldiskfs
load_module lvfs/fsfilt_ldiskfs
load_module osd-ldiskfs/osd_ldiskfs
fi