AS_IF([test -z "$LDISKFS_SERIES"], [
AS_IF([test x$RHEL_KERNEL = xyes], [
case $RHEL_RELEASE_NO in
+ 80) LDISKFS_SERIES="4.18-rhel8.series" ;;
+ 76) LDISKFS_SERIES="3.10-rhel7.6.series" ;;
+ 75) LDISKFS_SERIES="3.10-rhel7.5.series" ;;
+ 74) LDISKFS_SERIES="3.10-rhel7.4.series" ;;
73) LDISKFS_SERIES="3.10-rhel7.3.series" ;;
72) LDISKFS_SERIES="3.10-rhel7.2.series" ;;
71) LDISKFS_SERIES="3.10-rhel7.series" ;;
6[0-3]) LDISKFS_SERIES="2.6-rhel6.series" ;;
esac
], [test x$SUSE_KERNEL = xyes], [
+ AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.82],[
AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.0],[
AS_VERSION_COMPARE([$LINUXRELEASE],[3.12.0],[
AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
;;
esac
])],[LDISKFS_SERIES="4.4-sles12sp2.series"],
- [LDISKFS_SERIES="4.4-sles12sp2.series"])
+ [LDISKFS_SERIES="4.4-sles12sp2.series"]
+ )], [LDISKFS_SERIES="4.4-sles12sp3.series"],
+ [LDISKFS_SERIES="4.4-sles12sp3.series"])
+], [test x$UBUNTU_KERNEL = xyes], [
+ AS_VERSION_COMPARE([$LINUXRELEASE],[4.15.0],[
+ AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.0], [],
+ [
+ KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
+ AS_IF(
+ [test -z "$KPLEV"], [
+ AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
+ LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"
+ ],
+ [test $KPLEV -ge 73], [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"],
+ [test $KPLEV -ge 62], [LDISKFS_SERIES="4.4.0-62-ubuntu14+16.series"],
+ [test $KPLEV -ge 49], [LDISKFS_SERIES="4.4.0-49-ubuntu14+16.series"],
+ [LDISKFS_SERIES="4.4.0-45-ubuntu14+16.series"]
+ )
+ ],
+ [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"])],
+ [
+ KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
+ AS_IF(
+ [test -z "$KPLEV"], [
+ AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
+ LDISKFS_SERIES="4.15.0-24-ubuntu18.series"
+ ],
+ [test $KPLEV -ge 24], [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"],
+ [test $KPLEV -ge 20], [LDISKFS_SERIES="4.15.0-20-ubuntu18.series"]
+ )
+ ],
+ [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"])
])
])
AS_IF([test -z "$LDISKFS_SERIES"],
]) # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
#
-# LB_EXT_PBLOCK
-#
-# 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
-#
-AC_DEFUN([LB_EXT_PBLOCK], [
-LB_CHECK_COMPILE([if Linux kernel has 'ext_pblock'],
-ext_pblock, [
- #include <linux/fs.h>
- #include "$EXT4_SRC_DIR/ext4_extents.h"
-],[
- ext_pblock(NULL);
-],[
- AC_DEFINE(HAVE_EXT_PBLOCK, 1, [Linux kernel has ext_pblock])
-])
-]) # LB_EXT_PBLOCK
-
-#
# LB_EXT4_JOURNAL_START_3ARGS
#
# 3.9 added a type argument to ext4_journal_start and friends
]) # LB_EXT4_JOURNAL_START_3ARGS
#
-# LB_LDISKFS_MAP_BLOCKS
-#
-# Since 2.6.35 brought ext4_map_blocks() for IO.
-# We just check this function whether existed.
-# it must be exported by ldiskfs patches.
-#
-AC_DEFUN([LB_LDISKFS_MAP_BLOCKS], [
-LB_CHECK_COMPILE([if kernel has ext4_map_blocks],
-ext4_map_blocks, [
- #include <linux/fs.h>
- #include "$EXT4_SRC_DIR/ext4.h"
-],[
- ext4_map_blocks(NULL, NULL, NULL, 0);
-],[
- AC_DEFINE(HAVE_LDISKFS_MAP_BLOCKS, 1, [kernel has ext4_map_blocks])
-])
-])
-
-#
# LB_EXT4_BREAD_4ARGS
#
# 3.18 ext4_bread has 4 arguments
]) # LB_EXT4_HAVE_INFO_DQUOT
#
+# LB_EXT4_HAVE_I_CRYPT_INFO
+#
+# in linux 4.8 i_crypt_info moved from ext4_inode_info to struct inode
+#
+# Determine if we need to enable CONFIG_LDISKFS_FS_ENCRYPTION.
+# If we have i_crypt_info in ext4_inode_info, the config option
+# should be enabled to make the ldiskfs module compilation happy.
+# Otherwise i_crypy_info is in struct inode, we need to check kernel
+# config option to determine that.
+#
+AC_DEFUN([LB_EXT4_HAVE_I_CRYPT_INFO], [
+LB_CHECK_COMPILE([if i_crypt_info is in ext4_inode_info],
+ext4_i_crypt_info, [
+ #define CONFIG_EXT4_FS_ENCRYPTION 1
+ #include <linux/fs.h>
+ #include "$EXT4_SRC_DIR/ext4.h"
+],[
+ struct ext4_inode_info in;
+
+ in.i_crypt_info = NULL;
+],[
+ AC_DEFINE(
+ CONFIG_LDISKFS_FS_ENCRYPTION, 1,
+ [enable encryption for ldiskfs]
+ )
+],[
+ LB_CHECK_CONFIG([EXT4_FS_ENCRYPTION],[
+ AC_DEFINE(
+ CONFIG_LDISKFS_FS_ENCRYPTION, 1,
+ [enable encryption for ldiskfs]
+ )
+ ])
+])
+]) # LB_EXT4_HAVE_I_CRYPT_INFO
+
+#
+# LB_LDISKFS_IGET_HAS_FLAGS_ARG
+#
+# kernel 4.19 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
+# ext4_iget changed to a macro with 3 args was function with 2 args
+#
+AC_DEFUN([LB_LDISKFS_IGET_HAS_FLAGS_ARG], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if ldiskfs_iget takes a flags argument],
+ext4_iget_3args, [
+ #include <linux/fs.h>
+ #include "$EXT4_SRC_DIR/ext4.h"
+],[
+ int f = EXT4_IGET_SPECIAL;
+ (void)f;
+],[
+ AC_DEFINE(HAVE_LDISKFS_IGET_WITH_FLAGS, 1,
+ [if ldiskfs_iget takes a flags argument])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LB_LDISKFS_IGET_HAS_FLAGS_ARG
+
+#
# LDISKFS_AC_PATCH_PROGRAM
#
# Determine which program should be used to apply the patches to
# 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])
+ AC_SUBST(ENABLE_LDISKFS, yes)
LDISKFS_LINUX_SERIES
LDISKFS_AC_PATCH_PROGRAM
LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
- LB_EXT_PBLOCK
LB_EXT4_JOURNAL_START_3ARGS
- LB_LDISKFS_MAP_BLOCKS
LB_EXT4_BREAD_4ARGS
LB_EXT4_HAVE_INFO_DQUOT
+ LB_EXT4_HAVE_I_CRYPT_INFO
+ LB_LDISKFS_IGET_HAS_FLAGS_ARG
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_DEFINE(CONFIG_LDISKFS_FS_RW, 1, [enable rw access for ldiskfs])
- AC_DEFINE(CONFIG_LDISKFS_FS_ENCRYPTION, 1, [enable encryption for ldiskfs])
AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
+], [
+ AC_SUBST(ENABLE_LDISKFS, no)
])
AC_MSG_CHECKING([whether to build ldiskfs])
EXT4_SRC_DIR="$linux_src/fs/ext4"
], [
# Kernel ext source provided by kernel-debuginfo-common package
- linux_src=$(ls -1d /usr/src/debug/*/linux-${LINUXRELEASE%.*}* \
+ # that extracted to $LINUX
+ linux_src=$(ls -1d $linux_src/../../debug/*/linux-${LINUXRELEASE%.*}* \
2>/dev/null | tail -1)
- AS_IF([test -e "$linux_src/fs/ext4/super.c"],
- [EXT4_SRC_DIR="$linux_src/fs/ext4"],
- [EXT4_SRC_DIR=""])
+ AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
+ EXT4_SRC_DIR="$linux_src/fs/ext4"
+ ], [
+ # Kernel ext source provided by kernel-debuginfo-common package
+ linux_src=$(ls -1d /usr/src/debug/*/linux-${LINUXRELEASE%.*}* \
+ 2>/dev/null | tail -1)
+ AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
+ EXT4_SRC_DIR="$linux_src/fs/ext4"
+ ], [
+ EXT4_SRC_DIR=""
+ ])
+ ])
])
AC_MSG_RESULT([$EXT4_SRC_DIR])
AC_SUBST(EXT4_SRC_DIR)