]> git.proxmox.com Git - mirror_spl-debian.git/blobdiff - config/spl-build.m4
control: Append myself to Uploaders.
[mirror_spl-debian.git] / config / spl-build.m4
index d886ddf15a46381978813628c4adf47d6c67655e..5c6c02af2ad8e065d71e06bb6620d69462e2f676 100644 (file)
@@ -17,9 +17,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
        AC_SUBST(KERNELCPPFLAGS)
 
-       SPL_AC_DEBUG
-       SPL_AC_DEBUG_KMEM
-       SPL_AC_DEBUG_KMEM_TRACKING
        SPL_AC_TEST_MODULE
        SPL_AC_ATOMIC_SPINLOCK
        SPL_AC_SHRINKER_CALLBACK
@@ -27,8 +24,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_CONFIG_TRIM_UNUSED_KSYMS
        SPL_AC_PDE_DATA
        SPL_AC_SET_FS_PWD_WITH_CONST
-       SPL_AC_2ARGS_VFS_UNLINK
-       SPL_AC_4ARGS_VFS_RENAME
        SPL_AC_2ARGS_VFS_FSYNC
        SPL_AC_INODE_TRUNCATE_RANGE
        SPL_AC_FS_STRUCT_SPINLOCK
@@ -50,8 +45,14 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_KMEM_CACHE_ALLOCFLAGS
        SPL_AC_WAIT_ON_BIT
        SPL_AC_INODE_LOCK
-       SPL_AC_MUTEX_OWNER
        SPL_AC_GROUP_INFO_GID
+       SPL_AC_KMEM_CACHE_CREATE_USERCOPY
+       SPL_AC_WAIT_QUEUE_ENTRY_T
+       SPL_AC_WAIT_QUEUE_HEAD_ENTRY
+       SPL_AC_IO_SCHEDULE_TIMEOUT
+       SPL_AC_KERNEL_WRITE
+       SPL_AC_KERNEL_READ
+       SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST
 ])
 
 AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -112,6 +113,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
                if test "$kernelsrc" = "NONE"; then
                        kernsrcver=NONE
                fi
+               withlinux=yes
        fi
 
        AC_MSG_RESULT([$kernelsrc])
@@ -124,7 +126,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
 
        AC_MSG_CHECKING([kernel build directory])
        if test -z "$kernelbuild"; then
-               if test -e "/lib/modules/$(uname -r)/build"; then
+               if test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"; then
                        kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
                elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
@@ -223,9 +225,12 @@ AC_DEFUN([SPL_AC_RPM], [
                AC_MSG_RESULT([$HAVE_RPMBUILD])
        ])
 
-       RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"'
+       RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1"'
+       RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM) 1"'
+       RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING) 1"'
        RPM_DEFINE_UTIL=
        RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+       RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
        RPM_DEFINE_DKMS=
 
        SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
@@ -748,886 +753,3 @@ AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [
        AC_MSG_CHECKING([whether kernel defines atomic64_t])
        AC_MSG_RESULT([$have_atomic64_t])
 ])
-
-AC_DEFUN([SPL_AC_SHRINKER_CALLBACK],[
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       dnl #
-       dnl # 2.6.23 to 2.6.34 API change
-       dnl # ->shrink(int nr_to_scan, gfp_t gfp_mask)
-       dnl #
-       AC_MSG_CHECKING([whether old 2-argument shrinker exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/mm.h>
-
-               int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
-       ],[
-               struct shrinker cache_shrinker = {
-                       .shrink = shrinker_cb,
-                       .seeks = DEFAULT_SEEKS,
-               };
-               register_shrinker(&cache_shrinker);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_OLD_SHRINKER_CALLBACK, 1,
-                       [old shrinker callback wants 2 args])
-       ],[
-               AC_MSG_RESULT(no)
-               dnl #
-               dnl # 2.6.35 - 2.6.39 API change
-               dnl # ->shrink(struct shrinker *,
-               dnl #          int nr_to_scan, gfp_t gfp_mask)
-               dnl #
-               AC_MSG_CHECKING([whether old 3-argument shrinker exists])
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/mm.h>
-
-                       int shrinker_cb(struct shrinker *, int nr_to_scan,
-                                       gfp_t gfp_mask);
-               ],[
-                       struct shrinker cache_shrinker = {
-                               .shrink = shrinker_cb,
-                               .seeks = DEFAULT_SEEKS,
-                       };
-                       register_shrinker(&cache_shrinker);
-               ],[
-                       AC_MSG_RESULT(yes)
-                       AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1,
-                               [old shrinker callback wants 3 args])
-               ],[
-                       AC_MSG_RESULT(no)
-                       dnl #
-                       dnl # 3.0 - 3.11 API change
-                       dnl # ->shrink(struct shrinker *,
-                       dnl #          struct shrink_control *sc)
-                       dnl #
-                       AC_MSG_CHECKING(
-                               [whether new 2-argument shrinker exists])
-                       SPL_LINUX_TRY_COMPILE([
-                               #include <linux/mm.h>
-
-                               int shrinker_cb(struct shrinker *,
-                                               struct shrink_control *sc);
-                       ],[
-                               struct shrinker cache_shrinker = {
-                                       .shrink = shrinker_cb,
-                                       .seeks = DEFAULT_SEEKS,
-                               };
-                               register_shrinker(&cache_shrinker);
-                       ],[
-                               AC_MSG_RESULT(yes)
-                               AC_DEFINE(HAVE_2ARGS_NEW_SHRINKER_CALLBACK, 1,
-                                       [new shrinker callback wants 2 args])
-                       ],[
-                               AC_MSG_RESULT(no)
-                               dnl #
-                               dnl # 3.12 API change,
-                               dnl # ->shrink() is logically split in to
-                               dnl # ->count_objects() and ->scan_objects()
-                               dnl #
-                               AC_MSG_CHECKING(
-                                   [whether ->count_objects callback exists])
-                               SPL_LINUX_TRY_COMPILE([
-                                       #include <linux/mm.h>
-
-                                       unsigned long shrinker_cb(
-                                               struct shrinker *,
-                                               struct shrink_control *sc);
-                               ],[
-                                       struct shrinker cache_shrinker = {
-                                               .count_objects = shrinker_cb,
-                                               .scan_objects = shrinker_cb,
-                                               .seeks = DEFAULT_SEEKS,
-                                       };
-                                       register_shrinker(&cache_shrinker);
-                               ],[
-                                       AC_MSG_RESULT(yes)
-                                       AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK,
-                                               1, [->count_objects exists])
-                               ],[
-                                       AC_MSG_ERROR(error)
-                               ])
-                       ])
-               ])
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 2.6.33 API change,
-dnl # Removed .ctl_name from struct ctl_table.
-dnl #
-AC_DEFUN([SPL_AC_CTL_NAME], [
-       AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/sysctl.h>
-       ],[
-               struct ctl_table ctl __attribute__ ((unused));
-               ctl.ctl_name = 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 3.10 API change,
-dnl # PDE is replaced by PDE_DATA
-dnl #
-AC_DEFUN([SPL_AC_PDE_DATA], [
-       AC_MSG_CHECKING([whether PDE_DATA() is available])
-       SPL_LINUX_TRY_COMPILE_SYMBOL([
-               #include <linux/proc_fs.h>
-       ], [
-               PDE_DATA(NULL);
-       ], [PDE_DATA], [], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_PDE_DATA, 1, [yes])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 3.9 API change
-dnl # set_fs_pwd takes const struct path *
-dnl #
-AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       [AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/spinlock.h>
-               #include <linux/fs_struct.h>
-               #include <linux/path.h>
-               void (*const set_fs_pwd_func)
-                       (struct fs_struct *, const struct path *)
-                       = set_fs_pwd;
-       ],[
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
-                       [set_fs_pwd() needs const path *])
-       ],[
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/spinlock.h>
-                       #include <linux/fs_struct.h>
-                       #include <linux/path.h>
-                       void (*const set_fs_pwd_func)
-                               (struct fs_struct *, struct path *)
-                               = set_fs_pwd;
-               ],[
-                       return 0;
-               ],[
-                       AC_MSG_RESULT(no)
-               ],[
-                       AC_MSG_ERROR(unknown)
-               ])
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.13 API change
-dnl # vfs_unlink() updated to take a third delegated_inode argument.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_UNLINK],
-       [AC_MSG_CHECKING([whether vfs_unlink() wants 2 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1,
-                         [vfs_unlink() wants 2 args])
-       ],[
-               AC_MSG_RESULT(no)
-               dnl #
-               dnl # Linux 3.13 API change
-               dnl # Added delegated inode
-               dnl #
-               AC_MSG_CHECKING([whether vfs_unlink() wants 3 args])
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/fs.h>
-               ],[
-                       vfs_unlink((struct inode *) NULL,
-                               (struct dentry *) NULL,
-                               (struct inode **) NULL);
-               ],[
-                       AC_MSG_RESULT(yes)
-                       AC_DEFINE(HAVE_3ARGS_VFS_UNLINK, 1,
-                                 [vfs_unlink() wants 3 args])
-               ],[
-                       AC_MSG_ERROR(no)
-               ])
-
-       ])
-])
-
-dnl #
-dnl # 3.13 and 3.15 API changes
-dnl # Added delegated inode and flags argument.
-dnl #
-AC_DEFUN([SPL_AC_4ARGS_VFS_RENAME],
-       [AC_MSG_CHECKING([whether vfs_rename() wants 4 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
-                       (struct inode *) NULL, (struct dentry *) NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1,
-                         [vfs_rename() wants 4 args])
-       ],[
-               AC_MSG_RESULT(no)
-               dnl #
-               dnl # Linux 3.13 API change
-               dnl # Added delegated inode
-               dnl #
-               AC_MSG_CHECKING([whether vfs_rename() wants 5 args])
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/fs.h>
-               ],[
-                       vfs_rename((struct inode *) NULL,
-                               (struct dentry *) NULL,
-                               (struct inode *) NULL,
-                               (struct dentry *) NULL,
-                               (struct inode **) NULL);
-               ],[
-                       AC_MSG_RESULT(yes)
-                       AC_DEFINE(HAVE_5ARGS_VFS_RENAME, 1,
-                                 [vfs_rename() wants 5 args])
-               ],[
-                       AC_MSG_RESULT(no)
-                       dnl #
-                       dnl # Linux 3.15 API change
-                       dnl # Added flags
-                       dnl #
-                       AC_MSG_CHECKING([whether vfs_rename() wants 6 args])
-                       SPL_LINUX_TRY_COMPILE([
-                               #include <linux/fs.h>
-                       ],[
-                               vfs_rename((struct inode *) NULL,
-                                       (struct dentry *) NULL,
-                                       (struct inode *) NULL,
-                                       (struct dentry *) NULL,
-                                       (struct inode **) NULL,
-                                       (unsigned int) 0);
-                       ],[
-                               AC_MSG_RESULT(yes)
-                               AC_DEFINE(HAVE_6ARGS_VFS_RENAME, 1,
-                                         [vfs_rename() wants 6 args])
-                       ],[
-                               AC_MSG_ERROR(no)
-                       ])
-               ])
-       ])
-])
-
-dnl #
-dnl # 2.6.36 API change,
-dnl # The 'struct fs_struct->lock' was changed from a rwlock_t to
-dnl # a spinlock_t to improve the fastpath performance.
-dnl #
-AC_DEFUN([SPL_AC_FS_STRUCT_SPINLOCK], [
-       AC_MSG_CHECKING([whether struct fs_struct uses spinlock_t])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/sched.h>
-               #include <linux/fs_struct.h>
-       ],[
-               static struct fs_struct fs;
-               spin_lock_init(&fs.lock);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_FS_STRUCT_SPINLOCK, 1,
-                         [struct fs_struct uses spinlock_t])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # User namespaces, use kuid_t in place of uid_t
-dnl # where available. Not strictly a user namespaces thing
-dnl # but it should prevent surprises
-dnl #
-AC_DEFUN([SPL_AC_KUIDGID_T], [
-       AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/uidgid.h>
-       ], [
-               kuid_t userid = KUIDT_INIT(0);
-               kgid_t groupid = KGIDT_INIT(0);
-       ],[
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/uidgid.h>
-               ], [
-                       kuid_t userid = 0;
-                       kgid_t groupid = 0;
-               ],[
-                       AC_MSG_RESULT(yes; optional)
-               ],[
-                       AC_MSG_RESULT(yes; mandatory)
-                       AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use])
-               ])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 2.6.35 API change,
-dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_FSYNC], [
-       AC_MSG_CHECKING([whether vfs_fsync() wants 2 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_fsync(NULL, 0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 3.5 API change,
-dnl # inode_operations.truncate_range removed
-dnl #
-AC_DEFUN([SPL_AC_INODE_TRUNCATE_RANGE], [
-       AC_MSG_CHECKING([whether truncate_range() inode operation is available])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               struct inode_operations ops;
-               ops.truncate_range = NULL;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1,
-                       [truncate_range() inode operation is available])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # Linux 2.6.38 - 3.x API
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [
-       AC_MSG_CHECKING([whether fops->fallocate() exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-               struct file_operations fops __attribute__ ((unused)) = {
-                       .fallocate = fallocate,
-               };
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # Linux 2.6.x - 2.6.37 API
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [
-       AC_MSG_CHECKING([whether iops->fallocate() exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
-               struct inode_operations fops __attribute__ ((unused)) = {
-                       .fallocate = fallocate,
-               };
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # PaX Linux 2.6.38 - 3.x API
-dnl #
-AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
-       AC_MSG_CHECKING([whether fops->fallocate() exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-               struct file_operations_no_const fops __attribute__ ((unused)) = {
-                       .fallocate = fallocate,
-               };
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # The fallocate callback was moved from the inode_operations
-dnl # structure to the file_operations structure.
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [
-       SPL_AC_KERNEL_FILE_FALLOCATE
-       SPL_AC_KERNEL_INODE_FALLOCATE
-       SPL_AC_PAX_KERNEL_FILE_FALLOCATE
-])
-
-dnl #
-dnl # zlib inflate compat,
-dnl # Verify the kernel has CONFIG_ZLIB_INFLATE support enabled.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_ZLIB_INFLATE], [
-       AC_MSG_CHECKING([whether CONFIG_ZLIB_INFLATE is defined])
-       SPL_LINUX_TRY_COMPILE([
-               #if !defined(CONFIG_ZLIB_INFLATE) && \
-                   !defined(CONFIG_ZLIB_INFLATE_MODULE)
-               #error CONFIG_ZLIB_INFLATE not defined
-               #endif
-       ],[ ],[
-               AC_MSG_RESULT([yes])
-       ],[
-               AC_MSG_RESULT([no])
-               AC_MSG_ERROR([
-       *** This kernel does not include the required zlib inflate support.
-       *** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set.])
-       ])
-])
-
-dnl #
-dnl # zlib deflate compat,
-dnl # Verify the kernel has CONFIG_ZLIB_DEFLATE support enabled.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_ZLIB_DEFLATE], [
-       AC_MSG_CHECKING([whether CONFIG_ZLIB_DEFLATE is defined])
-       SPL_LINUX_TRY_COMPILE([
-               #if !defined(CONFIG_ZLIB_DEFLATE) && \
-                   !defined(CONFIG_ZLIB_DEFLATE_MODULE)
-               #error CONFIG_ZLIB_DEFLATE not defined
-               #endif
-       ],[ ],[
-               AC_MSG_RESULT([yes])
-       ],[
-               AC_MSG_RESULT([no])
-               AC_MSG_ERROR([
-       *** This kernel does not include the required zlib deflate support.
-       *** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set.])
-       ])
-])
-
-dnl #
-dnl # config trim unused symbols,
-dnl # Verify the kernel has CONFIG_TRIM_UNUSED_KSYMS DISABLED.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_TRIM_UNUSED_KSYMS], [
-       AC_MSG_CHECKING([whether CONFIG_TRIM_UNUSED_KSYM is disabled])
-       SPL_LINUX_TRY_COMPILE([
-               #if defined(CONFIG_TRIM_UNUSED_KSYMS)
-               #error CONFIG_TRIM_UNUSED_KSYMS not defined
-               #endif
-       ],[ ],[
-               AC_MSG_RESULT([yes])
-       ],[
-               AC_MSG_RESULT([no])
-               AC_MSG_ERROR([
-       *** This kernel has unused symbols trimming enabled, please disable.
-       *** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
-       ])
-])
-
-dnl #
-dnl # 2.6.39 API compat,
-dnl # The function zlib_deflate_workspacesize() now take 2 arguments.
-dnl # This was done to avoid always having to allocate the maximum size
-dnl # workspace (268K).  The caller can now specific the windowBits and
-dnl # memLevel compression parameters to get a smaller workspace.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE],
-       [AC_MSG_CHECKING([whether zlib_deflate_workspacesize() wants 2 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/zlib.h>
-       ],[
-               return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1,
-                         [zlib_deflate_workspacesize() wants 2 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 2.6.39 API change,
-dnl # Shrinker adjust to use common shrink_control structure.
-dnl #
-AC_DEFUN([SPL_AC_SHRINK_CONTROL_STRUCT], [
-       AC_MSG_CHECKING([whether struct shrink_control exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/mm.h>
-       ],[
-               struct shrink_control sc __attribute__ ((unused));
-
-               sc.nr_to_scan = 0;
-               sc.gfp_mask = GFP_KERNEL;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1,
-                       [struct shrink_control exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 3.1 API Change
-dnl #
-dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
-dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [
-       AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/rwsem.h>
-       ],[
-               struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-               raw_spinlock_t dummy_lock __attribute__ ((unused));
-               dummy_semaphore.wait_lock = dummy_lock;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(RWSEM_SPINLOCK_IS_RAW, 1,
-               [struct rw_semaphore member wait_lock is raw_spinlock_t])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.16 API Change
-dnl #
-dnl # rwsem-spinlock "->activity" changed to "->count"
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_ACTIVITY], [
-       AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/rwsem.h>
-       ],[
-               struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-               dummy_semaphore.activity = 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
-               [struct rw_semaphore has member activity])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.8 API Change
-dnl #
-dnl # rwsem "->count" changed to atomic_long_t type
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_ATOMIC_LONG_COUNT], [
-       AC_MSG_CHECKING(
-       [whether struct rw_semaphore has atomic_long_t member count])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/rwsem.h>
-       ],[
-               DECLARE_RWSEM(dummy_semaphore);
-               (void) atomic_long_read(&dummy_semaphore.count);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
-               [struct rw_semaphore has atomic_long_t member count])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.9 API change,
-dnl # Moved things from linux/sched.h to linux/sched/rt.h
-dnl #
-AC_DEFUN([SPL_AC_SCHED_RT_HEADER],
-       [AC_MSG_CHECKING([whether header linux/sched/rt.h exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/sched.h>
-               #include <linux/sched/rt.h>
-       ],[
-               return 0;
-       ],[
-               AC_DEFINE(HAVE_SCHED_RT_HEADER, 1, [linux/sched/rt.h exists])
-               AC_MSG_RESULT(yes)
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 4.11 API change,
-dnl # Moved things from linux/sched.h to linux/sched/signal.h
-dnl #
-AC_DEFUN([SPL_AC_SCHED_SIGNAL_HEADER],
-       [AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/sched.h>
-               #include <linux/sched/signal.h>
-       ],[
-               return 0;
-       ],[
-               AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1, [linux/sched/signal.h exists])
-               AC_MSG_RESULT(yes)
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 4.11 API, a528d35e@torvalds/linux
-dnl # vfs_getattr(const struct path *p, struct kstat *s, u32 m, unsigned int f)
-dnl #
-AC_DEFUN([SPL_AC_4ARGS_VFS_GETATTR], [
-       AC_MSG_CHECKING([whether vfs_getattr() wants 4 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_getattr((const struct path *)NULL,
-                       (struct kstat *)NULL,
-                       (u32)0,
-                       (unsigned int)0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_4ARGS_VFS_GETATTR, 1,
-                 [vfs_getattr wants 4 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 3.9 API 
-dnl # vfs_getattr(struct path *p, struct kstat *s)
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
-       AC_MSG_CHECKING([whether vfs_getattr() wants 2 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_getattr((struct path *) NULL,
-                       (struct kstat *)NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
-                         [vfs_getattr wants 2 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # <3.9 API 
-dnl # vfs_getattr(struct vfsmount *v, struct dentry *d, struct kstat *k)
-dnl #
-AC_DEFUN([SPL_AC_3ARGS_VFS_GETATTR], [
-       AC_MSG_CHECKING([whether vfs_getattr() wants 3 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_getattr((struct vfsmount *)NULL,
-                       (struct dentry *)NULL,
-                       (struct kstat *)NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_3ARGS_VFS_GETATTR, 1,
-                 [vfs_getattr wants 3 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 2.6.36 API compatibility.
-dnl # Added usleep_range timer.
-dnl # usleep_range is a finer precision implementation of msleep
-dnl # designed to be a drop-in replacement for udelay where a precise
-dnl # sleep / busy-wait is unnecessary.
-dnl #
-AC_DEFUN([SPL_AC_USLEEP_RANGE], [
-       AC_MSG_CHECKING([whether usleep_range() is available])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/delay.h>
-       ],[
-               usleep_range(0, 0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_USLEEP_RANGE, 1,
-                         [usleep_range is available])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 2.6.35 API change,
-dnl # The cachep->gfpflags member was renamed cachep->allocflags.  These are
-dnl # private allocation flags which are applied when allocating a new slab
-dnl # in kmem_getpages().  Unfortunately there is no public API for setting
-dnl # non-default flags.
-dnl #
-AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
-       AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               struct kmem_cache cachep __attribute__ ((unused));
-               cachep.allocflags = GFP_KERNEL;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
-                       [struct kmem_cache has allocflags])
-       ],[
-               AC_MSG_RESULT(no)
-
-               AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
-               SPL_LINUX_TRY_COMPILE([
-                       #include <linux/slab.h>
-               ],[
-                       struct kmem_cache cachep __attribute__ ((unused));
-                       cachep.gfpflags = GFP_KERNEL;
-               ],[
-                       AC_MSG_RESULT(yes)
-                       AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
-                               [struct kmem_cache has gfpflags])
-               ],[
-                       AC_MSG_RESULT(no)
-               ])
-       ])
-])
-
-dnl #
-dnl # 3.17 API change,
-dnl # wait_on_bit() no longer requires an action argument. The former
-dnl # "wait_on_bit" interface required an 'action' function to be provided
-dnl # which does the actual waiting. There were over 20 such functions in the
-dnl # kernel, many of them identical, though most cases can be satisfied by one
-dnl # of just two functions: one which uses io_schedule() and one which just
-dnl # uses schedule().  This API change was made to consolidate all of those
-dnl # redundant wait functions.
-dnl #
-AC_DEFUN([SPL_AC_WAIT_ON_BIT], [
-       AC_MSG_CHECKING([whether wait_on_bit() takes an action])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/wait.h>
-       ],[
-               int (*action)(void *) = NULL;
-               wait_on_bit(NULL, 0, action, 0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_WAIT_ON_BIT_ACTION, 1, [yes])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 4.7 API change
-dnl # i_mutex is changed to i_rwsem. Instead of directly using
-dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
-dnl # We test inode_lock_shared because inode_lock is introduced earlier.
-dnl #
-AC_DEFUN([SPL_AC_INODE_LOCK], [
-       AC_MSG_CHECKING([whether inode_lock_shared() exists])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               struct inode *inode = NULL;
-               inode_lock_shared(inode);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # Check whether mutex has owner with task_struct type.
-dnl #
-dnl # Note that before Linux 3.0, mutex owner is of type thread_info.
-dnl #
-dnl # Note that in Linux 3.18, the condition for owner is changed from
-dnl # defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) to
-dnl # defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_MUTEX_SPIN_ON_OWNER)
-dnl #
-AC_DEFUN([SPL_AC_MUTEX_OWNER], [
-       AC_MSG_CHECKING([whether mutex has owner])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/mutex.h>
-               #include <linux/spinlock.h>
-       ],[
-               DEFINE_MUTEX(m);
-               struct task_struct *t __attribute__ ((unused));
-               t = m.owner;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_MUTEX_OWNER, 1, [yes])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.9 API change
-dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
-dnl #
-AC_DEFUN([SPL_AC_GROUP_INFO_GID], [
-       AC_MSG_CHECKING([whether group_info->gid exists])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/cred.h>
-       ],[
-               struct group_info *gi = groups_alloc(1);
-               gi->gid[0] = KGIDT_INIT(0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])