Improve ZVOL queue behavior.
authorEtienne Dechamps <etienne.dechamps@ovh.net>
Mon, 5 Sep 2011 13:15:45 +0000 (15:15 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Feb 2012 00:23:06 +0000 (16:23 -0800)
The Linux block device queue subsystem exposes a number of configurable
settings described in Linux block/blk-settings.c. The defaults for these
settings are tuned for hard drives, and are not optimized for ZVOLs. Proper
configuration of these options would allow upper layers (I/O scheduler) to
take better decisions about write merging and ordering.

Detailed rationale:

 - max_hw_sectors is set to unlimited (UINT_MAX). zvol_write() is able to
   handle writes of any size, so there's no reason to impose a limit. Let the
   upper layer decide.

 - max_segments and max_segment_size are set to unlimited. zvol_write() will
   copy the requests' contents into a dbuf anyway, so the number and size of
   the segments are irrelevant. Let the upper layer decide.

 - physical_block_size and io_opt are set to the ZVOL's block size. This
   has the potential to somewhat alleviate issue #361 for ZVOLs, by warning
   the upper layers that writes smaller than the volume's block size will be
   slow.

 - The NONROT flag is set to indicate this isn't a rotational device.
   Although the backing zpool might be composed of rotational devices, the
   resulting ZVOL often doesn't exhibit the same behavior due to the COW
   mechanisms used by ZFS. Setting this flag will prevent upper layers from
   making useless decisions (such as reordering writes) based on incorrect
   assumptions about the behavior of the ZVOL.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
64 files changed:
Makefile.in
cmd/Makefile.in
cmd/mount_zfs/Makefile.in
cmd/sas_switch_id/Makefile.in
cmd/zdb/Makefile.in
cmd/zfs/Makefile.in
cmd/zinject/Makefile.in
cmd/zpios/Makefile.in
cmd/zpool/Makefile.in
cmd/zpool_id/Makefile.in
cmd/zpool_layout/Makefile.in
cmd/ztest/Makefile.in
cmd/zvol_id/Makefile.in
config/kernel-blk-queue-io-opt.m4 [new file with mode: 0644]
config/kernel-blk-queue-max-hw-sectors.m4 [new file with mode: 0644]
config/kernel-blk-queue-max-segments.m4 [new file with mode: 0644]
config/kernel-blk-queue-nonrot.m4 [new file with mode: 0644]
config/kernel-blk-queue-physical-block-size.m4 [new file with mode: 0644]
config/kernel.m4
configure
dracut/90zfs/Makefile.in
dracut/Makefile.in
etc/Makefile.in
etc/init.d/Makefile.in
etc/zfs/Makefile.in
include/Makefile.in
include/linux/Makefile.in
include/linux/blkdev_compat.h
include/sys/Makefile.in
include/sys/fm/Makefile.in
include/sys/fm/fs/Makefile.in
include/sys/fs/Makefile.in
lib/Makefile.in
lib/libavl/Makefile.in
lib/libefi/Makefile.in
lib/libnvpair/Makefile.in
lib/libshare/Makefile.in
lib/libspl/Makefile.in
lib/libspl/asm-generic/Makefile.in
lib/libspl/asm-i386/Makefile.in
lib/libspl/asm-x86_64/Makefile.in
lib/libspl/include/Makefile.in
lib/libspl/include/ia32/Makefile.in
lib/libspl/include/ia32/sys/Makefile.in
lib/libspl/include/rpc/Makefile.in
lib/libspl/include/sys/Makefile.in
lib/libspl/include/sys/dktp/Makefile.in
lib/libspl/include/sys/sysevent/Makefile.in
lib/libspl/include/util/Makefile.in
lib/libunicode/Makefile.in
lib/libuutil/Makefile.in
lib/libzfs/Makefile.in
lib/libzpool/Makefile.in
man/Makefile.in
man/man8/Makefile.in
module/zfs/zvol.c
scripts/Makefile.in
scripts/zpios-profile/Makefile.in
scripts/zpios-test/Makefile.in
scripts/zpool-config/Makefile.in
scripts/zpool-layout/Makefile.in
udev/Makefile.in
udev/rules.d/Makefile.in
zfs_config.h.in

index ba37342..37b0db7 100644 (file)
@@ -73,6 +73,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index ba53609..a0fdde9 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 94e3160..350c67d 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 09826f2..94e3a63 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 7dd5dfc..fa0b8c7 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 54f63c7..ccf9924 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 59d67f0..eb3f28d 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index f357559..c9811af 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index cb15fee..60a97aa 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index a6277ef..e53c87c 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 12f21e5..2065836 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 85fdde0..e95f55c 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 2c22c80..3986267 100644 (file)
@@ -53,6 +53,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
diff --git a/config/kernel-blk-queue-io-opt.m4 b/config/kernel-blk-queue-io-opt.m4
new file mode 100644 (file)
index 0000000..4ea94e1
--- /dev/null
@@ -0,0 +1,24 @@
+dnl #
+dnl # 2.6.30 API change
+dnl # The blk_queue_io_opt() function was added to indicate the optimal
+dnl # I/O size for the device.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_IO_OPT], [
+       AC_MSG_CHECKING([whether blk_queue_io_opt() is available])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request_queue *q = NULL;
+               unsigned int opt = 1;
+               (void) blk_queue_io_opt(q, opt);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_IO_OPT, 1,
+                         [blk_queue_io_opt() is available])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/config/kernel-blk-queue-max-hw-sectors.m4 b/config/kernel-blk-queue-max-hw-sectors.m4
new file mode 100644 (file)
index 0000000..7bdf7e0
--- /dev/null
@@ -0,0 +1,22 @@
+dnl #
+dnl # 2.6.34 API change
+dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors().
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
+       AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_MAX_HW_SECTORS, 1,
+                         [blk_queue_max_hw_sectors() is available])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/config/kernel-blk-queue-max-segments.m4 b/config/kernel-blk-queue-max-segments.m4
new file mode 100644 (file)
index 0000000..09be121
--- /dev/null
@@ -0,0 +1,23 @@
+dnl #
+dnl # 2.6.34 API change
+dnl # blk_queue_max_segments() consolidates blk_queue_max_hw_segments()
+dnl # and blk_queue_max_phys_segments().
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
+       AC_MSG_CHECKING([whether blk_queue_max_segments() is available])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
+                         [blk_queue_max_segments() is available])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/config/kernel-blk-queue-nonrot.m4 b/config/kernel-blk-queue-nonrot.m4
new file mode 100644 (file)
index 0000000..45d78f7
--- /dev/null
@@ -0,0 +1,25 @@
+dnl #
+dnl # 2.6.27 API change
+dnl # The blk_queue_nonrot() function and QUEUE_FLAG_NONROT flag were
+dnl # added so non-rotational devices could be identified.  These devices
+dnl # have no seek time which the higher level elevator uses to optimize
+dnl # how the I/O issued to the device.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_NONROT], [
+       AC_MSG_CHECKING([whether blk_queue_nonrot() is available])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request_queue *q = NULL;
+               (void) blk_queue_nonrot(q);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_NONROT, 1,
+                         [blk_queue_nonrot() is available])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/config/kernel-blk-queue-physical-block-size.m4 b/config/kernel-blk-queue-physical-block-size.m4
new file mode 100644 (file)
index 0000000..c51c817
--- /dev/null
@@ -0,0 +1,25 @@
+dnl #
+dnl # 2.6.30 API change
+dnl # The blk_queue_physical_block_size() function was introduced to
+dnl # indicate the smallest I/O the device can write without incurring
+dnl # a read-modify-write penalty.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PHYSICAL_BLOCK_SIZE], [
+       AC_MSG_CHECKING([whether blk_queue_physical_block_size() is available])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
+       ZFS_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request_queue *q = NULL;
+               unsigned short block_size = 1;
+               (void) blk_queue_physical_block_size(q, block_size);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_PHYSICAL_BLOCK_SIZE, 1,
+                         [blk_queue_physical_block_size() is available])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
index a2a819c..b464557 100644 (file)
@@ -22,6 +22,11 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
        ZFS_AC_KERNEL_REQ_SYNC
        ZFS_AC_KERNEL_BLK_END_REQUEST
        ZFS_AC_KERNEL_BLK_QUEUE_FLUSH
+       ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS
+       ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
+       ZFS_AC_KERNEL_BLK_QUEUE_PHYSICAL_BLOCK_SIZE
+       ZFS_AC_KERNEL_BLK_QUEUE_IO_OPT
+       ZFS_AC_KERNEL_BLK_QUEUE_NONROT
        ZFS_AC_KERNEL_BLK_FETCH_REQUEST
        ZFS_AC_KERNEL_BLK_REQUEUE_REQUEST
        ZFS_AC_KERNEL_BLK_RQ_BYTES
index dd3a6f9..40ab1d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -13812,8 +13812,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_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"
 
@@ -13833,7 +13833,7 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               (void) blk_fetch_request(q);
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
 
   ;
   return 0;
@@ -13860,7 +13860,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_FETCH_REQUEST 1
+#define HAVE_BLK_QUEUE_MAX_HW_SECTORS 1
 _ACEOF
 
 
@@ -13881,8 +13881,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_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"
 
@@ -13902,8 +13902,7 @@ main (void)
 {
 
                struct request_queue *q = NULL;
-               struct request *req = NULL;
-               blk_requeue_request(q, req);
+               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
 
   ;
   return 0;
@@ -13930,7 +13929,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_REQUEUE_REQUEST 1
+#define HAVE_BLK_QUEUE_MAX_SEGMENTS 1
 _ACEOF
 
 
@@ -13951,8 +13950,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 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"
 
@@ -13971,8 +13970,9 @@ int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_rq_bytes(req);
+               struct request_queue *q = NULL;
+               unsigned short block_size = 1;
+               (void) blk_queue_physical_block_size(q, block_size);
 
   ;
   return 0;
@@ -13999,7 +13999,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_BYTES 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_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 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
@@ -14030,17 +14034,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 *req = NULL;
-               (void) blk_rq_bytes(req);
+               struct request_queue *q = NULL;
+               unsigned int opt = 1;
+               (void) blk_queue_io_opt(q, opt);
 
   ;
   return 0;
@@ -14063,21 +14065,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_RQ_BYTES_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
@@ -14088,8 +14090,8 @@ fi
        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 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"
 
@@ -14108,8 +14110,8 @@ int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_rq_pos(req);
+               struct request_queue *q = NULL;
+               (void) blk_queue_nonrot(q);
 
   ;
   return 0;
@@ -14136,7 +14138,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_POS 1
+#define HAVE_BLK_QUEUE_NONROT 1
 _ACEOF
 
 
@@ -14157,8 +14159,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 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"
 
@@ -14177,8 +14179,8 @@ int
 main (void)
 {
 
-               struct request *req = NULL;
-               (void) blk_rq_sectors(req);
+               struct request_queue *q = NULL;
+               (void) blk_fetch_request(q);
 
   ;
   return 0;
@@ -14205,7 +14207,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_RQ_SECTORS 1
+#define HAVE_BLK_FETCH_REQUEST 1
 _ACEOF
 
 
@@ -14226,8 +14228,8 @@ fi
        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; }
+       { $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"
 
@@ -14246,8 +14248,9 @@ int
 main (void)
 {
 
-               struct gendisk *disk = NULL;
-               (void) get_disk_ro(disk);
+               struct request_queue *q = NULL;
+               struct request *req = NULL;
+               blk_requeue_request(q, req);
 
   ;
   return 0;
@@ -14274,7 +14277,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_GET_DISK_RO 1
+#define HAVE_BLK_REQUEUE_REQUEST 1
 _ACEOF
 
 
@@ -14295,8 +14298,8 @@ fi
        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; }
+       { $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"
 
@@ -14316,7 +14319,7 @@ main (void)
 {
 
                struct request *req = NULL;
-               (void) rq_is_sync(req);
+               (void) blk_rq_bytes(req);
 
   ;
   return 0;
@@ -14343,7 +14346,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_RQ_IS_SYNC 1
+#define HAVE_BLK_RQ_BYTES 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 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
@@ -14378,16 +14377,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
+               #include <linux/module.h>
                #include <linux/blkdev.h>
 
+               MODULE_LICENSE("CDDL");
+
 int
 main (void)
 {
 
-               struct bio_vec *bv;
-               struct req_iterator iter;
                struct request *req = NULL;
-               rq_for_each_segment(bv, req, iter) { }
+               (void) blk_rq_bytes(req);
 
   ;
   return 0;
@@ -14410,21 +14410,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_RQ_FOR_EACH_SEGMENT 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
 
        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 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
@@ -14446,26 +14449,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.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,
-               };
+               #include <linux/blkdev.h>
 
 int
 main (void)
 {
 
-               struct super_block sb __attribute__ ((unused));
-
-               sb.s_xattr = xattr_handlers;
+               struct request *req = NULL;
+               (void) blk_rq_pos(req);
 
   ;
   return 0;
@@ -14492,7 +14483,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_CONST_XATTR_HANDLER 1
+#define HAVE_BLK_RQ_POS 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $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 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
@@ -14524,17 +14518,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/xattr.h>
+               #include <linux/blkdev.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));
-
-               xops.get = get;
+               struct request *req = NULL;
+               (void) blk_rq_sectors(req);
 
   ;
   return 0;
@@ -14561,7 +14552,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_DENTRY_XATTR_GET 1
+#define HAVE_BLK_RQ_SECTORS 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether xattr_handler->set() wants dentry" >&5
-$as_echo_n "checking whether xattr_handler->set() wants dentry... " >&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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14593,18 +14587,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/xattr.h>
+               #include <linux/blkdev.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));
-
-               xops.set = set;
+               struct gendisk *disk = NULL;
+               (void) get_disk_ro(disk);
 
   ;
   return 0;
@@ -14631,7 +14621,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_DENTRY_XATTR_SET 1
+#define HAVE_GET_DISK_RO 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether sops->show_options() wants dentry" >&5
-$as_echo_n "checking whether sops->show_options() wants dentry... " >&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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14664,16 +14656,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/fs.h>
+               #include <linux/blkdev.h>
 
 int
 main (void)
 {
 
-               int (*show_options) (struct seq_file *, struct dentry *) = NULL;
-               struct super_operations sops __attribute__ ((unused));
-
-               sops.show_options = show_options;
+               struct request *req = NULL;
+               (void) rq_is_sync(req);
 
   ;
   return 0;
@@ -14700,7 +14690,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1
+#define HAVE_RQ_IS_SYNC 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5
-$as_echo_n "checking whether fops->fsync() wants... " >&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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14733,16 +14725,16 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/fs.h>
+               #include <linux/blkdev.h>
 
 int
 main (void)
 {
 
-               int (*fsync) (struct file *, struct dentry *, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
-
-               fops.fsync = fsync;
+               struct bio_vec *bv;
+               struct req_iterator iter;
+               struct request *req = NULL;
+               rq_for_each_segment(bv, req, iter) { }
 
   ;
   return 0;
@@ -14765,11 +14757,11 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: dentry" >&5
-$as_echo "dentry" >&6; }
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FSYNC_WITH_DENTRY 1
+#define HAVE_RQ_FOR_EACH_SEGMENT 1
 _ACEOF
 
 
@@ -14777,6 +14769,8 @@ 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; }
 
 
 
        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; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14798,15 +14794,25 @@ 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)
 {
 
-               int (*fsync) (struct file *, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
+               struct super_block sb __attribute__ ((unused));
 
-               fops.fsync = fsync;
+               sb.s_xattr = xattr_handlers;
 
   ;
   return 0;
@@ -14829,11 +14835,11 @@ _ACEOF
   $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; }
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FSYNC_WITHOUT_DENTRY 1
+#define HAVE_CONST_XATTR_HANDLER 1
 _ACEOF
 
 
@@ -14841,6 +14847,8 @@ 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; }
 
 
 
@@ -14851,6 +14859,8 @@ 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; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14861,16 +14871,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/fs.h>
+               #include <linux/xattr.h>
 
 int
 main (void)
 {
 
-               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
-               struct file_operations fops __attribute__ ((unused));
+               int (*get)(struct dentry *dentry, const char *name,
+                   void *buffer, size_t size, int handler_flags) = NULL;
+               struct xattr_handler xops __attribute__ ((unused));
 
-               fops.fsync = fsync;
+               xops.get = get;
 
   ;
   return 0;
@@ -14893,11 +14904,11 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: range" >&5
-$as_echo "range" >&6; }
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FSYNC_RANGE 1
+#define HAVE_DENTRY_XATTR_GET 1
 _ACEOF
 
 
@@ -14905,6 +14916,8 @@ 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; }
 
 
 
@@ -14915,9 +14928,8 @@ fi
 
 
 
-
-       { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5
-$as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
+       { $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
@@ -14928,16 +14940,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/fs.h>
+               #include <linux/xattr.h>
 
 int
 main (void)
 {
 
-               void (*evict_inode) (struct inode *) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
-                       .evict_inode = evict_inode,
-               };
+               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;
@@ -14964,7 +14978,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_EVICT_INODE 1
+#define HAVE_DENTRY_XATTR_SET 1
 _ACEOF
 
 
@@ -14984,8 +14998,9 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether sops->nr_cached_objects() exists" >&5
-$as_echo_n "checking whether sops->nr_cached_objects() exists... " >&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
@@ -15002,11 +15017,10 @@ int
 main (void)
 {
 
-               int (*nr_cached_objects)(struct super_block *)
-                       __attribute__ ((unused)) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
-                       .nr_cached_objects = nr_cached_objects,
-               };
+               int (*show_options) (struct seq_file *, struct dentry *) = NULL;
+               struct super_operations sops __attribute__ ((unused));
+
+               sops.show_options = show_options;
 
   ;
   return 0;
@@ -15033,7 +15047,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_NR_CACHED_OBJECTS 1
+#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1
 _ACEOF
 
 
@@ -15053,8 +15067,9 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether sops->free_cached_objects() exists" >&5
-$as_echo_n "checking whether sops->free_cached_objects() exists... " >&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
@@ -15071,11 +15086,10 @@ int
 main (void)
 {
 
-               void (*free_cached_objects)(struct super_block *, int)
-                       __attribute__ ((unused)) = NULL;
-               struct super_operations sops __attribute__ ((unused)) = {
-                       .free_cached_objects = free_cached_objects,
-               };
+               int (*fsync) (struct file *, struct dentry *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
+
+               fops.fsync = fsync;
 
   ;
   return 0;
@@ -15098,11 +15112,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_FREE_CACHED_OBJECTS 1
+#define HAVE_FSYNC_WITH_DENTRY 1
 _ACEOF
 
 
@@ -15110,8 +15124,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; }
 
 
 
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether symbol insert_inode_locked is exported" >&5
-$as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; }
-       grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \
-               $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;
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-fi
 
-               done
-               if test $export -eq 0; then
+               #include <linux/fs.h>
 
-                       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+int
+main (void)
+{
 
+               int (*fsync) (struct file *, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
 
-else
+               fops.fsync = fsync;
 
-                       { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  ;
+  return 0;
+}
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
 
-fi
+       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
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INSERT_INODE_LOCKED 1
-_ACEOF
 
 
 fi
 
+       rm -Rf build
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether symbol d_obtain_alias is exported" >&5
-$as_echo_n "checking whether symbol d_obtain_alias is exported... " >&6; }
-       grep -q -E '[[:space:]]d_obtain_alias[[:space:]]' \
-               $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
 
-               done
-               if test $export -eq 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.  */
 
-                       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
+               #include <linux/fs.h>
 
-else
+int
+main (void)
+{
 
-                       { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+               int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+               struct file_operations fops __attribute__ ((unused));
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_D_OBTAIN_ALIAS 1
-_ACEOF
+               fops.fsync = fsync;
 
+  ;
+  return 0;
+}
 
-fi
+_ACEOF
 
 
-else
+       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; }
+               { $as_echo "$as_me:$LINENO: result: range" >&5
+$as_echo "range" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_D_OBTAIN_ALIAS 1
+#define HAVE_FSYNC_RANGE 1
 _ACEOF
 
 
-fi
-
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether symbol check_disk_size_change is exported" >&5
-$as_echo_n "checking whether symbol check_disk_size_change is exported... " >&6; }
-       grep -q -E '[[:space:]]check_disk_size_change[[:space:]]' \
-               $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
+fi
 
-                               export=1
-                               break;
+       rm -Rf build
 
-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: checking whether sops->evict_inode() exists" >&5
+$as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
 
-                       { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CHECK_DISK_SIZE_CHANGE 1
+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/fs.h>
 
+int
+main (void)
+{
 
-else
+               void (*evict_inode) (struct inode *) = NULL;
+               struct super_operations sops __attribute__ ((unused)) = {
+                       .evict_inode = evict_inode,
+               };
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  ;
+  return 0;
+}
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
 
-fi
-
-
-
-
-       { $as_echo "$as_me:$LINENO: checking whether symbol truncate_setsize is exported" >&5
-$as_echo_n "checking whether symbol truncate_setsize is exported... " >&6; }
-       grep -q -E '[[:space:]]truncate_setsize[[:space:]]' \
-               $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
-
-               done
-               if test $export -eq 0; then
-
-                       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-
-
-else
+       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 "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_TRUNCATE_SETSIZE 1
+#define HAVE_EVICT_INODE 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_TRUNCATE_SETSIZE 1
-_ACEOF
 
 
 fi
 
+       rm -Rf build
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants 6 args" >&5
-$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
+
+       { $as_echo "$as_me:$LINENO: checking whether sops->nr_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->nr_cached_objects() exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -15348,20 +15343,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/security.h>
+               #include <linux/fs.h>
 
 int
 main (void)
 {
 
-               struct inode *ip __attribute__ ((unused)) = NULL;
-               struct inode *dip __attribute__ ((unused)) = NULL;
-               const struct qstr *str __attribute__ ((unused)) = NULL;
-               char *name __attribute__ ((unused)) = NULL;
-               void *value __attribute__ ((unused)) = NULL;
-               size_t len __attribute__ ((unused)) = 0;
-
-               security_inode_init_security(ip, dip, str, &name, &value, &len);
+               int (*nr_cached_objects)(struct super_block *)
+                       __attribute__ ((unused)) = NULL;
+               struct super_operations sops __attribute__ ((unused)) = {
+                       .nr_cached_objects = nr_cached_objects,
+               };
 
   ;
   return 0;
@@ -15388,7 +15380,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1
+#define HAVE_NR_CACHED_OBJECTS 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants callback" >&5
-$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; }
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
+       { $as_echo "$as_me:$LINENO: checking whether sops->free_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->free_cached_objects() exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -15423,18 +15412,17 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/security.h>
+               #include <linux/fs.h>
 
 int
 main (void)
 {
 
-               struct inode *ip __attribute__ ((unused)) = NULL;
-               struct inode *dip __attribute__ ((unused)) = NULL;
-               const struct qstr *str __attribute__ ((unused)) = NULL;
-               initxattrs func __attribute__ ((unused)) = NULL;
-
-               security_inode_init_security(ip, dip, str, func, NULL);
+               void (*free_cached_objects)(struct super_block *, int)
+                       __attribute__ ((unused)) = NULL;
+               struct super_operations sops __attribute__ ((unused)) = {
+                       .free_cached_objects = free_cached_objects,
+               };
 
   ;
   return 0;
@@ -15461,7 +15449,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY 1
+#define HAVE_FREE_CACHED_OBJECTS 1
 _ACEOF
 
 
        rm -Rf build
 
 
-       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: checking whether symbol mount_nodev is exported" >&5
-$as_echo_n "checking whether symbol mount_nodev is exported... " >&6; }
-       grep -q -E '[[:space:]]mount_nodev[[:space:]]' \
+       { $as_echo "$as_me:$LINENO: checking whether symbol insert_inode_locked is exported" >&5
+$as_echo_n "checking whether symbol insert_inode_locked is exported... " >&6; }
+       grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \
                $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
+               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
 
@@ -15513,7 +15500,7 @@ else
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_MOUNT_NODEV 1
+#define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
 
@@ -15526,7 +15513,7 @@ else
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_MOUNT_NODEV 1
+#define HAVE_INSERT_INODE_LOCKED 1
 _ACEOF
 
 
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether super_block has s_shrink" >&5
-$as_echo_n "checking whether super_block has s_shrink... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
+       { $as_echo "$as_me:$LINENO: checking whether symbol d_obtain_alias is exported" >&5
+$as_echo_n "checking whether symbol d_obtain_alias is exported... " >&6; }
+       grep -q -E '[[:space:]]d_obtain_alias[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
 
-               #include <linux/fs.h>
+               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
 
-int
-main (void)
-{
+                               export=1
+                               break;
 
-               int (*shrink)(struct shrinker *, struct shrink_control *sc)
-                       __attribute__ ((unused)) = NULL;
-               struct super_block sb __attribute__ ((unused)) = {
-                       .s_shrink.shrink = shrink,
-                       .s_shrink.seeks = DEFAULT_SEEKS,
-                       .s_shrink.batch = 0,
-               };
+fi
 
-  ;
-  return 0;
-}
+               done
+               if test $export -eq 0; then
 
-_ACEOF
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 
-       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
+else
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_SHRINK 1
+#define HAVE_D_OBTAIN_ALIAS 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 super_block has s_bdi" >&5
-$as_echo_n "checking whether super_block has s_bdi... " >&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 super_block sb __attribute__ ((unused));
-               sb.s_bdi = NULL;
-
-  ;
-  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
+else
 
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDI 1
+#define HAVE_D_OBTAIN_ALIAS 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 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:]]' \
+       { $as_echo "$as_me:$LINENO: checking whether symbol check_disk_size_change is exported" >&5
+$as_echo_n "checking whether symbol check_disk_size_change is exported... " >&6; }
+       grep -q -E '[[:space:]]check_disk_size_change[[: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
+               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
 
@@ -15704,7 +15606,7 @@ else
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDI_SETUP_AND_REGISTER 1
+#define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
 
@@ -15717,7 +15619,7 @@ else
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDI_SETUP_AND_REGISTER 1
+#define HAVE_CHECK_DISK_SIZE_CHANGE 1
 _ACEOF
 
 
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5
-$as_echo_n "checking whether set_nlink() is available... " >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether symbol truncate_setsize is exported" >&5
+$as_echo_n "checking whether symbol truncate_setsize is exported... " >&6; }
+       grep -q -E '[[:space:]]truncate_setsize[[:space:]]' \
+               $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
+
+               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_TRUNCATE_SETSIZE 1
+_ACEOF
+
+
+fi
+
+
+else
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TRUNCATE_SETSIZE 1
+_ACEOF
+
+
+fi
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants 6 args" >&5
+$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -15738,15 +15695,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/fs.h>
+               #include <linux/security.h>
 
 int
 main (void)
 {
 
-               struct inode node;
-               unsigned int link = 0;
-               (void) set_nlink(&node, link);
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               char *name __attribute__ ((unused)) = NULL;
+               void *value __attribute__ ((unused)) = NULL;
+               size_t len __attribute__ ((unused)) = 0;
+
+               security_inode_init_security(ip, dip, str, &name, &value, &len);
 
   ;
   return 0;
@@ -15773,7 +15735,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_SET_NLINK 1
+#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1
 _ACEOF
 
 
        rm -Rf build
 
 
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       if test "$LINUX_OBJ" != "$LINUX"; then
+       { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants callback" >&5
+$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
 
-               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
 
-fi
+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/security.h>
+
+int
+main (void)
+{
 
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               initxattrs func __attribute__ ((unused)) = NULL;
 
-                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
-       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
-       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
+               security_inode_init_security(ip, dip, str, func, NULL);
 
+  ;
+  return 0;
+}
 
- ;;
-               user)
+_ACEOF
 
 
-# Check whether --with-udevdir was given.
-if test "${with_udevdir+set}" = set; then
-  withval=$with_udevdir; udevdir=$withval
-else
-  udevdir='${exec_prefix}/lib/udev'
-fi
+       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_CALLBACK_SECURITY_INODE_INIT_SECURITY 1
+_ACEOF
 
 
-# Check whether --with-udevruledir was given.
-if test "${with_udevruledir+set}" = set; then
-  withval=$with_udevruledir; udevruledir=$withval
 else
-  udevruledir='${udevdir}/rules.d'
-fi
+  $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 for target asm dir" >&5
-$as_echo_n "checking for target asm dir... " >&6; }
-       TARGET_ARCH=`echo ${target_cpu} | sed -e s/i.86/i386/`
 
-       case $TARGET_ARCH in
-       i386|x86_64)
-               TARGET_ASM_DIR=asm-${TARGET_ARCH}
-               ;;
-       *)
-               TARGET_ASM_DIR=asm-generic
-               ;;
-       esac
+       EXTRA_KCFLAGS="$tmp_flags"
 
 
-       { $as_echo "$as_me:$LINENO: result: $TARGET_ASM_DIR" >&5
-$as_echo "$TARGET_ASM_DIR" >&6; }
+       { $as_echo "$as_me:$LINENO: checking whether symbol mount_nodev is exported" >&5
+$as_echo_n "checking whether symbol mount_nodev is exported... " >&6; }
+       grep -q -E '[[:space:]]mount_nodev[[:space:]]' \
+               $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
 
-       { $as_echo "$as_me:$LINENO: checking for ioctl()" >&5
-$as_echo_n "checking for ioctl()... " >&6; }
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <unistd.h>
+                               export=1
+                               break;
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "ioctl" >/dev/null 2>&1; then
-  is_unistd=yes
-else
-  is_unistd=no
 fi
-rm -f conftest*
 
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/ioctl.h>
+               done
+               if test $export -eq 0; then
+
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "ioctl" >/dev/null 2>&1; then
-  is_sys_ioctl=yes
 else
-  is_sys_ioctl=no
-fi
-rm -f conftest*
 
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stropts.h>
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MOUNT_NODEV 1
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "ioctl" >/dev/null 2>&1; then
-  is_stropts=yes
-else
-  is_stropts=no
+
+
 fi
-rm -f conftest*
 
 
-       if test $is_unistd = yes; then
-               result=unistd.h
+else
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_IOCTL_IN_UNISTD_H 1
+#define HAVE_MOUNT_NODEV 1
 _ACEOF
 
-       else
 
-               if test $is_sys_ioctl = yes; then
-                       result=sys/ioctl.h
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IOCTL_IN_SYS_IOCTL_H 1
-_ACEOF
 
-               elif test $is_stropts = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IOCTL_IN_STROPTS_H 1
-_ACEOF
 
-               else
-                       result=no
-               fi
-       fi
+       { $as_echo "$as_me:$LINENO: checking whether super_block has s_shrink" >&5
+$as_echo_n "checking whether super_block has s_shrink... " >&6; }
 
-       if test $result = no; then
-                { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-                { { $as_echo "$as_me:$LINENO: error: *** Cannot locate ioctl() definition" >&5
-$as_echo "$as_me: error: *** Cannot locate ioctl() definition" >&2;}
-   { (exit 1); exit 1; }; }
-       else
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       fi
 
-
-       ZLIB=
-
-       if test "${ac_cv_header_zlib_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
-$as_echo_n "checking for zlib.h... " >&6; }
-if test "${ac_cv_header_zlib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-$as_echo "$ac_cv_header_zlib_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5
-$as_echo_n "checking zlib.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.c
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <zlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               int (*shrink)(struct shrinker *, struct shrink_control *sc)
+                       __attribute__ ((unused)) = NULL;
+               struct super_block sb __attribute__ ((unused)) = {
+                       .s_shrink.shrink = shrink,
+                       .s_shrink.seeks = DEFAULT_SEEKS,
+                       .s_shrink.batch = 0,
+               };
+
+  ;
+  return 0;
+}
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5
-$as_echo_n "checking zlib.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <zlib.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+
+
+       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=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+  (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_SHRINK 1
+_ACEOF
+
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
-$as_echo_n "checking for zlib.h... " >&6; }
-if test "${ac_cv_header_zlib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_zlib_h=$ac_header_preproc
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-$as_echo "$ac_cv_header_zlib_h" >&6; }
 
-fi
-if test "x$ac_cv_header_zlib_h" = x""yes; then
-  :
-else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-       *** zlib.h missing, zlib-devel package required
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
-       *** zlib.h missing, zlib-devel package required
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
-fi
+       rm -Rf build
 
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for compress2 in -lz" >&5
-$as_echo_n "checking for compress2 in -lz... " >&6; }
-if test "${ac_cv_lib_z_compress2+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+       { $as_echo "$as_me:$LINENO: checking whether super_block has s_bdi" >&5
+$as_echo_n "checking whether super_block has s_bdi... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char compress2 ();
+
+               #include <linux/fs.h>
+
 int
-main ()
+main (void)
 {
-return compress2 ();
+
+               struct super_block sb __attribute__ ((unused));
+               sb.s_bdi = NULL;
+
   ;
   return 0;
 }
+
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+
+
+       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=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_z_compress2=yes
+  (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_BDI 1
+_ACEOF
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_z_compress2=no
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress2" >&5
-$as_echo "$ac_cv_lib_z_compress2" >&6; }
-if test "x$ac_cv_lib_z_compress2" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
+       rm -Rf build
 
-  LIBS="-lz $LIBS"
 
-else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-       *** compress2() missing, zlib-devel package required
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
-       *** compress2() missing, zlib-devel package required
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+
+
+       { $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; }
 
 
-{ $as_echo "$as_me:$LINENO: checking for uncompress in -lz" >&5
-$as_echo_n "checking for uncompress in -lz... " >&6; }
-if test "${ac_cv_lib_z_uncompress+set}" = set; then
-  $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char uncompress ();
-int
-main ()
-{
-return uncompress ();
-  ;
-  return 0;
-}
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDI_SETUP_AND_REGISTER 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_z_uncompress=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_z_uncompress=no
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5
-$as_echo "$ac_cv_lib_z_uncompress" >&6; }
-if test "x$ac_cv_lib_z_uncompress" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
 
-  LIBS="-lz $LIBS"
 
 else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-       *** uncompress() missing, zlib-devel package required
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
-       *** uncompress() missing, zlib-devel package required
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+
+               { $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 for crc32 in -lz" >&5
-$as_echo_n "checking for crc32 in -lz... " >&6; }
-if test "${ac_cv_lib_z_crc32+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+
+       { $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.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char crc32 ();
+
+               #include <linux/fs.h>
+
 int
-main ()
+main (void)
 {
-return crc32 ();
+
+               struct inode node;
+               unsigned int link = 0;
+               (void) set_nlink(&node, link);
+
   ;
   return 0;
 }
+
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+
+
+       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=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_z_crc32=yes
+  (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
 
-       ac_cv_lib_z_crc32=no
-fi
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_crc32" >&5
-$as_echo "$ac_cv_lib_z_crc32" >&6; }
-if test "x$ac_cv_lib_z_crc32" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
 
-  LIBS="-lz $LIBS"
+       rm -Rf build
+
+
+
+
+       if test "$LINUX_OBJ" != "$LINUX"; then
+
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
 
-else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-       *** crc32() missing, zlib-devel package required
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
-       *** crc32() missing, zlib-devel package required
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
 fi
 
 
-       ZLIB="-lz"
 
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZLIB 1
-_ACEOF
+                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
 
 
+ ;;
+               user)
 
-       LIBUUID=
 
-       if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5
-$as_echo_n "checking for uuid/uuid.h... " >&6; }
-if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
+# Check whether --with-udevdir was given.
+if test "${with_udevdir+set}" = set; then
+  withval=$with_udevdir; udevdir=$withval
+else
+  udevdir='${exec_prefix}/lib/udev'
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5
-$as_echo "$ac_cv_header_uuid_uuid_h" >&6; }
+
+
+
+# Check whether --with-udevruledir was given.
+if test "${with_udevruledir+set}" = set; then
+  withval=$with_udevruledir; udevruledir=$withval
+else
+  udevruledir='${udevdir}/rules.d'
+fi
+
+
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking for target asm dir" >&5
+$as_echo_n "checking for target asm dir... " >&6; }
+       TARGET_ARCH=`echo ${target_cpu} | sed -e s/i.86/i386/`
+
+       case $TARGET_ARCH in
+       i386|x86_64)
+               TARGET_ASM_DIR=asm-${TARGET_ARCH}
+               ;;
+       *)
+               TARGET_ASM_DIR=asm-generic
+               ;;
+       esac
+
+
+       { $as_echo "$as_me:$LINENO: result: $TARGET_ASM_DIR" >&5
+$as_echo "$TARGET_ASM_DIR" >&6; }
+
+
+       { $as_echo "$as_me:$LINENO: checking for ioctl()" >&5
+$as_echo_n "checking for ioctl()... " >&6; }
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "ioctl" >/dev/null 2>&1; then
+  is_unistd=yes
+else
+  is_unistd=no
+fi
+rm -f conftest*
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/ioctl.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "ioctl" >/dev/null 2>&1; then
+  is_sys_ioctl=yes
+else
+  is_sys_ioctl=no
+fi
+rm -f conftest*
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stropts.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "ioctl" >/dev/null 2>&1; then
+  is_stropts=yes
+else
+  is_stropts=no
+fi
+rm -f conftest*
+
+
+       if test $is_unistd = yes; then
+               result=unistd.h
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IOCTL_IN_UNISTD_H 1
+_ACEOF
+
+       else
+
+               if test $is_sys_ioctl = yes; then
+                       result=sys/ioctl.h
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IOCTL_IN_SYS_IOCTL_H 1
+_ACEOF
+
+               elif test $is_stropts = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IOCTL_IN_STROPTS_H 1
+_ACEOF
+
+               else
+                       result=no
+               fi
+       fi
+
+       if test $result = no; then
+                { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+                { { $as_echo "$as_me:$LINENO: error: *** Cannot locate ioctl() definition" >&5
+$as_echo "$as_me: error: *** Cannot locate ioctl() definition" >&2;}
+   { (exit 1); exit 1; }; }
+       else
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       fi
+
+
+       ZLIB=
+
+       if test "${ac_cv_header_zlib_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
 else
   # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking uuid/uuid.h usability" >&5
-$as_echo_n "checking uuid/uuid.h usability... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5
+$as_echo_n "checking zlib.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16376,7 +16311,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <uuid/uuid.h>
+#include <zlib.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -16409,15 +16344,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 $as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ $as_echo "$as_me:$LINENO: checking uuid/uuid.h presence" >&5
-$as_echo_n "checking uuid/uuid.h presence... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5
+$as_echo_n "checking zlib.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <uuid/uuid.h>
+#include <zlib.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -16451,49 +16386,49 @@ $as_echo "$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ $as_echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5
-$as_echo_n "checking for uuid/uuid.h... " >&6; }
-if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_uuid_uuid_h=$ac_header_preproc
+  ac_cv_header_zlib_h=$ac_header_preproc
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5
-$as_echo "$ac_cv_header_uuid_uuid_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
 
 fi
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then
+if test "x$ac_cv_header_zlib_h" = x""yes; then
   :
 else
   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error:
-       *** uuid/uuid.h missing, libuuid-devel package required
+       *** zlib.h missing, zlib-devel package required
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error:
-       *** uuid/uuid.h missing, libuuid-devel package required
+       *** zlib.h missing, zlib-devel package required
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 fi
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5
-$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for compress2 in -lz" >&5
+$as_echo_n "checking for compress2 in -lz... " >&6; }
+if test "${ac_cv_lib_z_compress2+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid  $LIBS"
+LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16521,11 +16456,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char uuid_generate ();
+char compress2 ();
 int
 main ()
 {
-return uuid_generate ();
+return compress2 ();
   ;
   return 0;
 }
@@ -16551,12 +16486,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_uuid_uuid_generate=yes
+  ac_cv_lib_z_compress2=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_uuid_uuid_generate=no
+       ac_cv_lib_z_compress2=no
 fi
 
 rm -rf conftest.dSYM
@@ -16564,36 +16499,36 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress2" >&5
+$as_echo "$ac_cv_lib_z_compress2" >&6; }
+if test "x$ac_cv_lib_z_compress2" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUUID 1
+#define HAVE_LIBZ 1
 _ACEOF
 
-  LIBS="-luuid $LIBS"
+  LIBS="-lz $LIBS"
 
 else
   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error:
-       *** uuid_generate() missing, libuuid-devel package required
+       *** compress2() missing, zlib-devel package required
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error:
-       *** uuid_generate() missing, libuuid-devel package required
+       *** compress2() missing, zlib-devel package required
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 fi
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for uuid_is_null in -luuid" >&5
-$as_echo_n "checking for uuid_is_null in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_is_null+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for uncompress in -lz" >&5
+$as_echo_n "checking for uncompress in -lz... " >&6; }
+if test "${ac_cv_lib_z_uncompress+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid  $LIBS"
+LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16607,11 +16542,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char uuid_is_null ();
+char uncompress ();
 int
 main ()
 {
-return uuid_is_null ();
+return uncompress ();
   ;
   return 0;
 }
@@ -16637,12 +16572,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_uuid_uuid_is_null=yes
+  ac_cv_lib_z_uncompress=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_uuid_uuid_is_null=no
+       ac_cv_lib_z_uncompress=no
 fi
 
 rm -rf conftest.dSYM
@@ -16650,56 +16585,36 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_is_null" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_is_null" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_is_null" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUUID 1
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5
+$as_echo "$ac_cv_lib_z_uncompress" >&6; }
+if test "x$ac_cv_lib_z_uncompress" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
 _ACEOF
 
-  LIBS="-luuid $LIBS"
+  LIBS="-lz $LIBS"
 
 else
   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error:
-       *** uuid_is_null() missing, libuuid-devel package required
+       *** uncompress() missing, zlib-devel package required
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error:
-       *** uuid_is_null() missing, libuuid-devel package required
+       *** uncompress() missing, zlib-devel package required
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 fi
 
 
-       LIBUUID="-luuid"
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBUUID 1
-_ACEOF
-
-
-
-
-# Check whether --with-blkid was given.
-if test "${with_blkid+set}" = set; then
-  withval=$with_blkid;
-else
-  with_blkid=check
-fi
-
-
-       LIBBLKID=
-       if test "x$with_blkid" != xno; then
 
-               { $as_echo "$as_me:$LINENO: checking for blkid_get_cache in -lblkid" >&5
-$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
-if test "${ac_cv_lib_blkid_blkid_get_cache+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for crc32 in -lz" >&5
+$as_echo_n "checking for crc32 in -lz... " >&6; }
+if test "${ac_cv_lib_z_crc32+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblkid  $LIBS"
+LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16713,11 +16628,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char blkid_get_cache ();
+char crc32 ();
 int
 main ()
 {
-return blkid_get_cache ();
+return crc32 ();
   ;
   return 0;
 }
@@ -16743,12 +16658,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_blkid_blkid_get_cache=yes
+  ac_cv_lib_z_crc32=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_blkid_blkid_get_cache=no
+       ac_cv_lib_z_crc32=no
 fi
 
 rm -rf conftest.dSYM
@@ -16756,182 +16671,51 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
-$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
-if test "x$ac_cv_lib_blkid_blkid_get_cache" = x""yes; then
-
-                       { $as_echo "$as_me:$LINENO: checking for blkid zfs support" >&5
-$as_echo_n "checking for blkid zfs support... " >&6; }
-
-                       ZFS_DEV=`mktemp`
-                       dd if=/dev/zero of=$ZFS_DEV bs=1024k count=8 \
-                               >/dev/null 2>/dev/null
-                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
-                               dd of=$ZFS_DEV bs=1k count=8 \
-                               seek=132 conv=notrunc &>/dev/null \
-                               >/dev/null 2>/dev/null
-
-                       saved_LDFLAGS="$LDFLAGS"
-                       LDFLAGS="-lblkid"
-
-                       if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-                               #include <stdio.h>
-                               #include <blkid/blkid.h>
-
-int
-main ()
-{
-
-                               blkid_cache cache;
-                               char *value;
-
-                               if (blkid_get_cache(&cache, NULL) < 0)
-                                       return 1;
-
-                               value = blkid_get_tag_value(cache, "TYPE",
-                                                           "$ZFS_DEV");
-                               if (!value) {
-                                       blkid_put_cache(cache);
-                                       return 2;
-                               }
-
-                               if (strcmp(value, "zfs")) {
-                                       free(value);
-                                       blkid_put_cache(cache);
-                                       return 3;
-                               }
-
-                               free(value);
-                               blkid_put_cache(cache);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-                               rm -f $ZFS_DEV
-                               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-                               LIBBLKID="-lblkid"
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBBLKID 1
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_crc32" >&5
+$as_echo "$ac_cv_lib_z_crc32" >&6; }
+if test "x$ac_cv_lib_z_crc32" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
 _ACEOF
 
+  LIBS="-lz $LIBS"
 
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-
-                               rm -f $ZFS_DEV
-                               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-                               if test "x$with_blkid" != xcheck; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: --with-blkid given but unavailable
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: --with-blkid given but unavailable
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
-fi
-
-
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-
-                       LDFLAGS="$saved_LDFLAGS"
-
-else
-
-                       if test "x$with_blkid" != xcheck; then
   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: --with-blkid given but unavailable
+{ { $as_echo "$as_me:$LINENO: error:
+       *** crc32() missing, zlib-devel package required
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: --with-blkid given but unavailable
+$as_echo "$as_me: error:
+       *** crc32() missing, zlib-devel package required
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 fi
 
 
-
-fi
-
-
-fi
-
+       ZLIB="-lz"
 
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZLIB 1
+_ACEOF
 
-# Check whether --with-selinux was given.
-if test "${with_selinux+set}" = set; then
-  withval=$with_selinux;
-else
-  with_selinux=check
-fi
 
 
-       LIBSELINUX=
-       if test "x$with_selinux" != xno; then
+       LIBUUID=
 
-               if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for selinux/selinux.h" >&5
-$as_echo_n "checking for selinux/selinux.h... " >&6; }
-if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
+       if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5
+$as_echo_n "checking for uuid/uuid.h... " >&6; }
+if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_selinux_selinux_h" >&5
-$as_echo "$ac_cv_header_selinux_selinux_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5
+$as_echo "$ac_cv_header_uuid_uuid_h" >&6; }
 else
   # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking selinux/selinux.h usability" >&5
-$as_echo_n "checking selinux/selinux.h usability... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking uuid/uuid.h usability" >&5
+$as_echo_n "checking uuid/uuid.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16939,7 +16723,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <selinux/selinux.h>
+#include <uuid/uuid.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -16972,15 +16756,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 $as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ $as_echo "$as_me:$LINENO: checking selinux/selinux.h presence" >&5
-$as_echo_n "checking selinux/selinux.h presence... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking uuid/uuid.h presence" >&5
+$as_echo_n "checking uuid/uuid.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <selinux/selinux.h>
+#include <uuid/uuid.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -17014,48 +16798,63 @@ $as_echo "$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: selinux/selinux.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for selinux/selinux.h" >&5
-$as_echo_n "checking for selinux/selinux.h... " >&6; }
-if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5
+$as_echo_n "checking for uuid/uuid.h... " >&6; }
+if test "${ac_cv_header_uuid_uuid_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_selinux_selinux_h=$ac_header_preproc
+  ac_cv_header_uuid_uuid_h=$ac_header_preproc
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_selinux_selinux_h" >&5
-$as_echo "$ac_cv_header_selinux_selinux_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5
+$as_echo "$ac_cv_header_uuid_uuid_h" >&6; }
 
 fi
-if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then
+if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error:
+       *** uuid/uuid.h missing, libuuid-devel package required
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error:
+       *** uuid/uuid.h missing, libuuid-devel package required
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
 
-                       { $as_echo "$as_me:$LINENO: checking for is_selinux_enabled in -lselinux" >&5
-$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; }
-if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lselinux  $LIBS"
+LIBS="-luuid  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17069,11 +16868,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char is_selinux_enabled ();
+char uuid_generate ();
 int
 main ()
 {
-return is_selinux_enabled ();
+return uuid_generate ();
   ;
   return 0;
 }
@@ -17099,12 +16898,12 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_selinux_is_selinux_enabled=yes
+  ac_cv_lib_uuid_uuid_generate=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_selinux_is_selinux_enabled=no
+       ac_cv_lib_uuid_uuid_generate=no
 fi
 
 rm -rf conftest.dSYM
@@ -17112,689 +16911,1644 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5
-$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; }
-if test "x$ac_cv_lib_selinux_is_selinux_enabled" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
 
-                               LIBSELINUX="-lselinux"
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error:
+       *** uuid_generate() missing, libuuid-devel package required
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error:
+       *** uuid_generate() missing, libuuid-devel package required
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for uuid_is_null in -luuid" >&5
+$as_echo_n "checking for uuid_is_null in -luuid... " >&6; }
+if test "${ac_cv_lib_uuid_uuid_is_null+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_is_null ();
+int
+main ()
+{
+return uuid_is_null ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_uuid_uuid_is_null=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_uuid_uuid_is_null=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_is_null" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_is_null" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_is_null" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
+
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error:
+       *** uuid_is_null() missing, libuuid-devel package required
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error:
+       *** uuid_is_null() missing, libuuid-devel package required
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+
+       LIBUUID="-luuid"
 
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBSELINUX 1
+#define HAVE_LIBUUID 1
+_ACEOF
+
+
+
+
+# Check whether --with-blkid was given.
+if test "${with_blkid+set}" = set; then
+  withval=$with_blkid;
+else
+  with_blkid=check
+fi
+
+
+       LIBBLKID=
+       if test "x$with_blkid" != xno; then
+
+               { $as_echo "$as_me:$LINENO: checking for blkid_get_cache in -lblkid" >&5
+$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
+if test "${ac_cv_lib_blkid_blkid_get_cache+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_get_cache ();
+int
+main ()
+{
+return blkid_get_cache ();
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_blkid_blkid_get_cache=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_blkid_blkid_get_cache=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_get_cache" = x""yes; then
+
+                       { $as_echo "$as_me:$LINENO: checking for blkid zfs support" >&5
+$as_echo_n "checking for blkid zfs support... " >&6; }
+
+                       ZFS_DEV=`mktemp`
+                       dd if=/dev/zero of=$ZFS_DEV bs=1024k count=8 \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=132 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+
+                       saved_LDFLAGS="$LDFLAGS"
+                       LDFLAGS="-lblkid"
+
+                       if test "$cross_compiling" = yes; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                               #include <stdio.h>
+                               #include <blkid/blkid.h>
+
+int
+main ()
+{
+
+                               blkid_cache cache;
+                               char *value;
+
+                               if (blkid_get_cache(&cache, NULL) < 0)
+                                       return 1;
+
+                               value = blkid_get_tag_value(cache, "TYPE",
+                                                           "$ZFS_DEV");
+                               if (!value) {
+                                       blkid_put_cache(cache);
+                                       return 2;
+                               }
+
+                               if (strcmp(value, "zfs")) {
+                                       free(value);
+                                       blkid_put_cache(cache);
+                                       return 3;
+                               }
+
+                               free(value);
+                               blkid_put_cache(cache);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+                               LIBBLKID="-lblkid"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBBLKID 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+                               if test "x$with_blkid" != xcheck; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: --with-blkid given but unavailable
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: --with-blkid given but unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+                       LDFLAGS="$saved_LDFLAGS"
+
+else
+
+                       if test "x$with_blkid" != xcheck; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: --with-blkid given but unavailable
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: --with-blkid given but unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+
+
+fi
+
+
+fi
+
+
+
+
+# Check whether --with-selinux was given.
+if test "${with_selinux+set}" = set; then
+  withval=$with_selinux;
+else
+  with_selinux=check
+fi
+
+
+       LIBSELINUX=
+       if test "x$with_selinux" != xno; then
+
+               if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for selinux/selinux.h" >&5
+$as_echo_n "checking for selinux/selinux.h... " >&6; }
+if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_selinux_selinux_h" >&5
+$as_echo "$ac_cv_header_selinux_selinux_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking selinux/selinux.h usability" >&5
+$as_echo_n "checking selinux/selinux.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <selinux/selinux.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking selinux/selinux.h presence" >&5
+$as_echo_n "checking selinux/selinux.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <selinux/selinux.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: selinux/selinux.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: selinux/selinux.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for selinux/selinux.h" >&5
+$as_echo_n "checking for selinux/selinux.h... " >&6; }
+if test "${ac_cv_header_selinux_selinux_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_selinux_selinux_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_selinux_selinux_h" >&5
+$as_echo "$ac_cv_header_selinux_selinux_h" >&6; }
+
+fi
+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then
+
+                       { $as_echo "$as_me:$LINENO: checking for is_selinux_enabled in -lselinux" >&5
+$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; }
+if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char is_selinux_enabled ();
+int
+main ()
+{
+return is_selinux_enabled ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_selinux_is_selinux_enabled=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_selinux_is_selinux_enabled=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5
+$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; }
+if test "x$ac_cv_lib_selinux_is_selinux_enabled" = x""yes; then
+
+                               LIBSELINUX="-lselinux"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+
+else
+
+                               if test "x$with_selinux" != xcheck; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: --with-selinux given but unavailable
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: --with-selinux given but unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+fi
+
+
+fi
+
+
+else
+
+                       if test "x$with_selinux" != xcheck; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: --with-selinux given but unavailable
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: --with-selinux given but unavailable
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+fi
+
+
+fi
+
+
+
+else
+
+               { $as_echo "$as_me:$LINENO: checking for selinux support" >&5
+$as_echo_n "checking for selinux support... " >&6; }
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+
+
+
+       { $as_echo "$as_me:$LINENO: checking for -Wframe-larger-than=<size> support" >&5
+$as_echo_n "checking for -Wframe-larger-than=<size> support... " >&6; }
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wframe-larger-than=1024"
+
+       if test "$cross_compiling" = yes; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               FRAME_LARGER_THAN=-Wframe-larger-than=1024
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+               FRAME_LARGER_THAN=
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+       CFLAGS="$saved_flags"
+
+
+
+
+       { $as_echo "$as_me:$LINENO: checking whether pthread stack includes guard" >&5
+$as_echo_n "checking whether pthread stack includes guard... " >&6; }
+
+       saved_CFLAGS="$CFLAGS"
+       CFLAGS="-fstack-check"
+       saved_LDFLAGS="$LDFLAGS"
+       LDFLAGS="-lpthread"
+
+       if test "$cross_compiling" = yes; then
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+               #include <pthread.h>
+               #include <sys/resource.h>
+               #include <unistd.h>
+               #include <bits/local_lim.h>
+
+               #define PAGESIZE (sysconf(_SC_PAGESIZE))
+               #define STACK_SIZE 8192
+               #define BUFSIZE 4096
+
+               void * func(void *arg)
+               {
+                       char buf[BUFSIZE];
+               }
+
+int
+main ()
+{
+
+               pthread_t tid;
+               pthread_attr_t attr;
+               struct rlimit l;
+
+               l.rlim_cur = 0;
+               l.rlim_max = 0;
+               setrlimit(RLIMIT_CORE, &l);
+               pthread_attr_init(&attr);
+               pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN + STACK_SIZE);
+               pthread_attr_setguardsize(&attr, PAGESIZE);
+               pthread_create(&tid, &attr, func, NULL);
+               pthread_join(tid, NULL);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+
+cat >>confdefs.h <<\_ACEOF
+#define NPTL_GUARD_WITHIN_STACK 1
+_ACEOF
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+       CFLAGS="$saved_CFLAGS"
+       LDFLAGS="$saved_LDFLAGS"
+
+   ;;
+               all)
+
+
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then
+  withval=$with_linux; kernelsrc="$withval"
+fi
+
+
+
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
+
+
+       { $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
+
+                       headersdir="/lib/modules/$(uname -r)/build"
+                       sourcelink=$(readlink -f "$headersdir")
+
+else
+
+                       sourcelink=$(ls -1d /usr/src/kernels/* \
+                                    /usr/src/linux-* \
+                                    2>/dev/null | grep -v obj | tail -1)
+
+fi
+
+
+               if test -n "$sourcelink" && test -e ${sourcelink}; then
+
+                       kernelsrc=`readlink -f ${sourcelink}`
+
+else
+
+                       { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       { { $as_echo "$as_me:$LINENO: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option." >&5
+$as_echo "$as_me: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** 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
+
+               if test "$kernelsrc" = "NONE"; then
+
+                       kernsrcver=NONE
+
+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
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+
+elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+
+                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+
+else
+
+                       kernelbuild=${kernelsrc}
+
+fi
+
+
+fi
+
+       { $as_echo "$as_me:$LINENO: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
+
+       { $as_echo "$as_me:$LINENO: checking kernel source version" >&5
+$as_echo_n "checking kernel source version... " >&6; }
+       utsrelease1=$kernelbuild/include/linux/version.h
+       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
+
+               utsrelease=linux/utsrelease.h
+
+elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+
+               utsrelease=generated/utsrelease.h
+
+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
+
+               { $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
+
+
+       { $as_echo "$as_me:$LINENO: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
+
+       LINUX=${kernelsrc}
+       LINUX_OBJ=${kernelbuild}
+       LINUX_VERSION=${kernsrcver}
+
+
+
+
+
+
+       modpost=$LINUX/scripts/Makefile.modpost
+       { $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
+
+                       LINUX_SYMBOLS=Module.symvers
+
+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
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." >&5
+$as_echo "$as_me: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** 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
 
-                               if test "x$with_selinux" != xcheck; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: --with-selinux given but unavailable
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: --with-selinux given but unavailable
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+               LINUX_SYMBOLS=NONE
 
 fi
 
+       { $as_echo "$as_me:$LINENO: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
 
-fi
 
 
-else
 
-                       if test "x$with_selinux" != xcheck; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: --with-selinux given but unavailable
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: --with-selinux given but unavailable
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
 
+# Check whether --with-spl was given.
+if test "${with_spl+set}" = set; then
+  withval=$with_spl; splsrc="$withval"
 fi
 
 
+
+# Check whether --with-spl-obj was given.
+if test "${with_spl_obj+set}" = set; then
+  withval=$with_spl_obj; splbuild="$withval"
 fi
 
 
 
-else
+       { $as_echo "$as_me:$LINENO: checking spl source directory" >&5
+$as_echo_n "checking spl source directory... " >&6; }
+       if test -z "$splsrc"; then
 
-               { $as_echo "$as_me:$LINENO: checking for selinux support" >&5
-$as_echo_n "checking for selinux support... " >&6; }
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+               sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
+                           2>/dev/null | tail -1`
 
-fi
+               if test -z "$sourcelink" || test ! -e $sourcelink; then
 
+                       sourcelink=../spl
 
+fi
 
-       { $as_echo "$as_me:$LINENO: checking for -Wframe-larger-than=<size> support" >&5
-$as_echo_n "checking for -Wframe-larger-than=<size> support... " >&6; }
 
-       saved_flags="$CFLAGS"
-       CFLAGS="$CFLAGS -Wframe-larger-than=1024"
+               if test -e $sourcelink; then
+
+                       splsrc=`readlink -f ${sourcelink}`
 
-       if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
+                       { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       { { $as_echo "$as_me:$LINENO: error:
+       *** Please make sure the spl devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the spl source with the '--with-spl=PATH' option." >&5
+$as_echo "$as_me: error:
+       *** Please make sure the spl devel package for your distribution
+       *** 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; }; }
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+fi
 
-               FRAME_LARGER_THAN=-Wframe-larger-than=1024
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
+               if test "$splsrc" = "NONE"; then
 
-               FRAME_LARGER_THAN=
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+                       splbuild=NONE
+                       splsrcver=NONE
 
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+
 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
 
-       CFLAGS="$saved_flags"
+       { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
+$as_echo "$splbuild" >&6; }
 
+       { $as_echo "$as_me:$LINENO: checking spl source version" >&5
+$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-SPL_META_RELEASE") |
+                           cpp -I $splbuild |
+                           grep "^splsrcver=" | tr -d \" | cut -d= -f2`
 
-       { $as_echo "$as_me:$LINENO: checking whether pthread stack includes guard" >&5
-$as_echo_n "checking whether pthread stack includes guard... " >&6; }
+fi
 
-       saved_CFLAGS="$CFLAGS"
-       CFLAGS="-fstack-check"
-       saved_LDFLAGS="$LDFLAGS"
-       LDFLAGS="-lpthread"
 
-       if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+       if test -z "$splsrcver"; then
 
-               #include <pthread.h>
-               #include <sys/resource.h>
-               #include <unistd.h>
-               #include <bits/local_lim.h>
+               { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               { { $as_echo "$as_me:$LINENO: error:
+       *** Cannot determine the version of the spl source.
+       *** Please prepare the spl source before running this script" >&5
+$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; }; }
 
-               #define PAGESIZE (sysconf(_SC_PAGESIZE))
-               #define STACK_SIZE 8192
-               #define BUFSIZE 4096
+fi
 
-               void * func(void *arg)
-               {
-                       char buf[BUFSIZE];
-               }
 
-int
-main ()
-{
+       { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
+$as_echo "$splsrcver" >&6; }
 
-               pthread_t tid;
-               pthread_attr_t attr;
-               struct rlimit l;
+       SPL=${splsrc}
+       SPL_OBJ=${splbuild}
+       SPL_VERSION=${splsrcver}
 
-               l.rlim_cur = 0;
-               l.rlim_max = 0;
-               setrlimit(RLIMIT_CORE, &l);
-               pthread_attr_init(&attr);
-               pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN + STACK_SIZE);
-               pthread_attr_setguardsize(&attr, PAGESIZE);
-               pthread_create(&tid, &attr, func, NULL);
-               pthread_join(tid, NULL);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&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" >&5
-$as_echo "no" >&6; }
 
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
 
+       { $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
 
-cat >>confdefs.h <<\_ACEOF
-#define NPTL_GUARD_WITHIN_STACK 1
-_ACEOF
+               SPL_SYMBOLS=Module.symvers
 
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+elif test -r $SPL_OBJ/Modules.symvers; then
 
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+               SPL_SYMBOLS=Modules.symvers
+
+elif test -r $SPL_OBJ/module/Module.symvers; then
 
+               SPL_SYMBOLS=Module.symvers
 
-       CFLAGS="$saved_CFLAGS"
-       LDFLAGS="$saved_LDFLAGS"
+elif test -r $SPL_OBJ/module/Modules.symvers; then
 
-   ;;
-               all)
+               SPL_SYMBOLS=Modules.symvers
 
+else
+
+               SPL_SYMBOLS=$LINUX_SYMBOLS
 
-# Check whether --with-linux was given.
-if test "${with_linux+set}" = set; then
-  withval=$with_linux; kernelsrc="$withval"
 fi
 
 
+       { $as_echo "$as_me:$LINENO: result: $SPL_SYMBOLS" >&5
+$as_echo "$SPL_SYMBOLS" >&6; }
 
-# Check whether --with-linux-obj was given.
-if test "${with_linux_obj+set}" = set; then
-  withval=$with_linux_obj; kernelbuild="$withval"
-fi
 
 
-       { $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")
+       { $as_echo "$as_me:$LINENO: checking whether Linux was built with CONFIG_PREEMPT" >&5
+$as_echo_n "checking whether Linux was built with CONFIG_PREEMPT... " >&6; }
 
-elif test -e "/lib/modules/$(uname -r)/build"; then
 
-                       headersdir="/lib/modules/$(uname -r)/build"
-                       sourcelink=$(readlink -f "$headersdir")
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-else
 
-                       sourcelink=$(ls -1d /usr/src/kernels/* \
-                                    /usr/src/linux-* \
-                                    2>/dev/null | grep -v obj | tail -1)
+               #include <linux/module.h>
 
-fi
+int
+main (void)
+{
 
+               #ifndef CONFIG_PREEMPT
+               #error CONFIG_PREEMPT not #defined
+               #endif
 
-               if test -n "$sourcelink" && test -e ${sourcelink}; then
+  ;
+  return 0;
+}
 
-                       kernelsrc=`readlink -f ${sourcelink}`
+_ACEOF
 
-else
 
-                       { $as_echo "$as_me:$LINENO: result: Not found" >&5
-$as_echo "Not found" >&6; }
-                       { { $as_echo "$as_me:$LINENO: error:
-       *** Please make sure the kernel devel package for your distribution
-       *** is installed then try again.  If that fails you can specify the
-       *** location of the kernel source with the '--with-linux=PATH' option." >&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; }
+               { { $as_echo "$as_me:$LINENO: error:
+       *** Kernel built with CONFIG_PREEMPT which is not supported.
+       *** You must rebuild your kernel without this option." >&5
 $as_echo "$as_me: error:
-       *** Please make sure the kernel devel package for your distribution
-       *** is installed then try again.  If that fails you can specify the
-       *** location of the kernel source with the '--with-linux=PATH' option." >&2;}
+       *** Kernel built with CONFIG_PREEMPT which is not supported.
+       *** You must rebuild your kernel without this option." >&2;}
    { (exit 1); exit 1; }; }
 
-fi
+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; }
 
-else
 
-               if test "$kernelsrc" = "NONE"; then
 
-                       kernsrcver=NONE
 
 fi
 
+       rm -Rf build
+
 
-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 "$ZFS_META_LICENSE" = CDDL; then
 
-               if test -e "/lib/modules/$(uname -r)/build"; 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; }
 
-                       kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
 
-elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
 
-elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+               #include <linux/module.h>
 
-                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+int
+main (void)
+{
 
-elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+               #ifndef CONFIG_DEBUG_LOCK_ALLOC
+               #error CONFIG_DEBUG_LOCK_ALLOC not #defined
+               #endif
 
-                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+  ;
+  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; }
+               { { $as_echo "$as_me:$LINENO: error:
+       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is
+       *** incompatible with the CDDL license.  You must rebuild
+       *** your kernel without this option." >&5
+$as_echo "$as_me: error:
+       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is
+       *** incompatible with the CDDL license.  You must rebuild
+       *** your kernel without this option." >&2;}
+   { (exit 1); exit 1; }; }
 
 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; }
 
-                       kernelbuild=${kernelsrc}
 
-fi
 
 
 fi
 
-       { $as_echo "$as_me:$LINENO: result: $kernelbuild" >&5
-$as_echo "$kernelbuild" >&6; }
+       rm -Rf build
 
-       { $as_echo "$as_me:$LINENO: checking kernel source version" >&5
-$as_echo_n "checking kernel source version... " >&6; }
-       utsrelease1=$kernelbuild/include/linux/version.h
-       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
 
-               utsrelease=linux/utsrelease.h
+fi
 
-elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
 
-               utsrelease=generated/utsrelease.h
+       if test "$ZFS_META_LICENSE" = GPL; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GPL_ONLY_SYMBOLS 1
+_ACEOF
+
 
 fi
 
 
-       if test "$utsrelease"; then
 
-               kernsrcver=`(echo "#include <$utsrelease>";
-                            echo "kernsrcver=UTS_RELEASE") |
-                            cpp -I $kernelbuild/include |
-                            grep "^kernsrcver=" | cut -d \" -f 2`
+       { $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"
 
-               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; }; }
+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/blkdev.h>
 
-else
+int
+main (void)
+{
 
-               { $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; }; }
+               int (*blk_open) (struct block_device *, fmode_t) = NULL;
+               int (*blk_release) (struct gendisk *, fmode_t) = NULL;
+               int (*blk_ioctl) (struct block_device *, fmode_t,
+                                 unsigned, unsigned long) = NULL;
+               int (*blk_compat_ioctl) (struct block_device *, fmode_t,
+                                         unsigned, unsigned long) = NULL;
+               struct block_device_operations blk_ops = {
+                       .open           = blk_open,
+                       .release        = blk_release,
+                       .ioctl          = blk_ioctl,
+                       .compat_ioctl   = blk_compat_ioctl,
+               };
+
+               blk_ops.open(NULL, 0);
+               blk_ops.release(NULL, 0);
+               blk_ops.ioctl(NULL, 0, 0, 0);
+               blk_ops.compat_ioctl(NULL, 0, 0, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
 
-fi
 
+       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: $kernsrcver" >&5
-$as_echo "$kernsrcver" >&6; }
+               { $as_echo "$as_me:$LINENO: result: struct block_device" >&5
+$as_echo "struct block_device" >&6; }
 
-       LINUX=${kernelsrc}
-       LINUX_OBJ=${kernelbuild}
-       LINUX_VERSION=${kernsrcver}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BDEV_BLOCK_DEVICE_OPERATIONS 1
+_ACEOF
 
 
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+               { $as_echo "$as_me:$LINENO: result: struct inode" >&5
+$as_echo "struct inode" >&6; }
 
 
 
-       modpost=$LINUX/scripts/Makefile.modpost
-       { $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
+fi
 
-               if grep -q Modules.symvers $modpost; then
+       rm -Rf build
 
-                       LINUX_SYMBOLS=Modules.symvers
 
-else
+       EXTRA_KCFLAGS="$tmp_flags"
 
-                       LINUX_SYMBOLS=Module.symvers
+       { $as_echo "$as_me:$LINENO: checking whether kernel defines fmode_t" >&5
+$as_echo_n "checking whether kernel defines fmode_t... " >&6; }
 
-fi
 
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-               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
-       *** kernel is configured, built, and the '--with-linux=PATH' configure
-       *** option refers to the location of the kernel source." >&5
-$as_echo "$as_me: error:
-       *** Please make sure the kernel devel package for your distribution
-       *** is installed.  If your building with a custom kernel make sure the
-       *** kernel is configured, built, and the '--with-linux=PATH' configure
-       *** option refers to the location of the kernel source." >&2;}
-   { (exit 1); exit 1; }; }
+               #include <linux/types.h>
 
-fi
+int
+main (void)
+{
 
+               fmode_t *ptr __attribute__ ((unused));
 
-else
+  ;
+  return 0;
+}
 
-               LINUX_SYMBOLS=NONE
+_ACEOF
 
-fi
 
-       { $as_echo "$as_me:$LINENO: result: $LINUX_SYMBOLS" >&5
-$as_echo "$LINUX_SYMBOLS" >&6; }
+       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_FMODE_T 1
+_ACEOF
 
 
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Check whether --with-spl was given.
-if test "${with_spl+set}" = set; then
-  withval=$with_spl; splsrc="$withval"
-fi
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 
 
-# Check whether --with-spl-obj was given.
-if test "${with_spl_obj+set}" = set; then
-  withval=$with_spl_obj; splbuild="$withval"
 fi
 
+       rm -Rf build
 
 
-       { $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
+       { $as_echo "$as_me:$LINENO: checking whether kernel defines KOBJ_NAME_LEN" >&5
+$as_echo_n "checking whether kernel defines KOBJ_NAME_LEN... " >&6; }
 
-fi
 
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-               if test -e $sourcelink; then
 
-                       splsrc=`readlink -f ${sourcelink}`
+               #include <linux/kobject.h>
 
-else
+int
+main (void)
+{
 
-                       { $as_echo "$as_me:$LINENO: result: Not found" >&5
-$as_echo "Not found" >&6; }
-                       { { $as_echo "$as_me:$LINENO: error:
-       *** Please make sure the spl devel package for your distribution
-       *** is installed then try again.  If that fails you can specify the
-       *** location of the spl source with the '--with-spl=PATH' option." >&5
-$as_echo "$as_me: error:
-       *** Please make sure the spl devel package for your distribution
-       *** 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; }; }
+               int val __attribute__ ((unused));
+               val = KOBJ_NAME_LEN;
 
-fi
+  ;
+  return 0;
+}
 
+_ACEOF
 
-else
 
-               if test "$splsrc" = "NONE"; then
+       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
 
-                       splbuild=NONE
-                       splsrcver=NONE
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KOBJ_NAME_LEN 1
+_ACEOF
 
 
-fi
+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; }
 
-       { $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
 
-       { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
-$as_echo "$splbuild" >&6; }
-
-       { $as_echo "$as_me:$LINENO: checking spl source version" >&5
-$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
+       rm -Rf build
 
 
-               splsrcver=`(echo "#include <spl_config.h>";
-                           echo "splsrcver=SPL_META_VERSION-SPL_META_RELEASE") |
-                           cpp -I $splbuild |
-                           grep "^splsrcver=" | tr -d \" | cut -d= -f2`
 
-fi
 
+       { $as_echo "$as_me:$LINENO: checking whether symbol blkdev_get_by_path is exported" >&5
+$as_echo_n "checking whether symbol blkdev_get_by_path is exported... " >&6; }
+       grep -q -E '[[:space:]]blkdev_get_by_path[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
 
-       if test -z "$splsrcver"; 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
 
-               { $as_echo "$as_me:$LINENO: result: Not found" >&5
-$as_echo "Not found" >&6; }
-               { { $as_echo "$as_me:$LINENO: error:
-       *** Cannot determine the version of the spl source.
-       *** Please prepare the spl source before running this script" >&5
-$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; }; }
+                               export=1
+                               break;
 
 fi
 
+               done
+               if test $export -eq 0; then
 
-       { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
-$as_echo "$splsrcver" >&6; }
-
-       SPL=${splsrc}
-       SPL_OBJ=${splbuild}
-       SPL_VERSION=${splsrcver}
-
-
-
-
-
-
-       { $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
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
-               SPL_SYMBOLS=Module.symvers
 
-elif test -r $SPL_OBJ/Modules.symvers; then
+else
 
-               SPL_SYMBOLS=Modules.symvers
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-elif test -r $SPL_OBJ/module/Module.symvers; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BLKDEV_GET_BY_PATH 1
+_ACEOF
 
-               SPL_SYMBOLS=Module.symvers
 
-elif test -r $SPL_OBJ/module/Modules.symvers; then
+fi
 
-               SPL_SYMBOLS=Modules.symvers
 
 else
 
-               SPL_SYMBOLS=$LINUX_SYMBOLS
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BLKDEV_GET_BY_PATH 1
+_ACEOF
 
 
-       { $as_echo "$as_me:$LINENO: result: $SPL_SYMBOLS" >&5
-$as_echo "$SPL_SYMBOLS" >&6; }
+fi
 
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether symbol open_bdev_exclusive is exported" >&5
+$as_echo_n "checking whether symbol open_bdev_exclusive is exported... " >&6; }
+       grep -q -E '[[:space:]]open_bdev_exclusive[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
 
-       { $as_echo "$as_me:$LINENO: checking whether Linux was built with CONFIG_PREEMPT" >&5
-$as_echo_n "checking whether Linux was built with CONFIG_PREEMPT... " >&6; }
+               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;
 
-cat confdefs.h - <<_ACEOF >conftest.c
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+fi
 
+               done
+               if test $export -eq 0; then
 
-               #include <linux/module.h>
+                       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
-int
-main (void)
-{
 
-               #ifndef CONFIG_PREEMPT
-               #error CONFIG_PREEMPT not #defined
-               #endif
+else
 
-  ;
-  return 0;
-}
+                       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPEN_BDEV_EXCLUSIVE 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: yes" >&5
-$as_echo "yes" >&6; }
-               { { $as_echo "$as_me:$LINENO: error:
-       *** Kernel built with CONFIG_PREEMPT which is not supported.
-       *** You must rebuild your kernel without this option." >&5
-$as_echo "$as_me: error:
-       *** Kernel built with CONFIG_PREEMPT which is not supported.
-       *** You must rebuild your kernel without this option." >&2;}
-   { (exit 1); exit 1; }; }
 
 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; }
 
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPEN_BDEV_EXCLUSIVE 1
+_ACEOF
 
 
 fi
 
-       rm -Rf build
-
 
 
 
-       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; }
+       { $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
@@ -17805,15 +18559,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/module.h>
+               #include <linux/buffer_head.h>
 
 int
 main (void)
 {
 
-               #ifndef CONFIG_DEBUG_LOCK_ALLOC
-               #error CONFIG_DEBUG_LOCK_ALLOC not #defined
-               #endif
+               struct block_device *bdev = NULL;
+               invalidate_bdev(bdev);
 
   ;
   return 0;
@@ -17838,15 +18591,11 @@ _ACEOF
 
                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
-               { { $as_echo "$as_me:$LINENO: error:
-       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is
-       *** incompatible with the CDDL license.  You must rebuild
-       *** your kernel without this option." >&5
-$as_echo "$as_me: error:
-       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is
-       *** incompatible with the CDDL license.  You must rebuild
-       *** your kernel without this option." >&2;}
-   { (exit 1); exit 1; }; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_1ARG_INVALIDATE_BDEV 1
+_ACEOF
+
 
 else
   $as_echo "$as_me: failed program was:" >&5
@@ -17857,7 +18606,6 @@ $as_echo "no" >&6; }
 
 
 
-
 fi
 
        rm -Rf build
 
 
 
-fi
-
-
-       if test "$ZFS_META_LICENSE" = GPL; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GPL_ONLY_SYMBOLS 1
-_ACEOF
-
-
-fi
-
-
-
-       { $as_echo "$as_me:$LINENO: checking block device operation prototypes" >&5
-$as_echo_n "checking block device operation prototypes... " >&6; }
+       { $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"
 
@@ -17900,23 +18633,8 @@ int
 main (void)
 {
 
-               int (*blk_open) (struct block_device *, fmode_t) = NULL;
-               int (*blk_release) (struct gendisk *, fmode_t) = NULL;
-               int (*blk_ioctl) (struct block_device *, fmode_t,
-                                 unsigned, unsigned long) = NULL;
-               int (*blk_compat_ioctl) (struct block_device *, fmode_t,
-                                         unsigned, unsigned long) = NULL;
-               struct block_device_operations blk_ops = {
-                       .open           = blk_open,
-                       .release        = blk_release,
-                       .ioctl          = blk_ioctl,
-                       .compat_ioctl   = blk_compat_ioctl,
-               };
-
-               blk_ops.open(NULL, 0);
-               blk_ops.release(NULL, 0);
-               blk_ops.ioctl(NULL, 0, 0, 0);
-               blk_ops.compat_ioctl(NULL, 0, 0, 0);
+               struct block_device *bdev = NULL;
+               bdev_logical_block_size(bdev);
 
   ;
   return 0;
@@ -17939,11 +18657,11 @@ _ACEOF
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-               { $as_echo "$as_me:$LINENO: result: struct block_device" >&5
-$as_echo "struct block_device" >&6; }
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDEV_BLOCK_DEVICE_OPERATIONS 1
+#define HAVE_BDEV_LOGICAL_BLOCK_SIZE 1
 _ACEOF
 
 
@@ -17951,8 +18669,8 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-               { $as_echo "$as_me:$LINENO: result: struct inode" >&5
-$as_echo "struct inode" >&6; }
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 
 
 
        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; }
+
+       { $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
@@ -17975,13 +18695,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/types.h>
+               #include <linux/bio.h>
 
 int
 main (void)
 {
 
-               fmode_t *ptr __attribute__ ((unused));
+               struct bio bio;
+               (void)bio_empty_barrier(&bio);
 
   ;
   return 0;
@@ -18008,7 +18729,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FMODE_T 1
+#define HAVE_BIO_EMPTY_BARRIER 1
 _ACEOF
 
 
@@ -18028,8 +18749,8 @@ fi
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether kernel defines KOBJ_NAME_LEN" >&5
-$as_echo_n "checking whether kernel defines KOBJ_NAME_LEN... " >&6; }
+       { $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
@@ -18040,14 +18761,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
-               #include <linux/kobject.h>
+               #include <linux/bio.h>
 
 int
 main (void)
 {
 
-               int val __attribute__ ((unused));
-               val = KOBJ_NAME_LEN;
+               int flags __attribute__ ((unused));
+               flags = (1 << BIO_RW_FAILFAST);
 
   ;
   return 0;
@@ -18074,7 +18795,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_KOBJ_NAME_LEN 1
+#define HAVE_BIO_RW_FAILFAST 1
 _ACEOF
 
 
 
 
 
-       { $as_echo "$as_me:$LINENO: checking whether symbol blkdev_get_by_path is exported" >&5
-$as_echo_n "checking whether symbol blkdev_get_by_path is exported... " >&6; }
-       grep -q -E '[[:space:]]blkdev_get_by_path[[:space:]]' \
-               $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
-
-               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_BLKDEV_GET_BY_PATH 1
-_ACEOF
-
-
-fi
-
-
-else
+       { $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: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLKDEV_GET_BY_PATH 1
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 
-fi
-
-
-
-
-       { $as_echo "$as_me:$LINENO: checking whether symbol open_bdev_exclusive is exported" >&5
-$as_echo_n "checking whether symbol open_bdev_exclusive is exported... " >&6; }
-       grep -q -E '[[:space:]]open_bdev_exclusive[[:space:]]' \
-               $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
+               #include <linux/bio.h>
 
-                               export=1
-                               break;
+int
+main (void)
+{
 
-fi
+               int flags __attribute__ ((unused));
+               flags = ((1 << BIO_RW_FAILFAST_DEV) |
+                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
+                        (1 << BIO_RW_FAILFAST_DRIVER));
 
-               done
-               if test $export -eq 0; then
+  ;
+  return 0;
+}
 
-                       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+_ACEOF
 
 
-else
+       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 "$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_DTD 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 REQ_FAILFAST_MASK is defined" >&5
+$as_echo_n "checking whether REQ_FAILFAST_MASK is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18212,14 +18895,14 @@ 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 = REQ_FAILFAST_MASK;
 
   ;
   return 0;
@@ -18246,7 +18929,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_1ARG_INVALIDATE_BDEV 1
+#define HAVE_BIO_REQ_FAILFAST_MASK 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; }
+       { $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="-Wno-unused-but-set-variable"
+       EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18280,14 +18963,16 @@ 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);
+               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;
@@ -18314,7 +18999,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BDEV_LOGICAL_BLOCK_SIZE 1
+#define HAVE_2ARGS_BIO_END_IO_T 1
 _ACEOF
 
 
@@ -18335,9 +19020,8 @@ fi
        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"
+       { $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
@@ -18354,8 +19038,8 @@ int
 main (void)
 {
 
-               struct bio bio;
-               (void)bio_empty_barrier(&bio);
+               int flags __attribute__ ((unused));
+               flags = BIO_RW_SYNC;
 
   ;
   return 0;
@@ -18382,7 +19066,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_EMPTY_BARRIER 1
+#define HAVE_BIO_RW_SYNC 1
 _ACEOF
 
 
@@ -18402,8 +19086,8 @@ fi
 
 
 
-       { $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_SYNCIO is defined" >&5
+$as_echo_n "checking whether BIO_RW_SYNCIO is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18421,7 +19105,7 @@ main (void)
 {
 
                int flags __attribute__ ((unused));
-               flags = (1 << BIO_RW_FAILFAST);
+               flags = BIO_RW_SYNCIO;
 
   ;
   return 0;
@@ -18448,7 +19132,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_FAILFAST 1
+#define HAVE_BIO_RW_SYNCIO 1
 _ACEOF
 
 
@@ -18468,8 +19152,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 REQ_SYNC is defined" >&5
+$as_echo_n "checking whether REQ_SYNC is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18487,9 +19171,7 @@ main (void)
 {
 
                int flags __attribute__ ((unused));
-               flags = ((1 << BIO_RW_FAILFAST_DEV) |
-                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
-                        (1 << BIO_RW_FAILFAST_DRIVER));
+               flags = REQ_SYNC;
 
   ;
   return 0;
@@ -18516,7 +19198,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_FAILFAST_DTD 1
+#define HAVE_REQ_SYNC 1
 _ACEOF
 
 
 
 
 
-       { $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 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
@@ -18548,14 +19232,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 = REQ_FAILFAST_MASK;
+               struct request *req = NULL;
+               (void) blk_end_request(req, 0, 0);
 
   ;
   return 0;
@@ -18582,7 +19266,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_REQ_FAILFAST_MASK 1
+#define HAVE_BLK_END_REQUEST 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; }
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
+       { $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
@@ -18616,16 +19297,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)
 {
 
-               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;
@@ -18648,21 +19330,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_2ARGS_BIO_END_IO_T 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
        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_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
@@ -18685,14 +19369,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_SYNC;
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
 
   ;
   return 0;
@@ -18719,7 +19403,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BIO_RW_SYNC 1
+#define HAVE_BLK_QUEUE_FLUSH 1
 _ACEOF
 
 
@@ -18738,9 +19422,8 @@ fi
 
 
 
-
-       { $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 GPL-only" >&5
+$as_echo_n "checking whether blk_queue_flush() is GPL-only... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18751,14 +19434,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_SYNCIO;
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
 
   ;
   return 0;
@@ -18781,21 +19467,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_SYNCIO 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 REQ_SYNC is defined" >&5
-$as_echo_n "checking whether REQ_SYNC is defined... " >&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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18817,14 +19506,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 = REQ_SYNC;
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
 
   ;
   return 0;
@@ -18851,7 +19540,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_REQ_SYNC 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 available" >&5
-$as_echo_n "checking whether blk_end_request() is available... " >&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"
 
@@ -18891,8 +19581,8 @@ 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;
@@ -18919,7 +19609,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_END_REQUEST 1
+#define HAVE_BLK_QUEUE_MAX_SEGMENTS 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_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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -18950,17 +19644,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 *req = NULL;
-               (void) blk_end_request(req, 0, 0);
+               struct request_queue *q = NULL;
+               unsigned short block_size = 1;
+               (void) blk_queue_physical_block_size(q, block_size);
 
   ;
   return 0;
@@ -18983,21 +19675,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_PHYSICAL_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
@@ -19008,8 +19700,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_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"
 
@@ -19029,7 +19721,8 @@ 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;
@@ -19056,7 +19749,7 @@ _ACEOF
 $as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BLK_QUEUE_FLUSH 1
+#define HAVE_BLK_QUEUE_IO_OPT 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_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"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -19087,17 +19784,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_queue *q = NULL;
-               (void) blk_queue_flush(q, REQ_FLUSH);
+               (void) blk_queue_nonrot(q);
 
   ;
   return 0;
@@ -19120,21 +19814,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_NONROT 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
index 77439a0..b7c3be6 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index e1bfd5a..d92a983 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 8af2d9a..b5e53a4 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 3baf4c0..0106a50 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 0c7e35d..e0bc342 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index c9e8a83..d4bb07c 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 815d089..e88c692 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 3707fad..56a1baf 100644 (file)
@@ -200,6 +200,53 @@ __blk_rq_bytes(struct request *req)
 #define blk_queue_stackable(q) ((q)->request_fn == NULL)
 #endif
 
+/*
+ * 2.6.34 API change,
+ * The blk_queue_max_hw_sectors() function replaces blk_queue_max_sectors().
+ */
+#ifndef HAVE_BLK_QUEUE_MAX_HW_SECTORS
+#define blk_queue_max_hw_sectors __blk_queue_max_hw_sectors
+static inline void
+__blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
+{
+       blk_queue_max_sectors(q, max_hw_sectors);
+}
+#endif
+
+/*
+ * 2.6.34 API change,
+ * The blk_queue_max_segments() function consolidates
+ * blk_queue_max_hw_segments() and blk_queue_max_phys_segments().
+ */
+#ifndef HAVE_BLK_QUEUE_MAX_SEGMENTS
+#define blk_queue_max_segments __blk_queue_max_segments
+static inline void
+__blk_queue_max_segments(struct request_queue *q, unsigned short max_segments)
+{
+       blk_queue_max_phys_segments(q, max_segments);
+       blk_queue_max_hw_segments(q, max_segments);
+}
+#endif
+
+/*
+ * 2.6.30 API change,
+ * The blk_queue_physical_block_size() function was introduced to
+ * indicate the smallest I/O the device can write without incurring
+ * a read-modify-write penalty.  For older kernels this is a no-op.
+ */
+#ifndef HAVE_BLK_QUEUE_PHYSICAL_BLOCK_SIZE
+#define blk_queue_physical_block_size(q, x)    ((void)(0))
+#endif
+
+/*
+ * 2.6.30 API change,
+ * The blk_queue_io_opt() function was added to indicate the optimal
+ * I/O size for the device.  For older kernels this is a no-op.
+ */
+#ifndef HAVE_BLK_QUEUE_IO_OPT
+#define blk_queue_io_opt(q, x)                 ((void)(0))
+#endif
+
 #ifndef HAVE_GET_DISK_RO
 static inline int
 get_disk_ro(struct gendisk *disk)
index 93742b0..3903cef 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index f3bfcd3..46255c8 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 8e87ecb..5dd6f48 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index dee6403..550b106 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 3f8a9b4..f68acbe 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 361e74d..c87bbb3 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 92865fd..3fcb93d 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 95d09ac..cbfff61 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 2355023..8951784 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 4db8c35..b77af23 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index f838c91..7fb66ef 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 4d8e450..bf418b9 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 9edbecf..2d6f746 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index c04faa5..9c693d4 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index eeccf56..789214e 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 246f719..058f143 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index d70ce70..840100f 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 201b179..81d011e 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index bbbd459..1107586 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 9a58c51..065f9dc 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 94d0d27..62db1c8 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 53f8be1..ae6626b 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index c0fc9dc..6870365 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 45384f8..c62a360 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 238e0b3..39ec393 100644 (file)
@@ -52,6 +52,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 7e50717..f428397 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 11e3549..4a12e10 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 0aaa268..1636581 100644 (file)
@@ -1188,6 +1188,15 @@ __zvol_create_minor(const char *name)
 
        set_capacity(zv->zv_disk, zv->zv_volsize >> 9);
 
+       blk_queue_max_hw_sectors(zv->zv_queue, UINT_MAX);
+       blk_queue_max_segments(zv->zv_queue, UINT16_MAX);
+       blk_queue_max_segment_size(zv->zv_queue, UINT_MAX);
+       blk_queue_physical_block_size(zv->zv_queue, zv->zv_volblocksize);
+       blk_queue_io_opt(zv->zv_queue, zv->zv_volblocksize);
+#ifdef HAVE_BLK_QUEUE_NONROT
+       queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zv->zv_queue);
+#endif
+
        if (zil_replay_disable)
                zil_destroy(dmu_objset_zil(os), B_FALSE);
        else
index e762912..f096685 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 5384161..e50a0a4 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index ec5f01e..46e7e08 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index f60ecf8..33ceab9 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 61b1b06..6e45dbb 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 498fb73..7fbdbc1 100644 (file)
@@ -50,6 +50,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index 473ae0b..2712b6e 100644 (file)
@@ -51,6 +51,11 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/kernel-blk-end-request.m4 \
        $(top_srcdir)/config/kernel-blk-fetch-request.m4 \
        $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-nonrot.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-physical-block-size.m4 \
        $(top_srcdir)/config/kernel-blk-requeue-request.m4 \
        $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \
        $(top_srcdir)/config/kernel-blk-rq-pos.m4 \
index b14be65..b90643f 100644 (file)
 /* blk_queue_flush() is GPL-only */
 #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY
 
+/* blk_queue_io_opt() is available */
+#undef HAVE_BLK_QUEUE_IO_OPT
+
+/* blk_queue_max_hw_sectors() is available */
+#undef HAVE_BLK_QUEUE_MAX_HW_SECTORS
+
+/* blk_queue_max_segments() is available */
+#undef HAVE_BLK_QUEUE_MAX_SEGMENTS
+
+/* blk_queue_nonrot() is available */
+#undef HAVE_BLK_QUEUE_NONROT
+
+/* blk_queue_physical_block_size() is available */
+#undef HAVE_BLK_QUEUE_PHYSICAL_BLOCK_SIZE
+
 /* blk_requeue_request() is available */
 #undef HAVE_BLK_REQUEUE_REQUEST