Linux 3.2 compat: set_nlink()
[zfs.git] / configure
index 4cf8c54..e9e2ec1 100755 (executable)
--- a/configure
+++ b/configure
@@ -817,6 +817,12 @@ DEFAULT_INIT_SCRIPT
 DEFAULT_INIT_DIR
 DEFAULT_PACKAGE
 VENDOR
+MAKEPKG_VERSION
+MAKEPKG
+HAVE_MAKEPKG
+PACMAN_VERSION
+PACMAN
+HAVE_PACMAN
 ALIEN_VERSION
 ALIEN
 HAVE_ALIEN
@@ -4829,13 +4835,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4832: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4838: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4835: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4841: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4838: output\"" >&5)
+  (eval echo "\"\$as_me:4844: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -6041,7 +6047,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6044 "configure"' > conftest.$ac_ext
+  echo '#line 6050 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7894,11 +7900,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7897: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7903: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7901: \$? = $ac_status" >&5
+   echo "$as_me:7907: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8233,11 +8239,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8236: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8242: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8240: \$? = $ac_status" >&5
+   echo "$as_me:8246: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8338,11 +8344,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8341: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8347: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8345: \$? = $ac_status" >&5
+   echo "$as_me:8351: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8393,11 +8399,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8396: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8402: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8400: \$? = $ac_status" >&5
+   echo "$as_me:8406: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11196,7 +11202,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11199 "configure"
+#line 11205 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11292,7 +11298,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11295 "configure"
+#line 11301 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+       PACMAN=pacman
+       MAKEPKG=makepkg
+
+       { $as_echo "$as_me:$LINENO: checking whether $PACMAN is available" >&5
+$as_echo_n "checking whether $PACMAN is available... " >&6; }
+       tmp=$($PACMAN --version 2>/dev/null)
+       if test -n "$tmp"; then
+
+               PACMAN_VERSION=$(echo $tmp |
+                                $AWK '/Pacman/ { print $3 }' |
+                                $SED 's/^v//')
+               HAVE_PACMAN=yes
+               { $as_echo "$as_me:$LINENO: result: $HAVE_PACMAN ($PACMAN_VERSION)" >&5
+$as_echo "$HAVE_PACMAN ($PACMAN_VERSION)" >&6; }
+
+else
+
+               HAVE_PACMAN=no
+               { $as_echo "$as_me:$LINENO: result: $HAVE_PACMAN" >&5
+$as_echo "$HAVE_PACMAN" >&6; }
+
+fi
+
+
+       { $as_echo "$as_me:$LINENO: checking whether $MAKEPKG is available" >&5
+$as_echo_n "checking whether $MAKEPKG is available... " >&6; }
+       tmp=$($MAKEPKG --version 2>/dev/null)
+       if test -n "$tmp"; then
+
+               MAKEPKG_VERSION=$(echo $tmp | $AWK '/makepkg/ { print $3 }')
+               HAVE_MAKEPKG=yes
+               { $as_echo "$as_me:$LINENO: result: $HAVE_MAKEPKG ($MAKEPKG_VERSION)" >&5
+$as_echo "$HAVE_MAKEPKG ($MAKEPKG_VERSION)" >&6; }
+
+else
+
+               HAVE_MAKEPKG=no
+               { $as_echo "$as_me:$LINENO: result: $HAVE_MAKEPKG" >&5
+$as_echo "$HAVE_MAKEPKG" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+
+
+
        { $as_echo "$as_me:$LINENO: checking linux distribution" >&5
 $as_echo_n "checking linux distribution... " >&6; }
        if test -f /etc/redhat-release ; then
@@ -11825,6 +11883,7 @@ $as_echo_n "checking default package type... " >&6; }
                slackware)  DEFAULT_PACKAGE=tgz ;;
                gentoo)     DEFAULT_PACKAGE=tgz ;;
                lunar)      DEFAULT_PACKAGE=tgz ;;
+               arch)       DEFAULT_PACKAGE=arch;;
                *)          DEFAULT_PACKAGE=rpm ;;
        esac
 
        { $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
 $as_echo_n "checking kernel source directory... " >&6; }
        if test -z "$kernelsrc"; then
+
                if test -e "/lib/modules/$(uname -r)/source"; then
+
                        headersdir="/lib/modules/$(uname -r)/source"
                        sourcelink=$(readlink -f "$headersdir")
-               elif test -e "/lib/modules/$(uname -r)/build"; then
+
+elif test -e "/lib/modules/$(uname -r)/build"; then
+
                        headersdir="/lib/modules/$(uname -r)/build"
                        sourcelink=$(readlink -f "$headersdir")
-               else
+
+else
+
                        sourcelink=$(ls -1d /usr/src/kernels/* \
-                                    /usr/src/linux-* \
+                                    /usr/src/linux-* \
                                     2>/dev/null | grep -v obj | tail -1)
-               fi
+
+fi
+
 
                if test -n "$sourcelink" && test -e ${sourcelink}; then
+
                        kernelsrc=`readlink -f ${sourcelink}`
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
@@ -12009,30 +12079,53 @@ $as_echo "$as_me: error:
        *** is installed then try again.  If that fails you can specify the
        *** location of the kernel source with the '--with-linux=PATH' option." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                if test "$kernelsrc" = "NONE"; then
+
                        kernsrcver=NONE
-               fi
-       fi
+
+fi
+
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $kernelsrc" >&5
 $as_echo "$kernelsrc" >&6; }
        { $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
 $as_echo_n "checking kernel build directory... " >&6; }
        if test -z "$kernelbuild"; then
+
                if test -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
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
-               elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/default
-               elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+
+elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+
                        kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
-               else
+
+else
+
                        kernelbuild=${kernelsrc}
-               fi
-       fi
+
+fi
+
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $kernelbuild" >&5
 $as_echo "$kernelbuild" >&6; }
 
@@ -12042,33 +12135,48 @@ $as_echo_n "checking kernel source version... " >&6; }
        utsrelease2=$kernelbuild/include/linux/utsrelease.h
        utsrelease3=$kernelbuild/include/generated/utsrelease.h
        if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+
                utsrelease=linux/version.h
-       elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+
+elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+
                utsrelease=linux/utsrelease.h
-       elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+
+elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+
                utsrelease=generated/utsrelease.h
-       fi
+
+fi
+
 
        if test "$utsrelease"; then
+
                kernsrcver=`(echo "#include <$utsrelease>";
                             echo "kernsrcver=UTS_RELEASE") |
                             cpp -I $kernelbuild/include |
                             grep "^kernsrcver=" | cut -d \" -f 2`
 
                if test -z "$kernsrcver"; then
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error: *** Cannot determine kernel version." >&5
 $as_echo "$as_me: error: *** Cannot determine kernel version." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                { { $as_echo "$as_me:$LINENO: error: *** Cannot find UTS_RELEASE definition." >&5
 $as_echo "$as_me: error: *** Cannot find UTS_RELEASE definition." >&2;}
    { (exit 1); exit 1; }; }
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $kernsrcver" >&5
 $as_echo "$kernsrcver" >&6; }
@@ -12086,13 +12194,20 @@ $as_echo "$kernsrcver" >&6; }
        { $as_echo "$as_me:$LINENO: checking kernel file name for module symbols" >&5
 $as_echo_n "checking kernel file name for module symbols... " >&6; }
        if test -f "$modpost"; then
+
                if grep -q Modules.symvers $modpost; then
+
                        LINUX_SYMBOLS=Modules.symvers
-               else
+
+else
+
                        LINUX_SYMBOLS=Module.symvers
-               fi
 
-               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+fi
+
+
+               if test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+
                        { { $as_echo "$as_me:$LINENO: error:
        *** Please make sure the kernel devel package for your distribution
        *** is installed.  If your building with a custom kernel make sure the
@@ -12104,10 +12219,16 @@ $as_echo "$as_me: error:
        *** kernel is configured, built, and the '--with-linux=PATH' configure
        *** option refers to the location of the kernel source." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                LINUX_SYMBOLS=NONE
-       fi
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $LINUX_SYMBOLS" >&5
 $as_echo "$LINUX_SYMBOLS" >&6; }
 
        { $as_echo "$as_me:$LINENO: checking spl source directory" >&5
 $as_echo_n "checking spl source directory... " >&6; }
        if test -z "$splsrc"; then
+
                sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
                            2>/dev/null | tail -1`
 
                if test -z "$sourcelink" || test ! -e $sourcelink; then
+
                        sourcelink=../spl
-               fi
+
+fi
+
 
                if test -e $sourcelink; then
+
                        splsrc=`readlink -f ${sourcelink}`
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
@@ -12153,21 +12281,33 @@ $as_echo "$as_me: error:
        *** is installed then try again.  If that fails you can specify the
        *** location of the spl source with the '--with-spl=PATH' option." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                if test "$splsrc" = "NONE"; then
+
                        splbuild=NONE
                        splsrcver=NONE
-               fi
-       fi
+
+fi
+
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $splsrc" >&5
 $as_echo "$splsrc" >&6; }
        { $as_echo "$as_me:$LINENO: checking spl build directory" >&5
 $as_echo_n "checking spl build directory... " >&6; }
        if test -z "$splbuild"; then
+
                splbuild=${splsrc}
-       fi
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
 $as_echo "$splbuild" >&6; }
 
@@ -12176,13 +12316,17 @@ $as_echo_n "checking spl source version... " >&6; }
        if test -r $splbuild/spl_config.h &&
                fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then
 
+
                splsrcver=`(echo "#include <spl_config.h>";
                            echo "splsrcver=SPL_META_VERSION") |
                            cpp -I $splbuild |
                            grep "^splsrcver=" | cut -d \" -f 2`
-       fi
+
+fi
+
 
        if test -z "$splsrcver"; then
+
                { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                { { $as_echo "$as_me:$LINENO: error:
@@ -12192,7 +12336,9 @@ $as_echo "$as_me: error:
        *** Cannot determine the version of the spl source.
        *** Please prepare the spl source before running this script" >&2;}
    { (exit 1); exit 1; }; }
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
 $as_echo "$splsrcver" >&6; }
@@ -12209,16 +12355,27 @@ $as_echo "$splsrcver" >&6; }
        { $as_echo "$as_me:$LINENO: checking spl file name for module symbols" >&5
 $as_echo_n "checking spl file name for module symbols... " >&6; }
        if test -r $SPL_OBJ/Module.symvers; then
+
                SPL_SYMBOLS=Module.symvers
-       elif test -r $SPL_OBJ/Modules.symvers; then
+
+elif test -r $SPL_OBJ/Modules.symvers; then
+
                SPL_SYMBOLS=Modules.symvers
-       elif test -r $SPL_OBJ/module/Module.symvers; then
+
+elif test -r $SPL_OBJ/module/Module.symvers; then
+
                SPL_SYMBOLS=Module.symvers
-       elif test -r $SPL_OBJ/module/Modules.symvers; then
+
+elif test -r $SPL_OBJ/module/Modules.symvers; then
+
                SPL_SYMBOLS=Modules.symvers
-       else
+
+else
+
                SPL_SYMBOLS=$LINUX_SYMBOLS
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $SPL_SYMBOLS" >&5
 $as_echo "$SPL_SYMBOLS" >&6; }
@@ -12298,6 +12455,7 @@ fi
 
 
        if test "$ZFS_META_LICENSE" = CDDL; then
+
                { $as_echo "$as_me:$LINENO: checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC" >&5
 $as_echo_n "checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC... " >&6; }
 
 
 
 
-       fi
+
+fi
+
 
        if test "$ZFS_META_LICENSE" = GPL; then
 
+
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GPL_ONLY_SYMBOLS 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
        { $as_echo "$as_me:$LINENO: checking block device operation prototypes" >&5
 $as_echo_n "checking block device operation prototypes... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -12459,6 +12624,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
        { $as_echo "$as_me:$LINENO: checking whether kernel defines fmode_t" >&5
 $as_echo_n "checking whether kernel defines fmode_t... " >&6; }
@@ -12597,20 +12763,27 @@ $as_echo_n "checking whether symbol blkdev_get_by_path is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(blkdev_get_by_path)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -12618,8 +12791,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_BLKDEV_GET_BY_PATH 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -12627,7 +12804,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_BLKDEV_GET_BY_PATH 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -12637,20 +12816,27 @@ $as_echo_n "checking whether symbol open_bdev_exclusive is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(open_bdev_exclusive)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -12658,8 +12844,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPEN_BDEV_EXCLUSIVE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -12667,7 +12857,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPEN_BDEV_EXCLUSIVE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -12739,6 +12931,8 @@ fi
 
        { $as_echo "$as_me:$LINENO: checking whether bdev_logical_block_size() is available" >&5
 $as_echo_n "checking whether bdev_logical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -12801,6 +12995,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether bio_empty_barrier() is defined" >&5
@@ -13341,6 +13536,8 @@ fi
 
        { $as_echo "$as_me:$LINENO: checking whether blk_end_request() is available" >&5
 $as_echo_n "checking whether blk_end_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_fetch_request() is available" >&5
 $as_echo_n "checking whether blk_fetch_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_requeue_request() is available" >&5
 $as_echo_n "checking whether blk_requeue_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_bytes() is available" >&5
 $as_echo_n "checking whether blk_rq_bytes() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_pos() is available" >&5
 $as_echo_n "checking whether blk_rq_pos() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_sectors() is available" >&5
 $as_echo_n "checking whether blk_rq_sectors() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether get_disk_ro() is available" >&5
 $as_echo_n "checking whether get_disk_ro() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether rq_is_sync() is available" >&5
 $as_echo_n "checking whether rq_is_sync() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether rq_for_each_segment() is available" >&5
 $as_echo_n "checking whether rq_for_each_segment() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14070,6 +14291,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
        { $as_echo "$as_me:$LINENO: checking whether super_block uses const struct xattr_hander" >&5
 $as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; }
@@ -14288,8 +14510,9 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants 2 args" >&5
-$as_echo_n "checking whether fops->fsync() wants 2 args... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5
+$as_echo_n "checking whether fops->fsync() wants... " >&6; }
+
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14306,7 +14529,7 @@ int
 main (void)
 {
 
-               int (*fsync) (struct file *, int datasync) = NULL;
+               int (*fsync) (struct file *, struct dentry *, int) = NULL;
                struct file_operations fops __attribute__ ((unused));
 
                fops.fsync = fsync;
@@ -14332,11 +14555,11 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+               { $as_echo "$as_me:$LINENO: result: dentry" >&5
+$as_echo "dentry" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_2ARGS_FSYNC 1
+#define HAVE_FSYNC_WITH_DENTRY 1
 _ACEOF
 
 
@@ -14344,8 +14567,6 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
 
 
 
 
 
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               int (*fsync) (struct file *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: no dentry" >&5
+$as_echo "no dentry" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSYNC_WITHOUT_DENTRY 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: range" >&5
+$as_echo "range" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSYNC_RANGE 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
+
        { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5
 $as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
 
@@ -14430,20 +14780,27 @@ $as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/inode.c; do
                        grep -q -E "EXPORT_SYMBOL.*(insert_inode_locked)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14451,8 +14808,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14460,7 +14821,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -14470,20 +14833,27 @@ $as_echo_n "checking whether symbol d_obtain_alias is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/dcache.c; do
                        grep -q -E "EXPORT_SYMBOL.*(d_obtain_alias)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14491,8 +14861,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_D_OBTAIN_ALIAS 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14500,7 +14874,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_D_OBTAIN_ALIAS 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -14510,20 +14886,27 @@ $as_echo_n "checking whether symbol check_disk_size_change is exported... " >&6;
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(check_disk_size_change)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14531,8 +14914,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14540,7 +14927,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -14550,20 +14939,27 @@ $as_echo_n "checking whether symbol truncate_setsize is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in mm/truncate.c; do
                        grep -q -E "EXPORT_SYMBOL.*(truncate_setsize)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14571,8 +14967,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_TRUNCATE_SETSIZE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14580,7 +14980,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_TRUNCATE_SETSIZE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -14658,20 +15060,27 @@ $as_echo_n "checking whether symbol mount_nodev is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/super.c; do
                        grep -q -E "EXPORT_SYMBOL.*(mount_nodev)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14679,8 +15088,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_MOUNT_NODEV 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -14688,7 +15101,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_MOUNT_NODEV 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
 
 
 
-       if test "$LINUX_OBJ" != "$LINUX"; then
-               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
-       fi
+       { $as_echo "$as_me:$LINENO: checking whether symbol bdi_setup_and_register is exported" >&5
+$as_echo_n "checking whether symbol bdi_setup_and_register is exported... " >&6; }
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
 
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
 
+                               export=1
+                               break;
 
-                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
-       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
-       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
+fi
 
+               done
+               if test $export -eq 0; then
 
- ;;
-               user)
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+else
+
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDI_SETUP_AND_REGISTER 1
+_ACEOF
+
+
+fi
+
+
+else
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDI_SETUP_AND_REGISTER 1
+_ACEOF
+
+
+fi
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode node;
+               unsigned int link = 0;
+               (void) set_nlink(&node, link);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SET_NLINK 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
+       if test "$LINUX_OBJ" != "$LINUX"; then
+
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+
+fi
+
+
+
+
+                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
+
+
+ ;;
+               user)
 
 
 # Check whether --with-udevdir was given.
        { $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
 $as_echo_n "checking kernel source directory... " >&6; }
        if test -z "$kernelsrc"; then
+
                if test -e "/lib/modules/$(uname -r)/source"; then
+
                        headersdir="/lib/modules/$(uname -r)/source"
                        sourcelink=$(readlink -f "$headersdir")
-               elif test -e "/lib/modules/$(uname -r)/build"; then
+
+elif test -e "/lib/modules/$(uname -r)/build"; then
+
                        headersdir="/lib/modules/$(uname -r)/build"
                        sourcelink=$(readlink -f "$headersdir")
-               else
+
+else
+
                        sourcelink=$(ls -1d /usr/src/kernels/* \
-                                    /usr/src/linux-* \
+                                    /usr/src/linux-* \
                                     2>/dev/null | grep -v obj | tail -1)
-               fi
+
+fi
+
 
                if test -n "$sourcelink" && test -e ${sourcelink}; then
+
                        kernelsrc=`readlink -f ${sourcelink}`
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
@@ -16367,30 +16916,53 @@ $as_echo "$as_me: error:
        *** is installed then try again.  If that fails you can specify the
        *** location of the kernel source with the '--with-linux=PATH' option." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                if test "$kernelsrc" = "NONE"; then
+
                        kernsrcver=NONE
-               fi
-       fi
+
+fi
+
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $kernelsrc" >&5
 $as_echo "$kernelsrc" >&6; }
        { $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
 $as_echo_n "checking kernel build directory... " >&6; }
        if test -z "$kernelbuild"; then
+
                if test -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
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
-               elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/default
-               elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+
+elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+
                        kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
-               else
+
+else
+
                        kernelbuild=${kernelsrc}
-               fi
-       fi
+
+fi
+
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $kernelbuild" >&5
 $as_echo "$kernelbuild" >&6; }
 
@@ -16400,33 +16972,48 @@ $as_echo_n "checking kernel source version... " >&6; }
        utsrelease2=$kernelbuild/include/linux/utsrelease.h
        utsrelease3=$kernelbuild/include/generated/utsrelease.h
        if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+
                utsrelease=linux/version.h
-       elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+
+elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+
                utsrelease=linux/utsrelease.h
-       elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+
+elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+
                utsrelease=generated/utsrelease.h
-       fi
+
+fi
+
 
        if test "$utsrelease"; then
+
                kernsrcver=`(echo "#include <$utsrelease>";
                             echo "kernsrcver=UTS_RELEASE") |
                             cpp -I $kernelbuild/include |
                             grep "^kernsrcver=" | cut -d \" -f 2`
 
                if test -z "$kernsrcver"; then
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error: *** Cannot determine kernel version." >&5
 $as_echo "$as_me: error: *** Cannot determine kernel version." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                { { $as_echo "$as_me:$LINENO: error: *** Cannot find UTS_RELEASE definition." >&5
 $as_echo "$as_me: error: *** Cannot find UTS_RELEASE definition." >&2;}
    { (exit 1); exit 1; }; }
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $kernsrcver" >&5
 $as_echo "$kernsrcver" >&6; }
@@ -16444,13 +17031,20 @@ $as_echo "$kernsrcver" >&6; }
        { $as_echo "$as_me:$LINENO: checking kernel file name for module symbols" >&5
 $as_echo_n "checking kernel file name for module symbols... " >&6; }
        if test -f "$modpost"; then
+
                if grep -q Modules.symvers $modpost; then
+
                        LINUX_SYMBOLS=Modules.symvers
-               else
+
+else
+
                        LINUX_SYMBOLS=Module.symvers
-               fi
 
-               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+fi
+
+
+               if test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+
                        { { $as_echo "$as_me:$LINENO: error:
        *** Please make sure the kernel devel package for your distribution
        *** is installed.  If your building with a custom kernel make sure the
@@ -16462,10 +17056,16 @@ $as_echo "$as_me: error:
        *** kernel is configured, built, and the '--with-linux=PATH' configure
        *** option refers to the location of the kernel source." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                LINUX_SYMBOLS=NONE
-       fi
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $LINUX_SYMBOLS" >&5
 $as_echo "$LINUX_SYMBOLS" >&6; }
 
        { $as_echo "$as_me:$LINENO: checking spl source directory" >&5
 $as_echo_n "checking spl source directory... " >&6; }
        if test -z "$splsrc"; then
+
                sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
                            2>/dev/null | tail -1`
 
                if test -z "$sourcelink" || test ! -e $sourcelink; then
+
                        sourcelink=../spl
-               fi
+
+fi
+
 
                if test -e $sourcelink; then
+
                        splsrc=`readlink -f ${sourcelink}`
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
@@ -16511,21 +17118,33 @@ $as_echo "$as_me: error:
        *** is installed then try again.  If that fails you can specify the
        *** location of the spl source with the '--with-spl=PATH' option." >&2;}
    { (exit 1); exit 1; }; }
-               fi
-       else
+
+fi
+
+
+else
+
                if test "$splsrc" = "NONE"; then
+
                        splbuild=NONE
                        splsrcver=NONE
-               fi
-       fi
+
+fi
+
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $splsrc" >&5
 $as_echo "$splsrc" >&6; }
        { $as_echo "$as_me:$LINENO: checking spl build directory" >&5
 $as_echo_n "checking spl build directory... " >&6; }
        if test -z "$splbuild"; then
+
                splbuild=${splsrc}
-       fi
+
+fi
+
        { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
 $as_echo "$splbuild" >&6; }
 
@@ -16534,13 +17153,17 @@ $as_echo_n "checking spl source version... " >&6; }
        if test -r $splbuild/spl_config.h &&
                fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then
 
+
                splsrcver=`(echo "#include <spl_config.h>";
                            echo "splsrcver=SPL_META_VERSION") |
                            cpp -I $splbuild |
                            grep "^splsrcver=" | cut -d \" -f 2`
-       fi
+
+fi
+
 
        if test -z "$splsrcver"; then
+
                { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                { { $as_echo "$as_me:$LINENO: error:
@@ -16550,7 +17173,9 @@ $as_echo "$as_me: error:
        *** Cannot determine the version of the spl source.
        *** Please prepare the spl source before running this script" >&2;}
    { (exit 1); exit 1; }; }
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
 $as_echo "$splsrcver" >&6; }
@@ -16567,16 +17192,27 @@ $as_echo "$splsrcver" >&6; }
        { $as_echo "$as_me:$LINENO: checking spl file name for module symbols" >&5
 $as_echo_n "checking spl file name for module symbols... " >&6; }
        if test -r $SPL_OBJ/Module.symvers; then
+
                SPL_SYMBOLS=Module.symvers
-       elif test -r $SPL_OBJ/Modules.symvers; then
+
+elif test -r $SPL_OBJ/Modules.symvers; then
+
                SPL_SYMBOLS=Modules.symvers
-       elif test -r $SPL_OBJ/module/Module.symvers; then
+
+elif test -r $SPL_OBJ/module/Module.symvers; then
+
                SPL_SYMBOLS=Module.symvers
-       elif test -r $SPL_OBJ/module/Modules.symvers; then
-               SPL_SYMBOLS=Modules.symvers
-       else
+
+elif test -r $SPL_OBJ/module/Modules.symvers; then
+
+               SPL_SYMBOLS=Modules.symvers
+
+else
+
                SPL_SYMBOLS=$LINUX_SYMBOLS
-       fi
+
+fi
+
 
        { $as_echo "$as_me:$LINENO: result: $SPL_SYMBOLS" >&5
 $as_echo "$SPL_SYMBOLS" >&6; }
@@ -16656,6 +17292,7 @@ fi
 
 
        if test "$ZFS_META_LICENSE" = CDDL; then
+
                { $as_echo "$as_me:$LINENO: checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC" >&5
 $as_echo_n "checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC... " >&6; }
 
 
 
 
-       fi
+
+fi
+
 
        if test "$ZFS_META_LICENSE" = GPL; then
 
+
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GPL_ONLY_SYMBOLS 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
        { $as_echo "$as_me:$LINENO: checking block device operation prototypes" >&5
 $as_echo_n "checking block device operation prototypes... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -16817,6 +17461,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
        { $as_echo "$as_me:$LINENO: checking whether kernel defines fmode_t" >&5
 $as_echo_n "checking whether kernel defines fmode_t... " >&6; }
@@ -16955,20 +17600,27 @@ $as_echo_n "checking whether symbol blkdev_get_by_path is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(blkdev_get_by_path)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -16976,8 +17628,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_BLKDEV_GET_BY_PATH 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -16985,7 +17641,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_BLKDEV_GET_BY_PATH 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -16995,20 +17653,27 @@ $as_echo_n "checking whether symbol open_bdev_exclusive is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(open_bdev_exclusive)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -17016,8 +17681,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPEN_BDEV_EXCLUSIVE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -17025,7 +17694,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPEN_BDEV_EXCLUSIVE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -17097,6 +17768,8 @@ fi
 
        { $as_echo "$as_me:$LINENO: checking whether bdev_logical_block_size() is available" >&5
 $as_echo_n "checking whether bdev_logical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -17159,6 +17832,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether bio_empty_barrier() is defined" >&5
@@ -17699,6 +18373,8 @@ fi
 
        { $as_echo "$as_me:$LINENO: checking whether blk_end_request() is available" >&5
 $as_echo_n "checking whether blk_end_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_fetch_request() is available" >&5
 $as_echo_n "checking whether blk_fetch_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_requeue_request() is available" >&5
 $as_echo_n "checking whether blk_requeue_request() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_bytes() is available" >&5
 $as_echo_n "checking whether blk_rq_bytes() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_pos() is available" >&5
 $as_echo_n "checking whether blk_rq_pos() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether blk_rq_sectors() is available" >&5
 $as_echo_n "checking whether blk_rq_sectors() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether get_disk_ro() is available" >&5
 $as_echo_n "checking whether get_disk_ro() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether rq_is_sync() is available" >&5
 $as_echo_n "checking whether rq_is_sync() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
        { $as_echo "$as_me:$LINENO: checking whether rq_for_each_segment() is available" >&5
 $as_echo_n "checking whether rq_for_each_segment() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18428,6 +19128,7 @@ fi
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
        { $as_echo "$as_me:$LINENO: checking whether super_block uses const struct xattr_hander" >&5
 $as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; }
@@ -18646,8 +19347,9 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants 2 args" >&5
-$as_echo_n "checking whether fops->fsync() wants 2 args... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5
+$as_echo_n "checking whether fops->fsync() wants... " >&6; }
+
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18664,7 +19366,7 @@ int
 main (void)
 {
 
-               int (*fsync) (struct file *, int datasync) = NULL;
+               int (*fsync) (struct file *, struct dentry *, int) = NULL;
                struct file_operations fops __attribute__ ((unused));
 
                fops.fsync = fsync;
@@ -18690,11 +19392,11 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+               { $as_echo "$as_me:$LINENO: result: dentry" >&5
+$as_echo "dentry" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_2ARGS_FSYNC 1
+#define HAVE_FSYNC_WITH_DENTRY 1
 _ACEOF
 
 
@@ -18702,8 +19404,6 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
 
 
 
 
 
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               int (*fsync) (struct file *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: no dentry" >&5
+$as_echo "no dentry" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSYNC_WITHOUT_DENTRY 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: range" >&5
+$as_echo "range" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSYNC_RANGE 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
+
        { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5
 $as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
 
@@ -18788,20 +19617,27 @@ $as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/inode.c; do
                        grep -q -E "EXPORT_SYMBOL.*(insert_inode_locked)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18809,8 +19645,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18818,7 +19658,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -18828,20 +19670,27 @@ $as_echo_n "checking whether symbol d_obtain_alias is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/dcache.c; do
                        grep -q -E "EXPORT_SYMBOL.*(d_obtain_alias)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18849,8 +19698,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_D_OBTAIN_ALIAS 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18858,7 +19711,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_D_OBTAIN_ALIAS 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -18868,20 +19723,27 @@ $as_echo_n "checking whether symbol check_disk_size_change is exported... " >&6;
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/block_dev.c; do
                        grep -q -E "EXPORT_SYMBOL.*(check_disk_size_change)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18889,8 +19751,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18898,7 +19764,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -18908,20 +19776,27 @@ $as_echo_n "checking whether symbol truncate_setsize is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in mm/truncate.c; do
                        grep -q -E "EXPORT_SYMBOL.*(truncate_setsize)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18929,8 +19804,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_TRUNCATE_SETSIZE 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -18938,7 +19817,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_TRUNCATE_SETSIZE 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
@@ -19016,20 +19897,27 @@ $as_echo_n "checking whether symbol mount_nodev is exported... " >&6; }
                $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
        rc=$?
        if test $rc -ne 0; then
+
                export=0
                for file in fs/super.c; do
                        grep -q -E "EXPORT_SYMBOL.*(mount_nodev)" "$LINUX/$file" 2>/dev/null
                        rc=$?
-                       if test $rc -eq 0; then
-                               export=1
-                               break;
-                       fi
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
                done
                if test $export -eq 0; then
+
                        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
-               else
+
+else
+
                        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -19037,8 +19925,12 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_MOUNT_NODEV 1
 _ACEOF
 
-               fi
-       else
+
+fi
+
+
+else
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
@@ -19046,7 +19938,9 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_MOUNT_NODEV 1
 _ACEOF
 
-       fi
+
+fi
+
 
 
 
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether symbol bdi_setup_and_register is exported" >&5
+$as_echo_n "checking whether symbol bdi_setup_and_register is exported... " >&6; }
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+
+                               export=1
+                               break;
+
+fi
+
+               done
+               if test $export -eq 0; then
+
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+else
+
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDI_SETUP_AND_REGISTER 1
+_ACEOF
+
+
+fi
+
+
+else
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDI_SETUP_AND_REGISTER 1
+_ACEOF
+
+
+fi
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode node;
+               unsigned int link = 0;
+               (void) set_nlink(&node, link);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build
+       echo "obj-m := conftest.o" >build/Makefile
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SET_NLINK 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+
+
        if test "$LINUX_OBJ" != "$LINUX"; then
+
                KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
-       fi
+
+fi
+
 
 
 
@@ -20744,7 +21761,7 @@ fi
 $as_echo "$enable_debug" >&6; }
 
 
-ac_config_files="$ac_config_files Makefile dracut/Makefile dracut/90zfs/Makefile udev/Makefile udev/rules.d/Makefile etc/Makefile etc/init.d/Makefile etc/zfs/Makefile man/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/Makefile lib/libshare/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/zpool_layout/Makefile cmd/zvol_id/Makefile cmd/zpool_id/Makefile cmd/sas_switch_id/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/zpool-layout/Makefile scripts/common.sh zfs.spec zfs-modules.spec zfs-script-config.sh"
+ac_config_files="$ac_config_files Makefile dracut/Makefile dracut/90zfs/Makefile udev/Makefile udev/rules.d/Makefile etc/Makefile etc/init.d/Makefile etc/zfs/Makefile man/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/Makefile lib/libshare/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/zpool_layout/Makefile cmd/zvol_id/Makefile cmd/zpool_id/Makefile cmd/sas_switch_id/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/zpool-layout/Makefile scripts/common.sh zfs.spec zfs-modules.spec PKGBUILD-zfs PKGBUILD-zfs-modules zfs-script-config.sh"
 
 
 cat >confcache <<\_ACEOF
@@ -21724,6 +22741,8 @@ do
     "scripts/common.sh") CONFIG_FILES="$CONFIG_FILES scripts/common.sh" ;;
     "zfs.spec") CONFIG_FILES="$CONFIG_FILES zfs.spec" ;;
     "zfs-modules.spec") CONFIG_FILES="$CONFIG_FILES zfs-modules.spec" ;;
+    "PKGBUILD-zfs") CONFIG_FILES="$CONFIG_FILES PKGBUILD-zfs" ;;
+    "PKGBUILD-zfs-modules") CONFIG_FILES="$CONFIG_FILES PKGBUILD-zfs-modules" ;;
     "zfs-script-config.sh") CONFIG_FILES="$CONFIG_FILES zfs-script-config.sh" ;;
 
   *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5