Fix build failures on PaX/GRSecurity patched kernels
authorRichard Yao <ryao@cs.stonybrook.edu>
Thu, 31 May 2012 03:25:31 +0000 (23:25 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Jul 2012 16:22:43 +0000 (09:22 -0700)
Gentoo Hardened kernels include the PaX/GRSecurity patches. They use a
dialect of C that relies on a GCC plugin. In particular, struct
file_operations has been marked do_const in the PaX/GRSecurity dialect,
which causes GCC to consider all instances of it as const. This caused
failures in the autotools checks and the ZFS source code.

To address this, we modify the autotools checks to take into account
differences between the PaX C dialect and the regular C dialect. We also
modify struct zfs_acl's z_ops member to be a pointer to a function
pointer table. Lastly, we modify zpl_put_link() to address a PaX change
to the function prototype of nd_get_link().  This avoids compiler errors
in the PaX/GRSecurity dialect.

Note that the change in zpl_put_link() causes a warning that becomes a
build failure when debugging is enabled. Fixing that warning requires
ryao/spl@5ca50ef459c59bc74b7a7cd3af7311da2b1cd2c3.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #484

config/kernel-evict-inode.m4
config/kernel-fallocate.m4
config/kernel-fsync.m4
configure
include/sys/zfs_acl.h
module/zfs/zfs_acl.c
module/zfs/zpl_inode.c

index 0700792..683cedb 100644 (file)
@@ -7,12 +7,12 @@ AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
        AC_MSG_CHECKING([whether sops->evict_inode() exists])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/fs.h>
-       ],[
-               void (*evict_inode) (struct inode *) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
+               void evict_inode (struct inode * t) { return; }
+               static struct super_operations sops __attribute__ ((unused)) = {
                        .evict_inode = evict_inode,
                };
        ],[
+       ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists])
        ],[
index d551276..6ac5ae6 100644 (file)
@@ -39,10 +39,31 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
 ])
 
 dnl #
+dnl # PaX Linux 2.6.38 - 3.x API
+dnl #
+AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
+       AC_MSG_CHECKING([whether fops->fallocate() exists])
+       ZFS_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([ZFS_AC_KERNEL_FALLOCATE], [
        ZFS_AC_KERNEL_FILE_FALLOCATE
        ZFS_AC_KERNEL_INODE_FALLOCATE
+       ZFS_AC_PAX_KERNEL_FILE_FALLOCATE
 ])
index 862b897..ca00d93 100644 (file)
@@ -37,7 +37,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
 ])
 
 dnl #
-dnl # Linux 3.1 -x 3.x API
+dnl # Linux 3.1 - 3.x API
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
        ZFS_LINUX_TRY_COMPILE([
@@ -55,9 +55,69 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
        ])
 ])
 
+dnl #
+dnl # PaX Linux 2.6.x - 2.6.34 API
+dnl #
+AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY], [
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               int (*fsync) (struct file *, struct dentry *, int) = NULL;
+               file_operations_no_const fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+       ],[
+               AC_MSG_RESULT([dentry])
+               AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+                       [fops->fsync() with dentry])
+       ],[
+       ])
+])
+
+dnl #
+dnl # PaX Linux 2.6.35 - Linux 3.0 API
+dnl #
+AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY], [
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               int (*fsync) (struct file *, int) = NULL;
+               file_operations_no_const fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+       ],[
+               AC_MSG_RESULT([no dentry])
+               AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+                       [fops->fsync() without dentry])
+       ],[
+       ])
+])
+
+dnl #
+dnl # PaX Linux 3.1 - 3.x API
+dnl #
+AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_RANGE], [
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+               file_operations_no_const fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
+       ],[
+               AC_MSG_RESULT([range])
+               AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+                       [fops->fsync() with range])
+       ],[
+       ])
+])
+
 AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
        AC_MSG_CHECKING([whether fops->fsync() wants])
        ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
        ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
        ZFS_AC_KERNEL_FSYNC_RANGE
+       ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY
+       ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY
+       ZFS_AC_PAX_KERNEL_FSYNC_RANGE
 ])
index 60b844d..245113e 100755 (executable)
--- a/configure
+++ b/configure
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5
-$as_echo_n "checking whether sops->evict_inode() exists... " >&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 *, struct dentry *, int) = NULL;
+               file_operations_no_const 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: dentry" >&5
+$as_echo "dentry" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSYNC_WITH_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
 main (void)
 {
 
-               void (*evict_inode) (struct inode *) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
+               int (*fsync) (struct file *, int) = NULL;
+               file_operations_no_const 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;
+               file_operations_no_const 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; }
+
+
+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>
+               void evict_inode (struct inode * t) { return; }
+               static struct super_operations sops __attribute__ ((unused)) = {
                        .evict_inode = evict_inode,
                };
 
+int
+main (void)
+{
+
+
   ;
   return 0;
 }
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&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)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations_no_const fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  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_FILE_FALLOCATE 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
+
+
+
+
 
        { $as_echo "$as_me:$LINENO: checking whether iops->create()/mkdir()/mknod() take umode_t" >&5
 $as_echo_n "checking whether iops->create()/mkdir()/mknod() take umode_t... " >&6; }
@@ -19239,48 +19499,316 @@ $as_echo_n "checking whether symbol open_bdev_exclusive is exported... " >&6; }
                        rc=$?
                        if test $rc -eq 0; then
 
-                               export=1
-                               break;
+                               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_OPEN_BDEV_EXCLUSIVE 1
+_ACEOF
+
+
+fi
+
+
+else
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPEN_BDEV_EXCLUSIVE 1
+_ACEOF
+
+
+fi
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether invalidate_bdev() wants 1 arg" >&5
+$as_echo_n "checking whether invalidate_bdev() wants 1 arg... " >&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/buffer_head.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               invalidate_bdev(bdev);
+
+  ;
+  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_1ARG_INVALIDATE_BDEV 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
+
+
+
+
+       { $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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               bdev_logical_block_size(bdev);
+
+  ;
+  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_BDEV_LOGICAL_BLOCK_SIZE 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
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:$LINENO: checking whether bio_empty_barrier() is defined" >&5
+$as_echo_n "checking whether bio_empty_barrier() is defined... " >&6; }
+       EXTRA_KCFLAGS="-Werror"
+
+
+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/bio.h>
+
+int
+main (void)
+{
+
+               struct bio bio;
+               (void)bio_empty_barrier(&bio);
+
+  ;
+  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_BIO_EMPTY_BARRIER 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
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST is defined" >&5
+$as_echo_n "checking whether BIO_RW_FAILFAST is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
 
-fi
+               #include <linux/bio.h>
 
-               done
-               if test $export -eq 0; then
+int
+main (void)
+{
 
-                       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+               int flags __attribute__ ((unused));
+               flags = (1 << BIO_RW_FAILFAST);
+
+  ;
+  return 0;
+}
 
+_ACEOF
 
-else
 
-                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+       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_OPEN_BDEV_EXCLUSIVE 1
+#define HAVE_BIO_RW_FAILFAST 1
 _ACEOF
 
 
-fi
-
-
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_OPEN_BDEV_EXCLUSIVE 1
-_ACEOF
 
 
 fi
 
+       rm -Rf build
+
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether invalidate_bdev() wants 1 arg" >&5
-$as_echo_n "checking whether invalidate_bdev() wants 1 arg... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST_* are defined" >&5
+$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19291,14 +19819,16 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/buffer_head.h>
+               #include <linux/bio.h>
 
 int
 main (void)
 {
 
-               struct block_device *bdev = NULL;
-               invalidate_bdev(bdev);
+               int flags __attribute__ ((unused));
+               flags = ((1 << BIO_RW_FAILFAST_DEV) |
+                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
+                        (1 << BIO_RW_FAILFAST_DRIVER));
 
   ;
   return 0;
@@ -19325,7 +19855,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_1ARG_INVALIDATE_BDEV 1
+#define HAVE_BIO_RW_FAILFAST_DTD 1
 _ACEOF
 
 
 
 
 
-       { $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"
+       { $as_echo "$as_me:$LINENO: checking whether REQ_FAILFAST_MASK is defined" >&5
+$as_echo_n "checking whether REQ_FAILFAST_MASK is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19359,14 +19887,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/blkdev.h>
+               #include <linux/bio.h>
 
 int
 main (void)
 {
 
-               struct block_device *bdev = NULL;
-               bdev_logical_block_size(bdev);
+               int flags __attribute__ ((unused));
+               flags = REQ_FAILFAST_MASK;
 
   ;
   return 0;
@@ -19393,7 +19921,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDEV_LOGICAL_BLOCK_SIZE 1
+#define HAVE_BIO_REQ_FAILFAST_MASK 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether bio_empty_barrier() is defined" >&5
-$as_echo_n "checking whether bio_empty_barrier() is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether bio_end_io_t wants 2 args" >&5
+$as_echo_n "checking whether bio_end_io_t wants 2 args... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="-Werror"
 
 
@@ -19433,8 +19961,10 @@ int
 main (void)
 {
 
-               struct bio bio;
-               (void)bio_empty_barrier(&bio);
+               void (*wanted_end_io)(struct bio *, int) = NULL;
+               bio_end_io_t *local_end_io __attribute__ ((unused));
+
+               local_end_io = wanted_end_io;
 
   ;
   return 0;
@@ -19461,7 +19991,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_EMPTY_BARRIER 1
+#define HAVE_2ARGS_BIO_END_IO_T 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST is defined" >&5
-$as_echo_n "checking whether BIO_RW_FAILFAST is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_SYNC is defined" >&5
+$as_echo_n "checking whether BIO_RW_SYNC is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19500,7 +20031,7 @@ main (void)
 {
 
                int flags __attribute__ ((unused));
-               flags = (1 << BIO_RW_FAILFAST);
+               flags = BIO_RW_SYNC;
 
   ;
   return 0;
@@ -19527,7 +20058,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_FAILFAST 1
+#define HAVE_BIO_RW_SYNC 1
 _ACEOF
 
 
@@ -19547,8 +20078,8 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST_* are defined" >&5
-$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_SYNCIO is defined" >&5
+$as_echo_n "checking whether BIO_RW_SYNCIO is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19566,9 +20097,7 @@ main (void)
 {
 
                int flags __attribute__ ((unused));
-               flags = ((1 << BIO_RW_FAILFAST_DEV) |
-                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
-                        (1 << BIO_RW_FAILFAST_DRIVER));
+               flags = BIO_RW_SYNCIO;
 
   ;
   return 0;
@@ -19595,7 +20124,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_FAILFAST_DTD 1
+#define HAVE_BIO_RW_SYNCIO 1
 _ACEOF
 
 
@@ -19615,8 +20144,8 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether REQ_FAILFAST_MASK is defined" >&5
-$as_echo_n "checking whether REQ_FAILFAST_MASK is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether REQ_SYNC is defined" >&5
+$as_echo_n "checking whether REQ_SYNC is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19634,7 +20163,7 @@ main (void)
 {
 
                int flags __attribute__ ((unused));
-               flags = REQ_FAILFAST_MASK;
+               flags = REQ_SYNC;
 
   ;
   return 0;
@@ -19661,7 +20190,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_REQ_FAILFAST_MASK 1
+#define HAVE_REQ_SYNC 1
 _ACEOF
 
 
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether bio_end_io_t wants 2 args" >&5
-$as_echo_n "checking whether bio_end_io_t wants 2 args... " >&6; }
+       { $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="-Werror"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19695,16 +20224,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/bio.h>
+               #include <linux/blkdev.h>
 
 int
 main (void)
 {
 
-               void (*wanted_end_io)(struct bio *, int) = NULL;
-               bio_end_io_t *local_end_io __attribute__ ((unused));
-
-               local_end_io = wanted_end_io;
+               struct request *req = NULL;
+               (void) blk_end_request(req, 0, 0);
 
   ;
   return 0;
@@ -19731,7 +20258,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_2ARGS_BIO_END_IO_T 1
+#define HAVE_BLK_END_REQUEST 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
-
 
-       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_SYNC is defined" >&5
-$as_echo_n "checking whether BIO_RW_SYNC is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_end_request() is GPL-only" >&5
+$as_echo_n "checking whether blk_end_request() is GPL-only... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19764,14 +20289,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/bio.h>
+               #include <linux/module.h>
+               #include <linux/blkdev.h>
+
+               MODULE_LICENSE("CDDL");
 
 int
 main (void)
 {
 
-               int flags __attribute__ ((unused));
-               flags = BIO_RW_SYNC;
+               struct request *req = NULL;
+               (void) blk_end_request(req, 0, 0);
 
   ;
   return 0;
@@ -19794,21 +20322,21 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_SYNC 1
+#define HAVE_BLK_END_REQUEST_GPL_ONLY 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
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether BIO_RW_SYNCIO is defined" >&5
-$as_echo_n "checking whether BIO_RW_SYNCIO is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_flush() is available" >&5
+$as_echo_n "checking whether blk_queue_flush() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19830,14 +20361,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/bio.h>
+               #include <linux/blkdev.h>
 
 int
 main (void)
 {
 
-               int flags __attribute__ ((unused));
-               flags = BIO_RW_SYNCIO;
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
 
   ;
   return 0;
@@ -19864,7 +20395,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_SYNCIO 1
+#define HAVE_BLK_QUEUE_FLUSH 1
 _ACEOF
 
 
@@ -19883,9 +20414,8 @@ fi
 
 
 
-
-       { $as_echo "$as_me:$LINENO: checking whether REQ_SYNC is defined" >&5
-$as_echo_n "checking whether REQ_SYNC is defined... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_flush() is GPL-only" >&5
+$as_echo_n "checking whether blk_queue_flush() is GPL-only... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19896,14 +20426,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/bio.h>
+               #include <linux/module.h>
+               #include <linux/blkdev.h>
+
+               MODULE_LICENSE("CDDL");
 
 int
 main (void)
 {
 
-               int flags __attribute__ ((unused));
-               flags = REQ_SYNC;
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
 
   ;
   return 0;
@@ -19926,21 +20459,21 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_REQ_SYNC 1
+#define HAVE_BLK_QUEUE_FLUSH_GPL_ONLY 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
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_end_request() is available" >&5
-$as_echo_n "checking whether blk_end_request() is available... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_max_hw_sectors() is available" >&5
+$as_echo_n "checking whether blk_queue_max_hw_sectors() is available... " >&6; }
        tmp_flags="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
@@ -19970,8 +20504,8 @@ int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_end_request(req, 0, 0);
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
 
   ;
   return 0;
@@ -19998,7 +20532,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_END_REQUEST 1
+#define HAVE_BLK_QUEUE_MAX_HW_SECTORS 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_end_request() is GPL-only" >&5
-$as_echo_n "checking whether blk_end_request() is GPL-only... " >&6; }
+
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_max_segments() is available" >&5
+$as_echo_n "checking whether blk_queue_max_segments() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -20029,17 +20567,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/module.h>
                #include <linux/blkdev.h>
 
-               MODULE_LICENSE("CDDL");
-
 int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_end_request(req, 0, 0);
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
 
   ;
   return 0;
@@ -20062,21 +20597,21 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_END_REQUEST_GPL_ONLY 1
+#define HAVE_BLK_QUEUE_MAX_SEGMENTS 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
@@ -20087,8 +20622,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_flush() is available" >&5
-$as_echo_n "checking whether blk_queue_flush() is available... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_physical_block_size() is available" >&5
+$as_echo_n "checking whether blk_queue_physical_block_size() is available... " >&6; }
        tmp_flags="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
@@ -20108,7 +20643,8 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               (void) blk_queue_flush(q, REQ_FLUSH);
+               unsigned short block_size = 1;
+               (void) blk_queue_physical_block_size(q, block_size);
 
   ;
   return 0;
@@ -20135,7 +20671,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_FLUSH 1
+#define HAVE_BLK_QUEUE_PHYSICAL_BLOCK_SIZE 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_flush() is GPL-only" >&5
-$as_echo_n "checking whether blk_queue_flush() is GPL-only... " >&6; }
+
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_io_opt() is available" >&5
+$as_echo_n "checking whether blk_queue_io_opt() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -20166,17 +20706,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/module.h>
                #include <linux/blkdev.h>
 
-               MODULE_LICENSE("CDDL");
-
 int
 main (void)
 {
 
                struct request_queue *q = NULL;
-               (void) blk_queue_flush(q, REQ_FLUSH);
+               unsigned int opt = 1;
+               (void) blk_queue_io_opt(q, opt);
 
   ;
   return 0;
@@ -20199,21 +20737,21 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_FLUSH_GPL_ONLY 1
+#define HAVE_BLK_QUEUE_IO_OPT 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
@@ -20224,8 +20762,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_max_hw_sectors() is available" >&5
-$as_echo_n "checking whether blk_queue_max_hw_sectors() is available... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_nonrot() is available" >&5
+$as_echo_n "checking whether blk_queue_nonrot() is available... " >&6; }
        tmp_flags="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
@@ -20245,7 +20783,7 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
+               (void) blk_queue_nonrot(q);
 
   ;
   return 0;
@@ -20272,7 +20810,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_MAX_HW_SECTORS 1
+#define HAVE_BLK_QUEUE_NONROT 1
 _ACEOF
 
 
@@ -20293,8 +20831,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_max_segments() is available" >&5
-$as_echo_n "checking whether blk_queue_max_segments() is available... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether blk_queue_discard() is available" >&5
+$as_echo_n "checking whether blk_queue_discard() is available... " >&6; }
        tmp_flags="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
 
@@ -20314,7 +20852,7 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
+               (void) blk_queue_discard(q);
 
   ;
   return 0;
@@ -20341,7 +20879,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_MAX_SEGMENTS 1
+#define HAVE_BLK_QUEUE_DISCARD 1
 _ACEOF
 
 
@@ -20362,8 +20900,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_physical_block_size() is available" >&5
-$as_echo_n "checking whether blk_queue_physical_block_size() is available... " >&6; }
+       { $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"
 
@@ -20383,8 +20921,7 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               unsigned short block_size = 1;
-               (void) blk_queue_physical_block_size(q, block_size);
+               (void) blk_fetch_request(q);
 
   ;
   return 0;
@@ -20411,7 +20948,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_PHYSICAL_BLOCK_SIZE 1
+#define HAVE_BLK_FETCH_REQUEST 1
 _ACEOF
 
 
@@ -20432,8 +20969,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_io_opt() is available" >&5
-$as_echo_n "checking whether blk_queue_io_opt() is available... " >&6; }
+       { $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"
 
@@ -20453,8 +20990,8 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               unsigned int opt = 1;
-               (void) blk_queue_io_opt(q, opt);
+               struct request *req = NULL;
+               blk_requeue_request(q, req);
 
   ;
   return 0;
@@ -20481,7 +21018,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_IO_OPT 1
+#define HAVE_BLK_REQUEUE_REQUEST 1
 _ACEOF
 
 
@@ -20502,8 +21039,8 @@ fi
        EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_nonrot() is available" >&5
-$as_echo_n "checking whether blk_queue_nonrot() is available... " >&6; }
+       { $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"
 
@@ -20522,8 +21059,8 @@ int
 main (void)
 {
 
-               struct request_queue *q = NULL;
-               (void) blk_queue_nonrot(q);
+               struct request *req = NULL;
+               (void) blk_rq_bytes(req);
 
   ;
   return 0;
@@ -20550,7 +21087,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_NONROT 1
+#define HAVE_BLK_RQ_BYTES 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
-
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_queue_discard() is available" >&5
-$as_echo_n "checking whether blk_queue_discard() is available... " >&6; }
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       { $as_echo "$as_me:$LINENO: checking whether blk_rq_bytes() is GPL-only" >&5
+$as_echo_n "checking whether blk_rq_bytes() is GPL-only... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -20585,14 +21118,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
+               #include <linux/module.h>
                #include <linux/blkdev.h>
 
+               MODULE_LICENSE("CDDL");
+
 int
 main (void)
 {
 
-               struct request_queue *q = NULL;
-               (void) blk_queue_discard(q);
+               struct request *req = NULL;
+               (void) blk_rq_bytes(req);
 
   ;
   return 0;
@@ -20615,21 +21151,21 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_DISCARD 1
+#define HAVE_BLK_RQ_BYTES_GPL_ONLY 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
@@ -20640,8 +21176,8 @@ fi
        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; }
+       { $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"
 
@@ -20660,8 +21196,8 @@ int
 main (void)
 {
 
-               struct request_queue *q = NULL;
-               (void) blk_fetch_request(q);
+               struct request *req = NULL;
+               (void) blk_rq_pos(req);
 
   ;
   return 0;
@@ -20688,7 +21224,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_FETCH_REQUEST 1
+#define HAVE_BLK_RQ_POS 1
 _ACEOF
 
 
@@ -20709,8 +21245,8 @@ fi
        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; }
+       { $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"
 
@@ -20729,9 +21265,8 @@ int
 main (void)
 {
 
-               struct request_queue *q = NULL;
                struct request *req = NULL;
-               blk_requeue_request(q, req);
+               (void) blk_rq_sectors(req);
 
   ;
   return 0;
@@ -20758,7 +21293,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_REQUEUE_REQUEST 1
+#define HAVE_BLK_RQ_SECTORS 1
 _ACEOF
 
 
@@ -20779,8 +21314,8 @@ fi
        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; }
+       { $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"
 
@@ -20799,8 +21334,8 @@ int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_rq_bytes(req);
+               struct gendisk *disk = NULL;
+               (void) get_disk_ro(disk);
 
   ;
   return 0;
@@ -20827,7 +21362,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_BYTES 1
+#define HAVE_GET_DISK_RO 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
-       { $as_echo "$as_me:$LINENO: checking whether blk_rq_bytes() is GPL-only" >&5
-$as_echo_n "checking whether blk_rq_bytes() is GPL-only... " >&6; }
 
+       { $as_echo "$as_me:$LINENO: checking whether symbol get_gendisk is exported" >&5
+$as_echo_n "checking whether symbol get_gendisk is exported... " >&6; }
+       grep -q -E '[[:space:]]get_gendisk[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
 
-cat confdefs.h - <<_ACEOF >conftest.c
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+               export=0
+               for file in block/genhd.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(get_gendisk)" "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
 
+                               export=1
+                               break;
 
-               #include <linux/module.h>
-               #include <linux/blkdev.h>
+fi
 
-               MODULE_LICENSE("CDDL");
+               done
+               if test $export -eq 0; then
 
-int
-main (void)
-{
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
-               struct request *req = NULL;
-               (void) blk_rq_bytes(req);
 
-  ;
-  return 0;
-}
+else
+
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GET_GENDISK 1
 _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
+fi
 
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_BYTES_GPL_ONLY 1
+#define HAVE_GET_GENDISK 1
 _ACEOF
 
 
-
-
 fi
 
-       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; }
+       { $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"
 
@@ -20937,7 +21457,7 @@ main (void)
 {
 
                struct request *req = NULL;
-               (void) blk_rq_pos(req);
+               (void) rq_is_sync(req);
 
   ;
   return 0;
@@ -20964,7 +21484,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_POS 1
+#define HAVE_RQ_IS_SYNC 1
 _ACEOF
 
 
@@ -20985,8 +21505,8 @@ fi
        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; }
+       { $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"
 
@@ -21005,8 +21525,10 @@ int
 main (void)
 {
 
+               struct bio_vec *bv;
+               struct req_iterator iter;
                struct request *req = NULL;
-               (void) blk_rq_sectors(req);
+               rq_for_each_segment(bv, req, iter) { }
 
   ;
   return 0;
@@ -21033,7 +21555,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_SECTORS 1
+#define HAVE_RQ_FOR_EACH_SEGMENT 1
 _ACEOF
 
 
 
        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"
+       { $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; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21068,14 +21587,26 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/blkdev.h>
+               #include <linux/fs.h>
+               #include <linux/xattr.h>
+
+               const struct xattr_handler xattr_test_handler = {
+                       .prefix = "test",
+                       .get    = NULL,
+                       .set    = NULL,
+               };
+
+               const struct xattr_handler *xattr_handlers[] = {
+                       &xattr_test_handler,
+               };
 
 int
 main (void)
 {
 
-               struct gendisk *disk = NULL;
-               (void) get_disk_ro(disk);
+               struct super_block sb __attribute__ ((unused));
+
+               sb.s_xattr = xattr_handlers;
 
   ;
   return 0;
@@ -21102,7 +21633,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_GET_DISK_RO 1
+#define HAVE_CONST_XATTR_HANDLER 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
-
-
-       { $as_echo "$as_me:$LINENO: checking whether symbol get_gendisk is exported" >&5
-$as_echo_n "checking whether symbol get_gendisk is exported... " >&6; }
-       grep -q -E '[[:space:]]get_gendisk[[:space:]]' \
-               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
-       rc=$?
-       if test $rc -ne 0; then
-
-               export=0
-               for file in block/genhd.c; do
-                       grep -q -E "EXPORT_SYMBOL.*(get_gendisk)" "$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_GET_GENDISK 1
-_ACEOF
-
-
-fi
-
-
-else
-
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GET_GENDISK 1
-_ACEOF
-
-
-fi
-
-
 
 
-       { $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"
+       { $as_echo "$as_me:$LINENO: checking whether xattr_handler->get() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->get() wants dentry... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21190,14 +21665,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/blkdev.h>
+               #include <linux/xattr.h>
 
 int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) rq_is_sync(req);
+               int (*get)(struct dentry *dentry, const char *name,
+                   void *buffer, size_t size, int handler_flags) = NULL;
+               struct xattr_handler xops __attribute__ ((unused));
+
+               xops.get = get;
 
   ;
   return 0;
@@ -21224,7 +21702,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_RQ_IS_SYNC 1
+#define HAVE_DENTRY_XATTR_GET 1
 _ACEOF
 
 
        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"
+       { $as_echo "$as_me:$LINENO: checking whether xattr_handler->set() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->set() wants dentry... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21259,16 +21734,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/blkdev.h>
+               #include <linux/xattr.h>
 
 int
 main (void)
 {
 
-               struct bio_vec *bv;
-               struct req_iterator iter;
-               struct request *req = NULL;
-               rq_for_each_segment(bv, req, iter) { }
+               int (*set)(struct dentry *dentry, const char *name,
+                   const void *buffer, size_t size, int flags,
+                   int handler_flags) = NULL;
+               struct xattr_handler xops __attribute__ ((unused));
+
+               xops.set = set;
 
   ;
   return 0;
@@ -21295,7 +21772,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_RQ_FOR_EACH_SEGMENT 1
+#define HAVE_DENTRY_XATTR_SET 1
 _ACEOF
 
 
        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; }
+
+       { $as_echo "$as_me:$LINENO: checking whether sops->show_options() wants dentry" >&5
+$as_echo_n "checking whether sops->show_options() wants dentry... " >&6; }
+
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21328,25 +21806,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/fs.h>
-               #include <linux/xattr.h>
-
-               const struct xattr_handler xattr_test_handler = {
-                       .prefix = "test",
-                       .get    = NULL,
-                       .set    = NULL,
-               };
-
-               const struct xattr_handler *xattr_handlers[] = {
-                       &xattr_test_handler,
-               };
 
 int
 main (void)
 {
 
-               struct super_block sb __attribute__ ((unused));
+               int (*show_options) (struct seq_file *, struct dentry *) = NULL;
+               struct super_operations sops __attribute__ ((unused));
 
-               sb.s_xattr = xattr_handlers;
+               sops.show_options = show_options;
 
   ;
   return 0;
@@ -21373,7 +21841,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_CONST_XATTR_HANDLER 1
+#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1
 _ACEOF
 
 
@@ -21393,8 +21861,9 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether xattr_handler->get() wants dentry" >&5
-$as_echo_n "checking whether xattr_handler->get() wants dentry... " >&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
@@ -21405,17 +21874,16 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/xattr.h>
+               #include <linux/fs.h>
 
 int
 main (void)
 {
 
-               int (*get)(struct dentry *dentry, const char *name,
-                   void *buffer, size_t size, int handler_flags) = NULL;
-               struct xattr_handler xops __attribute__ ((unused));
+               int (*fsync) (struct file *, struct dentry *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
 
-               xops.get = get;
+               fops.fsync = fsync;
 
   ;
   return 0;
@@ -21438,11 +21906,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_DENTRY_XATTR_GET 1
+#define HAVE_FSYNC_WITH_DENTRY 1
 _ACEOF
 
 
@@ -21450,8 +21918,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; }
 
 
 
@@ -21462,8 +21928,6 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether xattr_handler->set() wants dentry" >&5
-$as_echo_n "checking whether xattr_handler->set() wants dentry... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21474,18 +21938,16 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/xattr.h>
+               #include <linux/fs.h>
 
 int
 main (void)
 {
 
-               int (*set)(struct dentry *dentry, const char *name,
-                   const void *buffer, size_t size, int flags,
-                   int handler_flags) = NULL;
-               struct xattr_handler xops __attribute__ ((unused));
+               int (*fsync) (struct file *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
 
-               xops.set = set;
+               fops.fsync = fsync;
 
   ;
   return 0;
@@ -21508,11 +21970,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: no dentry" >&5
+$as_echo "no dentry" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_DENTRY_XATTR_SET 1
+#define HAVE_FSYNC_WITHOUT_DENTRY 1
 _ACEOF
 
 
@@ -21520,8 +21982,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; }
 
 
 
@@ -21532,9 +21992,6 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether sops->show_options() wants dentry" >&5
-$as_echo_n "checking whether sops->show_options() wants dentry... " >&6; }
-
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -21551,10 +22008,10 @@ int
 main (void)
 {
 
-               int (*show_options) (struct seq_file *, struct dentry *) = NULL;
-               struct super_operations sops __attribute__ ((unused));
+               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
 
-               sops.show_options = show_options;
+               fops.fsync = fsync;
 
   ;
   return 0;
@@ -21577,11 +22034,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: range" >&5
+$as_echo "range" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1
+#define HAVE_FSYNC_RANGE 1
 _ACEOF
 
 
@@ -21589,8 +22046,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; }
 
 
 
@@ -21601,9 +22056,6 @@ fi
 
 
 
-       { $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
@@ -21621,7 +22073,7 @@ main (void)
 {
 
                int (*fsync) (struct file *, struct dentry *, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
+               file_operations_no_const fops __attribute__ ((unused));
 
                fops.fsync = fsync;
 
@@ -21685,7 +22137,7 @@ main (void)
 {
 
                int (*fsync) (struct file *, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
+               file_operations_no_const fops __attribute__ ((unused));
 
                fops.fsync = fsync;
 
@@ -21749,7 +22201,7 @@ main (void)
 {
 
                int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
+               file_operations_no_const fops __attribute__ ((unused));
 
                fops.fsync = fsync;
 
@@ -21810,15 +22262,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/fs.h>
+               void evict_inode (struct inode * t) { return; }
+               static struct super_operations sops __attribute__ ((unused)) = {
+                       .evict_inode = evict_inode,
+               };
 
 int
 main (void)
 {
 
-               void (*evict_inode) (struct inode *) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
-                       .evict_inode = evict_inode,
-               };
 
   ;
   return 0;
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&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)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations_no_const fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  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_FILE_FALLOCATE 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
+
+
+
+
 
        { $as_echo "$as_me:$LINENO: checking whether iops->create()/mkdir()/mknod() take umode_t" >&5
 $as_echo_n "checking whether iops->create()/mkdir()/mknod() take umode_t... " >&6; }
index b6ed439..11fc335 100644 (file)
@@ -165,7 +165,7 @@ typedef struct zfs_acl {
        uint64_t        z_hints;        /* ACL hints (ZFS_INHERIT_ACE ...) */
        zfs_acl_node_t  *z_curr_node;   /* current node iterator is handling */
        list_t          z_acl;          /* chunks of ACE data */
-       acl_ops_t       z_ops;          /* ACL operations */
+       acl_ops_t       *z_ops;         /* ACL operations */
 } zfs_acl_t;
 
 typedef struct acl_locator_cb {
index 40f792b..df690b3 100644 (file)
@@ -457,9 +457,9 @@ zfs_acl_alloc(int vers)
            offsetof(zfs_acl_node_t, z_next));
        aclp->z_version = vers;
        if (vers == ZFS_ACL_VERSION_FUID)
-               aclp->z_ops = zfs_acl_fuid_ops;
+               aclp->z_ops = &zfs_acl_fuid_ops;
        else
-               aclp->z_ops = zfs_acl_v0_ops;
+               aclp->z_ops = &zfs_acl_v0_ops;
        return (aclp);
 }
 
@@ -609,17 +609,17 @@ zfs_acl_next_ace(zfs_acl_t *aclp, void *start, uint64_t *who,
                /*
                 * Make sure we don't overstep our bounds
                 */
-               ace_size = aclp->z_ops.ace_size(acep);
+               ace_size = aclp->z_ops->ace_size(acep);
 
                if (((caddr_t)acep + ace_size) >
                    ((caddr_t)aclnode->z_acldata + aclnode->z_size)) {
                        return (NULL);
                }
 
-               *iflags = aclp->z_ops.ace_flags_get(acep);
-               *type = aclp->z_ops.ace_type_get(acep);
-               *access_mask = aclp->z_ops.ace_mask_get(acep);
-               *who = aclp->z_ops.ace_who_get(acep);
+               *iflags = aclp->z_ops->ace_flags_get(acep);
+               *type = aclp->z_ops->ace_type_get(acep);
+               *access_mask = aclp->z_ops->ace_mask_get(acep);
+               *who = aclp->z_ops->ace_who_get(acep);
                aclp->z_next_ace = (caddr_t)aclp->z_next_ace + ace_size;
                aclnode->z_ace_idx++;
 
@@ -698,7 +698,7 @@ zfs_copy_ace_2_fuid(zfs_sb_t *zsb, umode_t obj_mode, zfs_acl_t *aclp,
                }
 
                aceptr = (zfs_ace_t *)((caddr_t)aceptr +
-                   aclp->z_ops.ace_size(aceptr));
+                   aclp->z_ops->ace_size(aceptr));
        }
 
        *size = (caddr_t)aceptr - (caddr_t)z_acl;
@@ -824,7 +824,7 @@ zfs_acl_xform(znode_t *zp, zfs_acl_t *aclp, cred_t *cr)
 
        newaclnode = zfs_acl_node_alloc(aclp->z_acl_count *
            sizeof (zfs_object_ace_t));
-       aclp->z_ops = zfs_acl_fuid_ops;
+       aclp->z_ops = &zfs_acl_fuid_ops;
        VERIFY(zfs_copy_ace_2_fuid(ZTOZSB(zp), ZTOI(zp)->i_mode,
            aclp, oldaclp, newaclnode->z_acldata, aclp->z_acl_count,
            &newaclnode->z_size, NULL, cr) == 0);
@@ -868,12 +868,12 @@ zfs_set_ace(zfs_acl_t *aclp, void *acep, uint32_t access_mask,
 {
        uint16_t type = entry_type & ACE_TYPE_FLAGS;
 
-       aclp->z_ops.ace_mask_set(acep, access_mask);
-       aclp->z_ops.ace_type_set(acep, access_type);
-       aclp->z_ops.ace_flags_set(acep, entry_type);
+       aclp->z_ops->ace_mask_set(acep, access_mask);
+       aclp->z_ops->ace_type_set(acep, access_type);
+       aclp->z_ops->ace_flags_set(acep, entry_type);
        if ((type != ACE_OWNER && type != OWNING_GROUP &&
            type != ACE_EVERYONE))
-               aclp->z_ops.ace_who_set(acep, fuid);
+               aclp->z_ops->ace_who_set(acep, fuid);
 }
 
 /*
@@ -1454,7 +1454,7 @@ zfs_acl_chmod(zfs_sb_t *zsb, uint64_t mode, zfs_acl_t *aclp)
        uint16_t        iflags, type;
        uint32_t        access_mask;
        zfs_acl_node_t  *newnode;
-       size_t          abstract_size = aclp->z_ops.ace_abstract_size();
+       size_t          abstract_size = aclp->z_ops->ace_abstract_size();
        void            *zacep;
        uint32_t        owner, group, everyone;
        uint32_t        deny1, deny2, allow0;
@@ -1530,7 +1530,7 @@ zfs_acl_chmod(zfs_sb_t *zsb, uint64_t mode, zfs_acl_t *aclp)
                        }
                }
                zfs_set_ace(aclp, zacep, access_mask, type, who, iflags);
-               ace_size = aclp->z_ops.ace_size(acep);
+               ace_size = aclp->z_ops->ace_size(acep);
                zacep = (void *)((uintptr_t)zacep + ace_size);
                new_count++;
                new_bytes += ace_size;
@@ -1570,12 +1570,12 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_acl_t **aclp, uint64_t mode)
 static void
 zfs_restricted_update(zfs_sb_t *zsb, zfs_acl_t *aclp, void *acep)
 {
-       uint32_t mask = aclp->z_ops.ace_mask_get(acep);
+       uint32_t mask = aclp->z_ops->ace_mask_get(acep);
 
        if ((zsb->z_acl_inherit == ZFS_ACL_RESTRICTED) &&
-           (aclp->z_ops.ace_type_get(acep) == ALLOW)) {
+           (aclp->z_ops->ace_type_get(acep) == ALLOW)) {
                mask &= ~RESTRICTED_CLEAR;
-               aclp->z_ops.ace_mask_set(acep, mask);
+               aclp->z_ops->ace_mask_set(acep, mask);
        }
 }
 
@@ -1640,7 +1640,7 @@ zfs_acl_inherit(zfs_sb_t *zsb, umode_t obj_mode, zfs_acl_t *paclp,
                if (noallow && type == ALLOW)
                        continue;
 
-               ace_size = aclp->z_ops.ace_size(pacep);
+               ace_size = aclp->z_ops->ace_size(pacep);
 
                if (!zfs_ace_can_use(obj_mode, iflags))
                        continue;
@@ -1672,8 +1672,8 @@ zfs_acl_inherit(zfs_sb_t *zsb, umode_t obj_mode, zfs_acl_t *paclp,
                /*
                 * Copy special opaque data if any
                 */
-               if ((data1sz = paclp->z_ops.ace_data(pacep, &data1)) != 0) {
-                       VERIFY((data2sz = aclp->z_ops.ace_data(acep,
+               if ((data1sz = paclp->z_ops->ace_data(pacep, &data1)) != 0) {
+                       VERIFY((data2sz = aclp->z_ops->ace_data(acep,
                            &data2)) == data1sz);
                        bcopy(data1, data2, data2sz);
                }
@@ -1681,14 +1681,14 @@ zfs_acl_inherit(zfs_sb_t *zsb, umode_t obj_mode, zfs_acl_t *paclp,
                aclp->z_acl_count++;
                aclnode->z_ace_count++;
                aclp->z_acl_bytes += aclnode->z_size;
-               newflags = aclp->z_ops.ace_flags_get(acep);
+               newflags = aclp->z_ops->ace_flags_get(acep);
 
                if (vdir)
                        aclp->z_hints |= ZFS_INHERIT_ACE;
 
                if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) {
                        newflags &= ~ALL_INHERIT;
-                       aclp->z_ops.ace_flags_set(acep,
+                       aclp->z_ops->ace_flags_set(acep,
                            newflags|ACE_INHERITED_ACE);
                        zfs_restricted_update(zsb, aclp, acep);
                        continue;
@@ -1703,11 +1703,11 @@ zfs_acl_inherit(zfs_sb_t *zsb, umode_t obj_mode, zfs_acl_t *paclp,
                if ((iflags & (ACE_FILE_INHERIT_ACE |
                    ACE_DIRECTORY_INHERIT_ACE)) == ACE_FILE_INHERIT_ACE) {
                        newflags |= ACE_INHERIT_ONLY_ACE;
-                       aclp->z_ops.ace_flags_set(acep,
+                       aclp->z_ops->ace_flags_set(acep,
                            newflags|ACE_INHERITED_ACE);
                } else {
                        newflags &= ~ACE_INHERIT_ONLY_ACE;
-                       aclp->z_ops.ace_flags_set(acep,
+                       aclp->z_ops->ace_flags_set(acep,
                            newflags|ACE_INHERITED_ACE);
                }
        }
index 1f6169b..ea8c309 100644 (file)
@@ -294,9 +294,8 @@ zpl_follow_link(struct dentry *dentry, struct nameidata *nd)
 static void
 zpl_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
 {
-       char *link;
+       const char *link = nd_get_link(nd);
 
-       link = nd_get_link(nd);
        if (!IS_ERR(link))
                kmem_free(link, MAXPATHLEN);
 }