[COSMIC] UBUNTU: SAUCE: (noup) Update spl to 0.7.9-3ubuntu1, zfs to 0.7.9-3ubuntu1

Message ID 20180629152945.9852-1-colin.king@canonical.com
State New
Headers show
Series
  • [COSMIC] UBUNTU: SAUCE: (noup) Update spl to 0.7.9-3ubuntu1, zfs to 0.7.9-3ubuntu1
Related show

Commit Message

Colin King June 29, 2018, 3:29 p.m.
From: Colin Ian King <colin.king@canonical.com>

This sync's SPL and ZFS to the latest version 0.7.9-3. This has been
regression tested against the Cosmic 4.17 unstable kernel with the
0.7.9-3 ZFS and SPL packages.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 spl/META                                 |    4 +-
 spl/Makefile.in                          |   32 +-
 spl/aclocal.m4                           |   21 +
 spl/cmd/Makefile.in                      |   23 +-
 spl/cmd/splat/Makefile.in                |   23 +-
 spl/cmd/splslab/Makefile.in              |   23 +-
 spl/config/deb.am                        |    9 +-
 spl/config/kernel-ctl-table-name.m4      |   18 +
 spl/config/kernel-fallocate.m4           |   68 +
 spl/config/kernel-group-info.m4          |   21 +
 spl/config/kernel-inode-lock.m4          |   23 +
 spl/config/kernel-kmem-cache.m4          |   72 +
 spl/config/kernel-kuidgid.m4             |   28 +
 spl/config/kernel-pde-data.m4            |   17 +
 spl/config/kernel-rw.m4                  |   57 +
 spl/config/kernel-rwsem.m4               |   75 +
 spl/config/kernel-sched.m4               |   56 +
 spl/config/kernel-set-fs-pwd.m4          |   39 +
 spl/config/kernel-shrinker.m4            |  125 ++
 spl/config/kernel-spinlock.m4            |   24 +
 spl/config/kernel-timer.m4               |   32 +
 spl/config/kernel-trim-unused-symbols.m4 |   19 +
 spl/config/kernel-truncate-range.m4      |   19 +
 spl/config/kernel-urange-sleep.m4        |   21 +
 spl/config/kernel-vfs-fsync.m4           |   17 +
 spl/config/kernel-vfs-getattr.m4         |   62 +
 spl/config/kernel-wait.m4                |   76 +
 spl/config/kernel-zlib.m4                |   63 +
 spl/config/ltmain.sh                     |  552 ++++---
 spl/config/spl-build.m4                  | 1039 +-----------
 spl/configure                            | 2534 ++++++++++++-----------------
 spl/configure.ac                         |    4 +-
 spl/dkms.conf                            |    2 +-
 spl/include/Makefile.in                  |   23 +-
 spl/include/fs/Makefile.in               |   23 +-
 spl/include/fs/fs_subr.h                 |    2 +-
 spl/include/linux/Makefile.in            |   23 +-
 spl/include/linux/math64_compat.h        |    3 +-
 spl/include/rpc/Makefile.in              |   23 +-
 spl/include/rpc/types.h                  |    2 +-
 spl/include/rpc/xdr.h                    |   48 +-
 spl/include/sharefs/Makefile.in          |   23 +-
 spl/include/sharefs/share.h              |    2 +-
 spl/include/spl-ctl.h                    |   22 +-
 spl/include/splat-ctl.h                  |   60 +-
 spl/include/strings.h                    |    2 +-
 spl/include/sys/Makefile.am              |    3 +-
 spl/include/sys/Makefile.in              |   27 +-
 spl/include/sys/acl.h                    |  138 +-
 spl/include/sys/acl_impl.h               |    2 +-
 spl/include/sys/atomic.h                 |   80 +-
 spl/include/sys/attr.h                   |    2 +-
 spl/include/sys/bitmap.h                 |    2 +-
 spl/include/sys/bootconf.h               |    2 +-
 spl/include/sys/bootprops.h              |    2 +-
 spl/include/sys/buf.h                    |    2 +-
 spl/include/sys/byteorder.h              |   32 +-
 spl/include/sys/callb.h                  |   21 +-
 spl/include/sys/callo.h                  |   10 +-
 spl/include/sys/cmn_err.h                |   14 +-
 spl/include/sys/compress.h               |    2 +-
 spl/include/sys/condvar.h                |    2 +
 spl/include/sys/conf.h                   |    2 +-
 spl/include/sys/console.h                |   10 +-
 spl/include/sys/cpupart.h                |    2 +-
 spl/include/sys/cpuvar.h                 |    2 +-
 spl/include/sys/crc32.h                  |    2 +-
 spl/include/sys/cred.h                   |    4 +-
 spl/include/sys/ctype.h                  |    2 +-
 spl/include/sys/ddi.h                    |    2 +-
 spl/include/sys/debug.h                  |   19 +-
 spl/include/sys/dirent.h                 |    2 +-
 spl/include/sys/disp.h                   |    2 +-
 spl/include/sys/dkioc_free_util.h        |    2 +-
 spl/include/sys/dnlc.h                   |    2 +-
 spl/include/sys/dumphdr.h                |    2 +-
 spl/include/sys/efi_partition.h          |    2 +-
 spl/include/sys/errno.h                  |    2 +-
 spl/include/sys/fcntl.h                  |    4 +-
 spl/include/sys/file.h                   |    2 +-
 spl/include/sys/fm/Makefile.in           |   23 +-
 spl/include/sys/fs/Makefile.in           |   23 +-
 spl/include/sys/fs/swapnode.h            |    2 +-
 spl/include/sys/idmap.h                  |    4 +-
 spl/include/sys/int_limits.h             |    2 +-
 spl/include/sys/int_types.h              |    2 +-
 spl/include/sys/inttypes.h               |    2 +-
 spl/include/sys/isa_defs.h               |   64 +-
 spl/include/sys/kidmap.h                 |    2 +-
 spl/include/sys/kobj.h                   |    2 +-
 spl/include/sys/kstat.h                  |  244 +--
 spl/include/sys/list.h                   |   36 +-
 spl/include/sys/mkdev.h                  |    2 +-
 spl/include/sys/mntent.h                 |    2 +-
 spl/include/sys/modctl.h                 |    2 +-
 spl/include/sys/mode.h                   |    8 +-
 spl/include/sys/mount.h                  |    2 +-
 spl/include/sys/mutex.h                  |   10 +-
 spl/include/sys/note.h                   |    2 +-
 spl/include/sys/open.h                   |    2 +-
 spl/include/sys/param.h                  |    8 +-
 spl/include/sys/pathname.h               |    2 +-
 spl/include/sys/policy.h                 |   20 +-
 spl/include/sys/pool.h                   |    2 +-
 spl/include/sys/priv_impl.h              |    2 +-
 spl/include/sys/proc.h                   |    2 +-
 spl/include/sys/processor.h              |    2 +-
 spl/include/sys/pset.h                   |   14 +-
 spl/include/sys/random.h                 |    4 +-
 spl/include/sys/refstr.h                 |    2 +-
 spl/include/sys/resource.h               |    2 +-
 spl/include/sys/rwlock.h                 |   34 +-
 spl/include/sys/sdt.h                    |    4 +-
 spl/include/sys/sid.h                    |   12 +-
 spl/include/sys/signal.h                 |    7 +-
 spl/include/sys/stat.h                   |    2 +-
 spl/include/sys/stropts.h                |    2 +-
 spl/include/sys/sunddi.h                 |    8 +-
 spl/include/sys/sunldi.h                 |    4 +-
 spl/include/sys/sysdc.h                  |    2 +-
 spl/include/sys/sysevent.h               |   28 -
 spl/include/sys/sysevent/Makefile.am     |   13 -
 spl/include/sys/sysevent/Makefile.in     |  622 --------
 spl/include/sys/sysevent/eventdefs.h     |   28 -
 spl/include/sys/sysmacros.h              |  196 +--
 spl/include/sys/systeminfo.h             |    8 +-
 spl/include/sys/systm.h                  |    2 +-
 spl/include/sys/t_lock.h                 |    2 +-
 spl/include/sys/taskq.h                  |    2 +-
 spl/include/sys/thread.h                 |   36 +-
 spl/include/sys/timer.h                  |   37 +-
 spl/include/sys/tsd.h                    |   10 +-
 spl/include/sys/types.h                  |    6 +-
 spl/include/sys/u8_textprep.h            |    2 +-
 spl/include/sys/uio.h                    |   20 +-
 spl/include/sys/unistd.h                 |    2 +-
 spl/include/sys/user.h                   |    4 +-
 spl/include/sys/va_list.h                |    2 +-
 spl/include/sys/varargs.h                |    4 +-
 spl/include/sys/vfs.h                    |    4 +-
 spl/include/sys/vfs_opreg.h              |    2 +-
 spl/include/sys/vmsystm.h                |   14 +-
 spl/include/sys/vnode.h                  |  102 +-
 spl/include/sys/zmod.h                   |    5 +-
 spl/include/sys/zone.h                   |    2 +-
 spl/include/unistd.h                     |    2 +-
 spl/include/util/Makefile.in             |   23 +-
 spl/include/util/qsort.h                 |    4 +-
 spl/include/util/sscanf.h                |    2 +-
 spl/include/vm/Makefile.in               |   23 +-
 spl/include/vm/anon.h                    |    2 +-
 spl/include/vm/pvn.h                     |    2 +-
 spl/include/vm/seg_kmem.h                |    2 +-
 spl/lib/Makefile.in                      |   23 +-
 spl/man/Makefile.in                      |   23 +-
 spl/man/man1/Makefile.in                 |   23 +-
 spl/man/man5/Makefile.in                 |   23 +-
 spl/module/spl/spl-atomic.c              |    8 +-
 spl/module/spl/spl-condvar.c             |   66 +-
 spl/module/spl/spl-cred.c                |   38 +-
 spl/module/spl/spl-err.c                 |   10 +-
 spl/module/spl/spl-generic.c             |   95 +-
 spl/module/spl/spl-kmem-cache.c          |   31 +-
 spl/module/spl/spl-kmem.c                |    7 +-
 spl/module/spl/spl-kobj.c                |   12 +-
 spl/module/spl/spl-kstat.c               |  551 +++----
 spl/module/spl/spl-mutex.c               |    8 +-
 spl/module/spl/spl-proc.c                |  644 ++++----
 spl/module/spl/spl-rwlock.c              |   10 +-
 spl/module/spl/spl-taskq.c               |   76 +-
 spl/module/spl/spl-thread.c              |   32 +-
 spl/module/spl/spl-tsd.c                 |    1 -
 spl/module/spl/spl-vnode.c               |  400 ++---
 spl/module/spl/spl-xdr.c                 |  165 +-
 spl/module/spl/spl-zlib.c                |   37 +-
 spl/module/splat/splat-vnode.c           |   96 --
 spl/rpm/Makefile.in                      |   23 +-
 spl/rpm/generic/Makefile.in              |   23 +-
 spl/rpm/generic/spl-dkms.spec.in         |   10 +
 spl/rpm/generic/spl-kmod.spec.in         |   12 +
 spl/rpm/generic/spl.spec.in              |   22 +
 spl/rpm/redhat/Makefile.in               |   23 +-
 spl/rpm/redhat/spl-dkms.spec.in          |   10 +
 spl/rpm/redhat/spl.spec.in               |   22 +
 spl/scripts/Makefile.in                  |   23 +-
 spl/spl_config.h.in                      |   22 +-
 zfs/META                                 |    4 +-
 zfs/Makefile.am                          |   16 +-
 zfs/Makefile.in                          |   53 +-
 zfs/README.markdown                      |   12 +-
 zfs/aclocal.m4                           |    4 +-
 zfs/config/Rules.am                      |    2 +
 zfs/config/ax_code_coverage.m4           |  264 ++++
 zfs/config/deb.am                        |   17 +-
 zfs/config/kernel-acl.m4                 |    1 +
 zfs/config/kernel-create-nameidata.m4    |    1 +
 zfs/config/kernel-dentry-operations.m4   |    1 +
 zfs/config/kernel-get-link.m4            |    2 +-
 zfs/config/kernel-global_page_state.m4   |  109 ++
 zfs/config/kernel-lookup-nameidata.m4    |    1 +
 zfs/config/kernel-vfs-iterate.m4         |   21 +-
 zfs/config/kernel-vfs-rw-iterate.m4      |   14 +-
 zfs/config/kernel-vm_node_stat.m4        |   22 -
 zfs/config/kernel.m4                     |    4 +-
 zfs/config/ltmain.sh                     |  552 ++++---
 zfs/config/tgz.am                        |    4 +-
 zfs/config/user-libattr.m4               |   12 -
 zfs/config/user-libblkid.m4              |    2 +-
 zfs/config/user-systemd.m4               |   20 +-
 zfs/config/user.m4                       |    3 +-
 zfs/config/zfs-build.m4                  |  113 +-
 zfs/configure                            | 2536 +++++++++++++++++++++++-------
 zfs/configure.ac                         |    2 +
 zfs/dkms.conf                            |    2 +-
 zfs/include/Makefile.in                  |   16 +-
 zfs/include/libzfs.h                     |    1 +
 zfs/include/linux/Makefile.am            |    3 +-
 zfs/include/linux/Makefile.in            |   22 +-
 zfs/include/linux/page_compat.h          |   78 +
 zfs/include/linux/vfs_compat.h           |    1 -
 zfs/include/sys/Makefile.in              |   16 +-
 zfs/include/sys/arc.h                    |   27 +-
 zfs/include/sys/crypto/Makefile.in       |   16 +-
 zfs/include/sys/fm/Makefile.in           |   16 +-
 zfs/include/sys/fm/fs/Makefile.in        |   16 +-
 zfs/include/sys/fs/Makefile.in           |   16 +-
 zfs/include/sys/fs/zfs.h                 |    1 +
 zfs/include/sys/mmp.h                    |    2 +
 zfs/include/sys/spa.h                    |    8 +-
 zfs/include/sys/spa_impl.h               |    3 +-
 zfs/include/sys/sysevent/Makefile.in     |   16 +-
 zfs/include/sys/vdev_impl.h              |    3 +-
 zfs/include/sys/zfs_ratelimit.h          |   12 +-
 zfs/include/sys/zfs_vnops.h              |    2 +-
 zfs/include/sys/zio.h                    |   19 +-
 zfs/include/sys/zpl.h                    |   27 +-
 zfs/module/zcommon/zfs_comutil.c         |    4 +-
 zfs/module/zfs/abd.c                     |   18 +-
 zfs/module/zfs/arc.c                     |   37 +-
 zfs/module/zfs/dmu_send.c                |   16 +-
 zfs/module/zfs/dmu_traverse.c            |   12 +-
 zfs/module/zfs/metaslab.c                |    3 +-
 zfs/module/zfs/mmp.c                     |  260 ++-
 zfs/module/zfs/qat_compress.c            |    4 -
 zfs/module/zfs/spa.c                     |   25 +-
 zfs/module/zfs/spa_config.c              |   35 +-
 zfs/module/zfs/spa_misc.c                |    2 +-
 zfs/module/zfs/spa_stats.c               |  137 +-
 zfs/module/zfs/vdev.c                    |   39 +-
 zfs/module/zfs/vdev_label.c              |    1 -
 zfs/module/zfs/zfs_vnops.c               |    5 +-
 zfs/module/zfs/zil.c                     |    3 +-
 zfs/module/zfs/zio.c                     |   57 +-
 zfs/module/zfs/zpl_ctldir.c              |   37 +-
 zfs/module/zfs/zpl_file.c                |    9 +-
 zfs/module/zfs/zpl_xattr.c               |    2 +-
 zfs/module/zfs/zvol.c                    |    2 +-
 zfs/module/zpios/pios.c                  |    9 +-
 zfs/scripts/enum-extract.pl              |   58 +
 zfs/zfs_config.h.in                      |   34 +-
 260 files changed, 8448 insertions(+), 6689 deletions(-)
 create mode 100644 spl/config/kernel-ctl-table-name.m4
 create mode 100644 spl/config/kernel-fallocate.m4
 create mode 100644 spl/config/kernel-group-info.m4
 create mode 100644 spl/config/kernel-inode-lock.m4
 create mode 100644 spl/config/kernel-kmem-cache.m4
 create mode 100644 spl/config/kernel-kuidgid.m4
 create mode 100644 spl/config/kernel-pde-data.m4
 create mode 100644 spl/config/kernel-rw.m4
 create mode 100644 spl/config/kernel-rwsem.m4
 create mode 100644 spl/config/kernel-sched.m4
 create mode 100644 spl/config/kernel-set-fs-pwd.m4
 create mode 100644 spl/config/kernel-shrinker.m4
 create mode 100644 spl/config/kernel-spinlock.m4
 create mode 100644 spl/config/kernel-timer.m4
 create mode 100644 spl/config/kernel-trim-unused-symbols.m4
 create mode 100644 spl/config/kernel-truncate-range.m4
 create mode 100644 spl/config/kernel-urange-sleep.m4
 create mode 100644 spl/config/kernel-vfs-fsync.m4
 create mode 100644 spl/config/kernel-vfs-getattr.m4
 create mode 100644 spl/config/kernel-wait.m4
 create mode 100644 spl/config/kernel-zlib.m4
 delete mode 100644 spl/include/sys/sysevent.h
 delete mode 100644 spl/include/sys/sysevent/Makefile.am
 delete mode 100644 spl/include/sys/sysevent/Makefile.in
 delete mode 100644 spl/include/sys/sysevent/eventdefs.h
 create mode 100644 zfs/config/ax_code_coverage.m4
 create mode 100644 zfs/config/kernel-global_page_state.m4
 delete mode 100644 zfs/config/kernel-vm_node_stat.m4
 delete mode 100644 zfs/config/user-libattr.m4
 create mode 100644 zfs/include/linux/page_compat.h
 create mode 100755 zfs/scripts/enum-extract.pl

Comments

Seth Forshee June 29, 2018, 4:52 p.m. | #1
On Fri, Jun 29, 2018 at 04:29:45PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> This sync's SPL and ZFS to the latest version 0.7.9-3. This has been
> regression tested against the Cosmic 4.17 unstable kernel with the
> 0.7.9-3 ZFS and SPL packages.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied to unstable/master, thanks!

Patch

diff --git a/spl/META b/spl/META
index 0ea8d17..1c7a52f 100644
--- a/spl/META
+++ b/spl/META
@@ -1,8 +1,8 @@ 
 Meta:         1
 Name:         spl
 Branch:       1.0
-Version:      0.7.5
-Release:      1ubuntu3
+Version:      0.7.9
+Release:      3ubuntu1
 Release-Tags: relext
 License:      GPL
 Author:       OpenZFS on Linux
diff --git a/spl/Makefile.in b/spl/Makefile.in
index 260d4e7..9ee93e1 100644
--- a/spl/Makefile.in
+++ b/spl/Makefile.in
@@ -129,7 +129,28 @@  target_triplet = @target@
 @CONFIG_KERNEL_TRUE@am__append_2 = module
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
@@ -1106,24 +1127,27 @@  deb-kmod: deb-local rpm-kmod
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-dkms: deb-local rpm-dkms
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-utils: deb-local rpm-utils
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb: deb-kmod deb-dkms deb-utils
diff --git a/spl/aclocal.m4 b/spl/aclocal.m4
index be61f1f..73e0eec 100644
--- a/spl/aclocal.m4
+++ b/spl/aclocal.m4
@@ -1186,6 +1186,27 @@  AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([config/kernel-ctl-table-name.m4])
+m4_include([config/kernel-fallocate.m4])
+m4_include([config/kernel-group-info.m4])
+m4_include([config/kernel-inode-lock.m4])
+m4_include([config/kernel-kmem-cache.m4])
+m4_include([config/kernel-kuidgid.m4])
+m4_include([config/kernel-pde-data.m4])
+m4_include([config/kernel-rw.m4])
+m4_include([config/kernel-rwsem.m4])
+m4_include([config/kernel-sched.m4])
+m4_include([config/kernel-set-fs-pwd.m4])
+m4_include([config/kernel-shrinker.m4])
+m4_include([config/kernel-spinlock.m4])
+m4_include([config/kernel-timer.m4])
+m4_include([config/kernel-trim-unused-symbols.m4])
+m4_include([config/kernel-truncate-range.m4])
+m4_include([config/kernel-urange-sleep.m4])
+m4_include([config/kernel-vfs-fsync.m4])
+m4_include([config/kernel-vfs-getattr.m4])
+m4_include([config/kernel-wait.m4])
+m4_include([config/kernel-zlib.m4])
 m4_include([config/libtool.m4])
 m4_include([config/ltoptions.m4])
 m4_include([config/ltsugar.m4])
diff --git a/spl/cmd/Makefile.in b/spl/cmd/Makefile.in
index f332824..b389227 100644
--- a/spl/cmd/Makefile.in
+++ b/spl/cmd/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = cmd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/cmd/splat/Makefile.in b/spl/cmd/splat/Makefile.in
index 149ef8d..a90011c 100644
--- a/spl/cmd/splat/Makefile.in
+++ b/spl/cmd/splat/Makefile.in
@@ -100,7 +100,28 @@  target_triplet = @target@
 sbin_PROGRAMS = splat$(EXEEXT)
 subdir = cmd/splat
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/cmd/splslab/Makefile.in b/spl/cmd/splslab/Makefile.in
index f3839a8..082a43b 100644
--- a/spl/cmd/splslab/Makefile.in
+++ b/spl/cmd/splslab/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = cmd/splslab
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/config/deb.am b/spl/config/deb.am
index e05a175..f745c91 100644
--- a/spl/config/deb.am
+++ b/spl/config/deb.am
@@ -32,24 +32,27 @@  deb-kmod: deb-local rpm-kmod
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-dkms: deb-local rpm-dkms
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-utils: deb-local rpm-utils
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb: deb-kmod deb-dkms deb-utils
diff --git a/spl/config/kernel-ctl-table-name.m4 b/spl/config/kernel-ctl-table-name.m4
new file mode 100644
index 0000000..8dd2e77
--- /dev/null
+++ b/spl/config/kernel-ctl-table-name.m4
@@ -0,0 +1,18 @@ 
+dnl #
+dnl # 2.6.33 API change,
+dnl # Removed .ctl_name from struct ctl_table.
+dnl #
+AC_DEFUN([SPL_AC_CTL_NAME], [
+	AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/sysctl.h>
+	],[
+		struct ctl_table ctl __attribute__ ((unused));
+		ctl.ctl_name = 0;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-fallocate.m4 b/spl/config/kernel-fallocate.m4
new file mode 100644
index 0000000..b8c82f4
--- /dev/null
+++ b/spl/config/kernel-fallocate.m4
@@ -0,0 +1,68 @@ 
+dnl #
+dnl # Linux 2.6.38 - 3.x API
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [
+	AC_MSG_CHECKING([whether fops->fallocate() exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+		struct file_operations fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+dnl #
+dnl # Linux 2.6.x - 2.6.37 API
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [
+	AC_MSG_CHECKING([whether iops->fallocate() exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+		struct inode_operations fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # PaX Linux 2.6.38 - 3.x API
+dnl #
+AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
+	AC_MSG_CHECKING([whether fops->fallocate() exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+		struct file_operations_no_const fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # The fallocate callback was moved from the inode_operations
+dnl # structure to the file_operations structure.
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [
+	SPL_AC_KERNEL_FILE_FALLOCATE
+	SPL_AC_KERNEL_INODE_FALLOCATE
+	SPL_AC_PAX_KERNEL_FILE_FALLOCATE
+])
diff --git a/spl/config/kernel-group-info.m4 b/spl/config/kernel-group-info.m4
new file mode 100644
index 0000000..4db2bba
--- /dev/null
+++ b/spl/config/kernel-group-info.m4
@@ -0,0 +1,21 @@ 
+dnl #
+dnl # 4.9 API change
+dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
+dnl #
+AC_DEFUN([SPL_AC_GROUP_INFO_GID], [
+	AC_MSG_CHECKING([whether group_info->gid exists])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/cred.h>
+	],[
+		struct group_info *gi = groups_alloc(1);
+		gi->gid[0] = KGIDT_INIT(0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-inode-lock.m4 b/spl/config/kernel-inode-lock.m4
new file mode 100644
index 0000000..2cc06a5
--- /dev/null
+++ b/spl/config/kernel-inode-lock.m4
@@ -0,0 +1,23 @@ 
+dnl #
+dnl # 4.7 API change
+dnl # i_mutex is changed to i_rwsem. Instead of directly using
+dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
+dnl # We test inode_lock_shared because inode_lock is introduced earlier.
+dnl #
+AC_DEFUN([SPL_AC_INODE_LOCK], [
+	AC_MSG_CHECKING([whether inode_lock_shared() exists])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		struct inode *inode = NULL;
+		inode_lock_shared(inode);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-kmem-cache.m4 b/spl/config/kernel-kmem-cache.m4
new file mode 100644
index 0000000..50a7fdb
--- /dev/null
+++ b/spl/config/kernel-kmem-cache.m4
@@ -0,0 +1,72 @@ 
+dnl #
+dnl # 2.6.35 API change,
+dnl # The cachep->gfpflags member was renamed cachep->allocflags.  These are
+dnl # private allocation flags which are applied when allocating a new slab
+dnl # in kmem_getpages().  Unfortunately there is no public API for setting
+dnl # non-default flags.
+dnl #
+AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
+	AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/slab.h>
+	],[
+		struct kmem_cache cachep __attribute__ ((unused));
+		cachep.allocflags = GFP_KERNEL;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
+			[struct kmem_cache has allocflags])
+	],[
+		AC_MSG_RESULT(no)
+
+		AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
+		SPL_LINUX_TRY_COMPILE([
+			#include <linux/slab.h>
+		],[
+			struct kmem_cache cachep __attribute__ ((unused));
+			cachep.gfpflags = GFP_KERNEL;
+		],[
+			AC_MSG_RESULT(yes)
+			AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
+				[struct kmem_cache has gfpflags])
+		],[
+			AC_MSG_RESULT(no)
+		])
+	])
+])
+
+dnl #
+dnl # grsecurity API change,
+dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
+dnl # kmem_cache_create_usercopy().
+dnl #
+AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_USERCOPY], [
+	AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/slab.h>
+		static void ctor(void *foo)
+		{
+			// fake ctor
+		}
+	],[
+		struct kmem_cache *skc_linux_cache;
+		const char *name = "test";
+		size_t size = 4096;
+		size_t align = 8;
+		unsigned long flags = 0;
+		size_t useroffset = 0;
+		size_t usersize = size - useroffset;
+
+		skc_linux_cache = kmem_cache_create_usercopy(
+			name, size, align, flags, useroffset, usersize, ctor);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
+				[kmem_cache_create_usercopy() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-kuidgid.m4 b/spl/config/kernel-kuidgid.m4
new file mode 100644
index 0000000..47d1937
--- /dev/null
+++ b/spl/config/kernel-kuidgid.m4
@@ -0,0 +1,28 @@ 
+dnl #
+dnl # User namespaces, use kuid_t in place of uid_t
+dnl # where available. Not strictly a user namespaces thing
+dnl # but it should prevent surprises
+dnl #
+AC_DEFUN([SPL_AC_KUIDGID_T], [
+	AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/uidgid.h>
+	], [
+		kuid_t userid = KUIDT_INIT(0);
+		kgid_t groupid = KGIDT_INIT(0);
+	],[
+		SPL_LINUX_TRY_COMPILE([
+			#include <linux/uidgid.h>
+		], [
+			kuid_t userid = 0;
+			kgid_t groupid = 0;
+		],[
+			AC_MSG_RESULT(yes; optional)
+		],[
+			AC_MSG_RESULT(yes; mandatory)
+			AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use])
+		])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-pde-data.m4 b/spl/config/kernel-pde-data.m4
new file mode 100644
index 0000000..6aa5765
--- /dev/null
+++ b/spl/config/kernel-pde-data.m4
@@ -0,0 +1,17 @@ 
+dnl #
+dnl # 3.10 API change,
+dnl # PDE is replaced by PDE_DATA
+dnl #
+AC_DEFUN([SPL_AC_PDE_DATA], [
+	AC_MSG_CHECKING([whether PDE_DATA() is available])
+	SPL_LINUX_TRY_COMPILE_SYMBOL([
+		#include <linux/proc_fs.h>
+	], [
+		PDE_DATA(NULL);
+	], [PDE_DATA], [], [
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_PDE_DATA, 1, [yes])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-rw.m4 b/spl/config/kernel-rw.m4
new file mode 100644
index 0000000..23c14b7
--- /dev/null
+++ b/spl/config/kernel-rw.m4
@@ -0,0 +1,57 @@ 
+dnl #
+dnl # 4.14 API change
+dnl # kernel_write() which was introduced in 3.9 was updated to take
+dnl # the offset as a pointer which is needed by vn_rdwr().
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_WRITE], [
+	AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		struct file *file = NULL;
+		const void *buf = NULL;
+		size_t count = 0;
+		loff_t *pos = NULL;
+		ssize_t ret;
+
+		ret = kernel_write(file, buf, count, pos);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
+		    [kernel_write() take loff_t pointer])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
+dnl # 4.14 API change
+dnl # kernel_read() which has existed for forever was updated to take
+dnl # the offset as a pointer which is needed by vn_rdwr().
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_READ], [
+	AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		struct file *file = NULL;
+		void *buf = NULL;
+		size_t count = 0;
+		loff_t *pos = NULL;
+		ssize_t ret;
+
+		ret = kernel_read(file, buf, count, pos);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
+		    [kernel_read() take loff_t pointer])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-rwsem.m4 b/spl/config/kernel-rwsem.m4
new file mode 100644
index 0000000..aee20ae
--- /dev/null
+++ b/spl/config/kernel-rwsem.m4
@@ -0,0 +1,75 @@ 
+dnl #
+dnl # 3.1 API Change
+dnl #
+dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
+dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
+dnl #
+AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [
+	AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/rwsem.h>
+	],[
+		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+		raw_spinlock_t dummy_lock __attribute__ ((unused)) =
+		    __RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
+		dummy_semaphore.wait_lock = dummy_lock;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(RWSEM_SPINLOCK_IS_RAW, 1,
+		[struct rw_semaphore member wait_lock is raw_spinlock_t])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
+dnl # 3.16 API Change
+dnl #
+dnl # rwsem-spinlock "->activity" changed to "->count"
+dnl #
+AC_DEFUN([SPL_AC_RWSEM_ACTIVITY], [
+	AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/rwsem.h>
+	],[
+		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+		dummy_semaphore.activity = 0;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
+		[struct rw_semaphore has member activity])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
+dnl # 4.8 API Change
+dnl #
+dnl # rwsem "->count" changed to atomic_long_t type
+dnl #
+AC_DEFUN([SPL_AC_RWSEM_ATOMIC_LONG_COUNT], [
+	AC_MSG_CHECKING(
+	[whether struct rw_semaphore has atomic_long_t member count])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/rwsem.h>
+	],[
+		DECLARE_RWSEM(dummy_semaphore);
+		(void) atomic_long_read(&dummy_semaphore.count);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
+		[struct rw_semaphore has atomic_long_t member count])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-sched.m4 b/spl/config/kernel-sched.m4
new file mode 100644
index 0000000..5ae2167
--- /dev/null
+++ b/spl/config/kernel-sched.m4
@@ -0,0 +1,56 @@ 
+dnl #
+dnl # 3.9 API change,
+dnl # Moved things from linux/sched.h to linux/sched/rt.h
+dnl #
+AC_DEFUN([SPL_AC_SCHED_RT_HEADER],
+	[AC_MSG_CHECKING([whether header linux/sched/rt.h exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/sched.h>
+		#include <linux/sched/rt.h>
+	],[
+		return 0;
+	],[
+		AC_DEFINE(HAVE_SCHED_RT_HEADER, 1, [linux/sched/rt.h exists])
+		AC_MSG_RESULT(yes)
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # 4.11 API change,
+dnl # Moved things from linux/sched.h to linux/sched/signal.h
+dnl #
+AC_DEFUN([SPL_AC_SCHED_SIGNAL_HEADER],
+	[AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/sched.h>
+		#include <linux/sched/signal.h>
+	],[
+		return 0;
+	],[
+		AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1, [linux/sched/signal.h exists])
+		AC_MSG_RESULT(yes)
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+dnl #
+dnl # 3.19 API change
+dnl # The io_schedule_timeout() function is present in all 2.6.32 kernels
+dnl # but it was not exported until Linux 3.19.  The RHEL 7.x kernels which
+dnl # are based on a 3.10 kernel do export this symbol.
+dnl #
+AC_DEFUN([SPL_AC_IO_SCHEDULE_TIMEOUT], [
+	AC_MSG_CHECKING([whether io_schedule_timeout() is available])
+	SPL_LINUX_TRY_COMPILE_SYMBOL([
+		#include <linux/sched.h>
+	], [
+		(void) io_schedule_timeout(1);
+	], [io_schedule_timeout], [], [
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_IO_SCHEDULE_TIMEOUT, 1, [yes])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-set-fs-pwd.m4 b/spl/config/kernel-set-fs-pwd.m4
new file mode 100644
index 0000000..849e7e6
--- /dev/null
+++ b/spl/config/kernel-set-fs-pwd.m4
@@ -0,0 +1,39 @@ 
+dnl #
+dnl # 3.9 API change
+dnl # set_fs_pwd takes const struct path *
+dnl #
+AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	[AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/spinlock.h>
+		#include <linux/fs_struct.h>
+		#include <linux/path.h>
+		void (*const set_fs_pwd_func)
+			(struct fs_struct *, const struct path *)
+			= set_fs_pwd;
+	],[
+		return 0;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
+			[set_fs_pwd() needs const path *])
+	],[
+		SPL_LINUX_TRY_COMPILE([
+			#include <linux/spinlock.h>
+			#include <linux/fs_struct.h>
+			#include <linux/path.h>
+			void (*const set_fs_pwd_func)
+				(struct fs_struct *, struct path *)
+				= set_fs_pwd;
+		],[
+			return 0;
+		],[
+			AC_MSG_RESULT(no)
+		],[
+			AC_MSG_ERROR(unknown)
+		])
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-shrinker.m4 b/spl/config/kernel-shrinker.m4
new file mode 100644
index 0000000..6fc9b54
--- /dev/null
+++ b/spl/config/kernel-shrinker.m4
@@ -0,0 +1,125 @@ 
+AC_DEFUN([SPL_AC_SHRINKER_CALLBACK],[
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	dnl #
+	dnl # 2.6.23 to 2.6.34 API change
+	dnl # ->shrink(int nr_to_scan, gfp_t gfp_mask)
+	dnl #
+	AC_MSG_CHECKING([whether old 2-argument shrinker exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/mm.h>
+
+		int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
+	],[
+		struct shrinker cache_shrinker = {
+			.shrink = shrinker_cb,
+			.seeks = DEFAULT_SEEKS,
+		};
+		register_shrinker(&cache_shrinker);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_2ARGS_OLD_SHRINKER_CALLBACK, 1,
+			[old shrinker callback wants 2 args])
+	],[
+		AC_MSG_RESULT(no)
+		dnl #
+		dnl # 2.6.35 - 2.6.39 API change
+		dnl # ->shrink(struct shrinker *,
+		dnl #          int nr_to_scan, gfp_t gfp_mask)
+		dnl #
+		AC_MSG_CHECKING([whether old 3-argument shrinker exists])
+		SPL_LINUX_TRY_COMPILE([
+			#include <linux/mm.h>
+
+			int shrinker_cb(struct shrinker *, int nr_to_scan,
+					gfp_t gfp_mask);
+		],[
+			struct shrinker cache_shrinker = {
+				.shrink = shrinker_cb,
+				.seeks = DEFAULT_SEEKS,
+			};
+			register_shrinker(&cache_shrinker);
+		],[
+			AC_MSG_RESULT(yes)
+			AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1,
+				[old shrinker callback wants 3 args])
+		],[
+			AC_MSG_RESULT(no)
+			dnl #
+			dnl # 3.0 - 3.11 API change
+			dnl # ->shrink(struct shrinker *,
+			dnl #          struct shrink_control *sc)
+			dnl #
+			AC_MSG_CHECKING(
+				[whether new 2-argument shrinker exists])
+			SPL_LINUX_TRY_COMPILE([
+				#include <linux/mm.h>
+
+				int shrinker_cb(struct shrinker *,
+						struct shrink_control *sc);
+			],[
+				struct shrinker cache_shrinker = {
+					.shrink = shrinker_cb,
+					.seeks = DEFAULT_SEEKS,
+				};
+				register_shrinker(&cache_shrinker);
+			],[
+				AC_MSG_RESULT(yes)
+				AC_DEFINE(HAVE_2ARGS_NEW_SHRINKER_CALLBACK, 1,
+					[new shrinker callback wants 2 args])
+			],[
+				AC_MSG_RESULT(no)
+				dnl #
+				dnl # 3.12 API change,
+				dnl # ->shrink() is logically split in to
+				dnl # ->count_objects() and ->scan_objects()
+				dnl #
+				AC_MSG_CHECKING(
+				    [whether ->count_objects callback exists])
+				SPL_LINUX_TRY_COMPILE([
+					#include <linux/mm.h>
+
+					unsigned long shrinker_cb(
+						struct shrinker *,
+						struct shrink_control *sc);
+				],[
+					struct shrinker cache_shrinker = {
+						.count_objects = shrinker_cb,
+						.scan_objects = shrinker_cb,
+						.seeks = DEFAULT_SEEKS,
+					};
+					register_shrinker(&cache_shrinker);
+				],[
+					AC_MSG_RESULT(yes)
+					AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK,
+						1, [->count_objects exists])
+				],[
+					AC_MSG_ERROR(error)
+				])
+			])
+		])
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
+dnl # 2.6.39 API change,
+dnl # Shrinker adjust to use common shrink_control structure.
+dnl #
+AC_DEFUN([SPL_AC_SHRINK_CONTROL_STRUCT], [
+	AC_MSG_CHECKING([whether struct shrink_control exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/mm.h>
+	],[
+		struct shrink_control sc __attribute__ ((unused));
+
+		sc.nr_to_scan = 0;
+		sc.gfp_mask = GFP_KERNEL;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1,
+			[struct shrink_control exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-spinlock.m4 b/spl/config/kernel-spinlock.m4
new file mode 100644
index 0000000..136262d
--- /dev/null
+++ b/spl/config/kernel-spinlock.m4
@@ -0,0 +1,24 @@ 
+dnl #
+dnl # 2.6.36 API change,
+dnl # The 'struct fs_struct->lock' was changed from a rwlock_t to
+dnl # a spinlock_t to improve the fastpath performance.
+dnl #
+AC_DEFUN([SPL_AC_FS_STRUCT_SPINLOCK], [
+	AC_MSG_CHECKING([whether struct fs_struct uses spinlock_t])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/sched.h>
+		#include <linux/fs_struct.h>
+	],[
+		static struct fs_struct fs;
+		spin_lock_init(&fs.lock);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_FS_STRUCT_SPINLOCK, 1,
+		          [struct fs_struct uses spinlock_t])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-timer.m4 b/spl/config/kernel-timer.m4
new file mode 100644
index 0000000..93b5158
--- /dev/null
+++ b/spl/config/kernel-timer.m4
@@ -0,0 +1,32 @@ 
+dnl #
+dnl # 4.15 API change
+dnl # https://lkml.org/lkml/2017/11/25/90
+dnl # Check if timer_list.func get passed a timer_list or an unsigned long
+dnl # (older kernels).  Also sanity check the from_timer() and timer_setup()
+dnl # macros are available as well, since they will be used in the same newer
+dnl # kernels that support the new timer_list.func signature.
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST], [
+	AC_MSG_CHECKING([whether timer_list.function gets a timer_list])
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/timer.h>
+		void task_expire(struct timer_list *tl) {}
+	],[
+		#ifndef from_timer
+		#error "No from_timer() macro"
+		#endif
+
+		struct timer_list timer;
+		timer.function = task_expire;
+		timer_setup(&timer, NULL, 0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1,
+		    [timer_list.function gets a timer_list])
+	],[
+		AC_MSG_RESULT(no)
+	])
+	EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/spl/config/kernel-trim-unused-symbols.m4 b/spl/config/kernel-trim-unused-symbols.m4
new file mode 100644
index 0000000..d1ac2f3
--- /dev/null
+++ b/spl/config/kernel-trim-unused-symbols.m4
@@ -0,0 +1,19 @@ 
+dnl #
+dnl # config trim unused symbols,
+dnl # Verify the kernel has CONFIG_TRIM_UNUSED_KSYMS DISABLED.
+dnl #
+AC_DEFUN([SPL_AC_CONFIG_TRIM_UNUSED_KSYMS], [
+	AC_MSG_CHECKING([whether CONFIG_TRIM_UNUSED_KSYM is disabled])
+	SPL_LINUX_TRY_COMPILE([
+		#if defined(CONFIG_TRIM_UNUSED_KSYMS)
+		#error CONFIG_TRIM_UNUSED_KSYMS not defined
+		#endif
+	],[ ],[
+		AC_MSG_RESULT([yes])
+	],[
+		AC_MSG_RESULT([no])
+		AC_MSG_ERROR([
+	*** This kernel has unused symbols trimming enabled, please disable.
+	*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
+	])
+])
diff --git a/spl/config/kernel-truncate-range.m4 b/spl/config/kernel-truncate-range.m4
new file mode 100644
index 0000000..4b1600b
--- /dev/null
+++ b/spl/config/kernel-truncate-range.m4
@@ -0,0 +1,19 @@ 
+dnl #
+dnl # 3.5 API change,
+dnl # inode_operations.truncate_range removed
+dnl #
+AC_DEFUN([SPL_AC_INODE_TRUNCATE_RANGE], [
+	AC_MSG_CHECKING([whether truncate_range() inode operation is available])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		struct inode_operations ops;
+		ops.truncate_range = NULL;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1,
+			[truncate_range() inode operation is available])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-urange-sleep.m4 b/spl/config/kernel-urange-sleep.m4
new file mode 100644
index 0000000..85beca6
--- /dev/null
+++ b/spl/config/kernel-urange-sleep.m4
@@ -0,0 +1,21 @@ 
+dnl #
+dnl # 2.6.36 API compatibility.
+dnl # Added usleep_range timer.
+dnl # usleep_range is a finer precision implementation of msleep
+dnl # designed to be a drop-in replacement for udelay where a precise
+dnl # sleep / busy-wait is unnecessary.
+dnl #
+AC_DEFUN([SPL_AC_USLEEP_RANGE], [
+	AC_MSG_CHECKING([whether usleep_range() is available])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/delay.h>
+	],[
+		usleep_range(0, 0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_USLEEP_RANGE, 1,
+		          [usleep_range is available])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-vfs-fsync.m4 b/spl/config/kernel-vfs-fsync.m4
new file mode 100644
index 0000000..3c42bf1
--- /dev/null
+++ b/spl/config/kernel-vfs-fsync.m4
@@ -0,0 +1,17 @@ 
+dnl #
+dnl # 2.6.35 API change,
+dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_VFS_FSYNC], [
+	AC_MSG_CHECKING([whether vfs_fsync() wants 2 args])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		vfs_fsync(NULL, 0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-vfs-getattr.m4 b/spl/config/kernel-vfs-getattr.m4
new file mode 100644
index 0000000..7772cb5
--- /dev/null
+++ b/spl/config/kernel-vfs-getattr.m4
@@ -0,0 +1,62 @@ 
+dnl #
+dnl # 4.11 API, a528d35e@torvalds/linux
+dnl # vfs_getattr(const struct path *p, struct kstat *s, u32 m, unsigned int f)
+dnl #
+AC_DEFUN([SPL_AC_4ARGS_VFS_GETATTR], [
+	AC_MSG_CHECKING([whether vfs_getattr() wants 4 args])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		vfs_getattr((const struct path *)NULL,
+			(struct kstat *)NULL,
+			(u32)0,
+			(unsigned int)0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_4ARGS_VFS_GETATTR, 1,
+		  [vfs_getattr wants 4 args])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # 3.9 API
+dnl # vfs_getattr(struct path *p, struct kstat *s)
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
+	AC_MSG_CHECKING([whether vfs_getattr() wants 2 args])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		vfs_getattr((struct path *) NULL,
+			(struct kstat *)NULL);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
+			  [vfs_getattr wants 2 args])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # <3.9 API
+dnl # vfs_getattr(struct vfsmount *v, struct dentry *d, struct kstat *k)
+dnl #
+AC_DEFUN([SPL_AC_3ARGS_VFS_GETATTR], [
+	AC_MSG_CHECKING([whether vfs_getattr() wants 3 args])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/fs.h>
+	],[
+		vfs_getattr((struct vfsmount *)NULL,
+			(struct dentry *)NULL,
+			(struct kstat *)NULL);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_3ARGS_VFS_GETATTR, 1,
+		  [vfs_getattr wants 3 args])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-wait.m4 b/spl/config/kernel-wait.m4
new file mode 100644
index 0000000..5f718a1
--- /dev/null
+++ b/spl/config/kernel-wait.m4
@@ -0,0 +1,76 @@ 
+dnl #
+dnl # 3.17 API change,
+dnl # wait_on_bit() no longer requires an action argument. The former
+dnl # "wait_on_bit" interface required an 'action' function to be provided
+dnl # which does the actual waiting. There were over 20 such functions in the
+dnl # kernel, many of them identical, though most cases can be satisfied by one
+dnl # of just two functions: one which uses io_schedule() and one which just
+dnl # uses schedule().  This API change was made to consolidate all of those
+dnl # redundant wait functions.
+dnl #
+AC_DEFUN([SPL_AC_WAIT_ON_BIT], [
+	AC_MSG_CHECKING([whether wait_on_bit() takes an action])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/wait.h>
+	],[
+		int (*action)(void *) = NULL;
+		wait_on_bit(NULL, 0, action, 0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_WAIT_ON_BIT_ACTION, 1, [yes])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+dnl #
+dnl # 4.13 API change
+dnl # Renamed struct wait_queue -> struct wait_queue_entry.
+dnl #
+AC_DEFUN([SPL_AC_WAIT_QUEUE_ENTRY_T], [
+	AC_MSG_CHECKING([whether wait_queue_entry_t exists])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/wait.h>
+	],[
+		wait_queue_entry_t *entry __attribute__ ((unused));
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY_T, 1,
+		    [wait_queue_entry_t exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # 4.13 API change
+dnl # Renamed wait_queue_head::task_list -> wait_queue_head::head
+dnl # Renamed wait_queue_entry::task_list -> wait_queue_entry::entry
+dnl #
+AC_DEFUN([SPL_AC_WAIT_QUEUE_HEAD_ENTRY], [
+	AC_MSG_CHECKING([whether wq_head->head and wq_entry->entry exist])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/wait.h>
+
+		#ifdef HAVE_WAIT_QUEUE_ENTRY_T
+		typedef wait_queue_head_t	spl_wait_queue_head_t;
+		typedef wait_queue_entry_t	spl_wait_queue_entry_t;
+		#else
+		typedef wait_queue_head_t	spl_wait_queue_head_t;
+		typedef wait_queue_t		spl_wait_queue_entry_t;
+		#endif
+	],[
+		spl_wait_queue_head_t wq_head;
+		spl_wait_queue_entry_t wq_entry;
+		struct list_head *head __attribute__ ((unused));
+		struct list_head *entry __attribute__ ((unused));
+
+		head = &wq_head.head;
+		entry = &wq_entry.entry;
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_WAIT_QUEUE_HEAD_ENTRY, 1,
+		    [wq_head->head and wq_entry->entry exist])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/kernel-zlib.m4 b/spl/config/kernel-zlib.m4
new file mode 100644
index 0000000..bb23646
--- /dev/null
+++ b/spl/config/kernel-zlib.m4
@@ -0,0 +1,63 @@ 
+dnl #
+dnl # zlib inflate compat,
+dnl # Verify the kernel has CONFIG_ZLIB_INFLATE support enabled.
+dnl #
+AC_DEFUN([SPL_AC_CONFIG_ZLIB_INFLATE], [
+	AC_MSG_CHECKING([whether CONFIG_ZLIB_INFLATE is defined])
+	SPL_LINUX_TRY_COMPILE([
+		#if !defined(CONFIG_ZLIB_INFLATE) && \
+		    !defined(CONFIG_ZLIB_INFLATE_MODULE)
+		#error CONFIG_ZLIB_INFLATE not defined
+		#endif
+	],[ ],[
+		AC_MSG_RESULT([yes])
+	],[
+		AC_MSG_RESULT([no])
+		AC_MSG_ERROR([
+	*** This kernel does not include the required zlib inflate support.
+	*** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set.])
+	])
+])
+
+dnl #
+dnl # zlib deflate compat,
+dnl # Verify the kernel has CONFIG_ZLIB_DEFLATE support enabled.
+dnl #
+AC_DEFUN([SPL_AC_CONFIG_ZLIB_DEFLATE], [
+	AC_MSG_CHECKING([whether CONFIG_ZLIB_DEFLATE is defined])
+	SPL_LINUX_TRY_COMPILE([
+		#if !defined(CONFIG_ZLIB_DEFLATE) && \
+		    !defined(CONFIG_ZLIB_DEFLATE_MODULE)
+		#error CONFIG_ZLIB_DEFLATE not defined
+		#endif
+	],[ ],[
+		AC_MSG_RESULT([yes])
+	],[
+		AC_MSG_RESULT([no])
+		AC_MSG_ERROR([
+	*** This kernel does not include the required zlib deflate support.
+	*** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set.])
+	])
+])
+
+dnl #
+dnl # 2.6.39 API compat,
+dnl # The function zlib_deflate_workspacesize() now take 2 arguments.
+dnl # This was done to avoid always having to allocate the maximum size
+dnl # workspace (268K).  The caller can now specific the windowBits and
+dnl # memLevel compression parameters to get a smaller workspace.
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE],
+	[AC_MSG_CHECKING([whether zlib_deflate_workspacesize() wants 2 args])
+	SPL_LINUX_TRY_COMPILE([
+		#include <linux/zlib.h>
+	],[
+		return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1,
+		          [zlib_deflate_workspacesize() wants 2 args])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
diff --git a/spl/config/ltmain.sh b/spl/config/ltmain.sh
index a736cf9..e4eda6d 100644
--- a/spl/config/ltmain.sh
+++ b/spl/config/ltmain.sh
@@ -31,7 +31,7 @@ 
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-2"
+VERSION="2.4.6 Debian-2.4.6-2.1"
 package_revision=2.4.6
 
 
@@ -64,7 +64,7 @@  package_revision=2.4.6
 # libraries, which are installed to $pkgauxdir.
 
 # Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
@@ -580,16 +580,16 @@  if test yes = "$_G_HAVE_PLUSEQ_OP"; then
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1+=\\ \$func_quote_arg_result"
   }'
 else
   func_append_quoted ()
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1=\$$1\\ \$func_quote_arg_result"
   }
 fi
 
@@ -1091,85 +1091,181 @@  func_relative_path ()
 }
 
 
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg.  Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
 {
     $debug_cmd
 
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+    func_quote_portable_result=$2
+
+    # one-time-loop (easy break)
+    while true
+    do
+      if $1; then
+        func_quote_portable_result=`$ECHO "$2" | $SED \
+          -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+        break
       fi
 
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
+      # Quote for eval.
+      case $func_quote_portable_result in
+        *[\\\`\"\$]*)
+          case $func_quote_portable_result in
+            *[\[\*\?]*)
+              func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
+              break
+              ;;
+          esac
+
+          func_quote_portable_old_IFS=$IFS
+          for _G_char in '\' '`' '"' '$'
+          do
+            # STATE($1) PREV($2) SEPARATOR($3)
+            set start "" ""
+            func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+            IFS=$_G_char
+            for _G_part in $func_quote_portable_result
+            do
+              case $1 in
+              quote)
+                func_append func_quote_portable_result "$3$2"
+                set quote "$_G_part" "\\$_G_char"
+                ;;
+              start)
+                set first "" ""
+                func_quote_portable_result=
+                ;;
+              first)
+                set quote "$_G_part" ""
+                ;;
+              esac
+            done
+          done
+          IFS=$func_quote_portable_old_IFS
           ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
+        *) ;;
       esac
-
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
+      break
     done
+
+    func_quote_portable_unquoted_result=$func_quote_portable_result
+    case $func_quote_portable_result in
+      # double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and variable expansion
+      # for a subsequent eval.
+      # many bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_portable_result=\"$func_quote_portable_result\"
+        ;;
+    esac
 }
 
 
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal).  This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed.  Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+  func_quotefast_eval ()
+  {
+    printf -v func_quotefast_eval_result %q "$1"
+  }
+else
+  func_quotefast_eval ()
+  {
+    func_quote_portable false "$1"
+    func_quotefast_eval_result=$func_quote_portable_result
+  }
+fi
 
-    case $1 in
-      *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later.  MODEs argument may contain zero ore more
+# specifiers listed below separated by ',' character.  This function returns two
+# values:
+#   i) func_quote_arg_result
+#      double-quoted (when needed), suitable for a subsequent eval
+#  ii) func_quote_arg_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.  Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+#       - escape shell special characters
+# 'expand'
+#       - the same as 'eval';  but do not quote variable references
+# 'pretty'
+#       - request aesthetic output, i.e. '"a b"' instead of 'a\ b'.  This might
+#         later used in func_quote to get output like: 'echo "a b"' instead of
+#         'echo a\ b'.  This is slower than default on some shells.
+# 'unquoted'
+#       - produce also $func_quote_arg_unquoted_result which does not contain
+#         wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+#   string      | *_result              | *_unquoted_result
+#   ------------+-----------------------+-------------------
+#   "           | \"                    | \"
+#   a b         | "a b"                 | a b
+#   "a b"       | "\"a b\""             | \"a b\"
+#   *           | "*"                   | *
+#   z="${x-$y}" | "z=\"\${x-\$y}\""     | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+#   string        |   *_result          |  *_unquoted_result
+#   --------------+---------------------+--------------------
+#   z="${x-$y}"   | "z=\"${x-$y}\""     | z=\"${x-$y}\"
+func_quote_arg ()
+{
+    _G_quote_expand=false
+    case ,$1, in
+      *,expand,*)
+        _G_quote_expand=:
+        ;;
     esac
 
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
+    case ,$1, in
+      *,pretty,*|*,expand,*|*,unquoted,*)
+        func_quote_portable $_G_quote_expand "$2"
+        func_quote_arg_result=$func_quote_portable_result
+        func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+        ;;
+      *)
+        # Faster quote-for-eval for some shells.
+        func_quotefast_eval "$2"
+        func_quote_arg_result=$func_quotefast_eval_result
         ;;
     esac
+}
 
-    func_quote_for_expand_result=$_G_arg
+
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command.  See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+    $debug_cmd
+    _G_func_quote_mode=$1 ; shift
+    func_quote_result=
+    while test 0 -lt $#; do
+      func_quote_arg "$_G_func_quote_mode" "$1"
+      if test -n "$func_quote_result"; then
+        func_append func_quote_result " $func_quote_arg_result"
+      else
+        func_append func_quote_result "$func_quote_arg_result"
+      fi
+      shift
+    done
 }
 
 
@@ -1215,8 +1311,8 @@  func_show_eval ()
     _G_cmd=$1
     _G_fail_exp=${2-':'}
 
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
+    func_quote_arg pretty,expand "$_G_cmd"
+    eval "func_notquiet $func_quote_arg_result"
 
     $opt_dry_run || {
       eval "$_G_cmd"
@@ -1241,8 +1337,8 @@  func_show_eval_locale ()
     _G_fail_exp=${2-':'}
 
     $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
+      func_quote_arg expand,pretty "$_G_cmd"
+      eval "func_echo $func_quote_arg_result"
     }
 
     $opt_dry_run || {
@@ -1370,7 +1466,7 @@  func_lt_ver ()
 #! /bin/sh
 
 # Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # A portable, pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
@@ -1530,6 +1626,8 @@  func_run_hooks ()
 {
     $debug_cmd
 
+    _G_rc_run_hooks=false
+
     case " $hookable_fns " in
       *" $1 "*) ;;
       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
@@ -1538,16 +1636,16 @@  func_run_hooks ()
     eval _G_hook_fns=\$$1_hooks; shift
 
     for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
+      if eval $_G_hook '"$@"'; then
+        # store returned options list back into positional
+        # parameters for next 'cmd' execution.
+        eval _G_hook_result=\$${_G_hook}_result
+        eval set dummy "$_G_hook_result"; shift
+        _G_rc_run_hooks=:
+      fi
     done
 
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
+    $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
 }
 
 
@@ -1557,10 +1655,16 @@  func_run_hooks ()
 ## --------------- ##
 
 # In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
+# full positional parameter list in your hook function, you may remove/edit
+# any options that you action, and then pass back the remaining unprocessed
 # options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
+# 'eval'.  In this case you also must return $EXIT_SUCCESS to let the
+# hook's caller know that it should pay attention to
+# '<hooked_function_name>_result'.  Returning $EXIT_FAILURE signalizes that
+# arguments are left untouched by the hook and therefore caller will ignore the
+# result variable.
+#
+# Like this:
 #
 #    my_options_prep ()
 #    {
@@ -1570,9 +1674,11 @@  func_run_hooks ()
 #        usage_message=$usage_message'
 #      -s, --silent       don'\''t print informational messages
 #    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
+#        # No change in '$@' (ignored completely by this hook).  There is
+#        # no need to do the equivalent (but slower) action:
+#        # func_quote eval ${1+"$@"}
+#        # my_options_prep_result=$func_quote_result
+#        false
 #    }
 #    func_add_hook func_options_prep my_options_prep
 #
@@ -1581,25 +1687,37 @@  func_run_hooks ()
 #    {
 #        $debug_cmd
 #
+#        args_changed=false
+#
 #        # Note that for efficiency, we parse as many options as we can
 #        # recognise in a loop before passing the remainder back to the
 #        # caller on the first unrecognised argument we encounter.
 #        while test $# -gt 0; do
 #          opt=$1; shift
 #          case $opt in
-#            --silent|-s) opt_silent=: ;;
+#            --silent|-s) opt_silent=:
+#                         args_changed=:
+#                         ;;
 #            # Separate non-argument short options:
 #            -s*)         func_split_short_opt "$_G_opt"
 #                         set dummy "$func_split_short_opt_name" \
 #                             "-$func_split_short_opt_arg" ${1+"$@"}
 #                         shift
+#                         args_changed=:
 #                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#            *)           # Make sure the first unrecognised option "$_G_opt"
+#                         # is added back to "$@", we could need that later
+#                         # if $args_changed is true.
+#                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
 #          esac
 #        done
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
+#        if $args_changed; then
+#          func_quote eval ${1+"$@"}
+#          my_silent_option_result=$func_quote_result
+#        fi
+#
+#        $args_changed
 #    }
 #    func_add_hook func_parse_options my_silent_option
 #
@@ -1611,16 +1729,32 @@  func_run_hooks ()
 #        $opt_silent && $opt_verbose && func_fatal_help "\
 #    '--silent' and '--verbose' options are mutually exclusive."
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
+#        false
 #    }
 #    func_add_hook func_validate_options my_option_validation
 #
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
 # options you parse.  It's preferable to append if you can, so that
 # multiple option parsing hooks can be added safely.
 
 
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+    $debug_cmd
+
+    _G_func_options_finish_exit=false
+    if func_run_hooks func_options ${1+"$@"}; then
+      func_options_finish_result=$func_run_hooks_result
+      _G_func_options_finish_exit=:
+    fi
+
+    $_G_func_options_finish_exit
+}
+
+
 # func_options [ARG]...
 # ---------------------
 # All the functions called inside func_options are hookable. See the
@@ -1630,17 +1764,28 @@  func_options ()
 {
     $debug_cmd
 
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
+    _G_rc_options=false
 
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
+    for my_func in options_prep parse_options validate_options options_finish
+    do
+      if eval func_$my_func '${1+"$@"}'; then
+        eval _G_res_var='$'"func_${my_func}_result"
+        eval set dummy "$_G_res_var" ; shift
+        _G_rc_options=:
+      fi
+    done
 
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
+    # Save modified positional parameters for caller.  As a top-level
+    # options-parser function we always need to set the 'func_options_result'
+    # variable (regardless the $_G_rc_options value).
+    if $_G_rc_options; then
+      func_options_result=$_G_res_var
+    else
+      func_quote eval ${1+"$@"}
+      func_options_result=$func_quote_result
+    fi
+
+    $_G_rc_options
 }
 
 
@@ -1649,9 +1794,9 @@  func_options ()
 # All initialisations required before starting the option parse loop.
 # Note that when calling hook functions, we pass through the list of
 # positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
+# needs to propagate that back to rest of this script, then the complete
 # modified list must be put in 'func_run_hooks_result' before
-# returning.
+# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
 func_hookable func_options_prep
 func_options_prep ()
 {
@@ -1661,10 +1806,14 @@  func_options_prep ()
     opt_verbose=false
     opt_warning_types=
 
-    func_run_hooks func_options_prep ${1+"$@"}
+    _G_rc_options_prep=false
+    if func_run_hooks func_options_prep ${1+"$@"}; then
+      _G_rc_options_prep=:
+      # save modified positional parameters for caller
+      func_options_prep_result=$func_run_hooks_result
+    fi
 
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
+    $_G_rc_options_prep
 }
 
 
@@ -1678,18 +1827,20 @@  func_parse_options ()
 
     func_parse_options_result=
 
+    _G_rc_parse_options=false
     # this just eases exit handling
     while test $# -gt 0; do
       # Defer to hook functions for initial option parsing, so they
       # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
+      if func_run_hooks func_parse_options ${1+"$@"}; then
+        eval set dummy "$func_run_hooks_result"; shift
+        _G_rc_parse_options=:
+      fi
 
       # Break out of the loop if we already parsed every option.
       test $# -gt 0 || break
 
+      _G_match_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -1704,7 +1855,10 @@  func_parse_options ()
 		      ;;
 
         --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
+                      if test $# = 0 && func_missing_arg $_G_opt; then
+                        _G_rc_parse_options=:
+                        break
+                      fi
                       case " $warning_categories $1" in
                         *" $1 "*)
                           # trailing space prevents matching last $1 above
@@ -1757,15 +1911,25 @@  func_parse_options ()
                       shift
                       ;;
 
-        --)           break ;;
+        --)           _G_rc_parse_options=: ; break ;;
         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift
+                      _G_match_parse_options=false
+                      break
+                      ;;
       esac
+
+      $_G_match_parse_options && _G_rc_parse_options=:
     done
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
+
+    if $_G_rc_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      func_parse_options_result=$func_quote_result
+    fi
+
+    $_G_rc_parse_options
 }
 
 
@@ -1778,16 +1942,21 @@  func_validate_options ()
 {
     $debug_cmd
 
+    _G_rc_validate_options=false
+
     # Display all warnings if -W was not given.
     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    func_run_hooks func_validate_options ${1+"$@"}
+    if func_run_hooks func_validate_options ${1+"$@"}; then
+      # save modified positional parameters for caller
+      func_validate_options_result=$func_run_hooks_result
+      _G_rc_validate_options=:
+    fi
 
     # Bail if the options were screwed!
     $exit_cmd $EXIT_FAILURE
 
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
+    $_G_rc_validate_options
 }
 
 
@@ -2068,7 +2237,7 @@  include the following information:
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname $scriptversion Debian-2.4.6-2
+       version:        $progname $scriptversion Debian-2.4.6-2.1
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
@@ -2270,6 +2439,8 @@  libtool_options_prep ()
     nonopt=
     preserve_args=
 
+    _G_rc_lt_options_prep=:
+
     # Shorthand for --mode=foo, only valid as the first argument
     case $1 in
     clean|clea|cle|cl)
@@ -2293,11 +2464,18 @@  libtool_options_prep ()
     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
       shift; set dummy --mode uninstall ${1+"$@"}; shift
       ;;
+    *)
+      _G_rc_lt_options_prep=false
+      ;;
     esac
 
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
+    if $_G_rc_lt_options_prep; then
+      # Pass back the list of options.
+      func_quote eval ${1+"$@"}
+      libtool_options_prep_result=$func_quote_result
+    fi
+
+    $_G_rc_lt_options_prep
 }
 func_add_hook func_options_prep libtool_options_prep
 
@@ -2309,9 +2487,12 @@  libtool_parse_options ()
 {
     $debug_cmd
 
+    _G_rc_lt_parse_options=false
+
     # Perform our own loop to consume as many options as possible in
     # each iteration.
     while test $# -gt 0; do
+      _G_match_lt_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -2386,15 +2567,22 @@  libtool_parse_options ()
                         func_append preserve_args " $_G_opt"
                         ;;
 
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+        # An option not handled by this hook function:
+        *)              set dummy "$_G_opt" ${1+"$@"} ; shift
+                        _G_match_lt_parse_options=false
+                        break
+                        ;;
       esac
+      $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
     done
 
+    if $_G_rc_lt_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      libtool_parse_options_result=$func_quote_result
+    fi
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
+    $_G_rc_lt_parse_options
 }
 func_add_hook func_parse_options libtool_parse_options
 
@@ -2451,8 +2639,8 @@  libtool_validate_options ()
     }
 
     # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_result
 }
 func_add_hook func_validate_options libtool_validate_options
 
@@ -3418,8 +3606,8 @@  func_mode_compile ()
       esac
     done
 
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
+    func_quote_arg pretty "$libobj"
+    test "X$libobj" != "X$func_quote_arg_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
       && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
@@ -3492,8 +3680,8 @@  compiler."
 
     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
     srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
+    func_quote_arg pretty "$srcfile"
+    qsrcfile=$func_quote_arg_result
 
     # Only build a PIC object if we are building libtool libraries.
     if test yes = "$build_libtool_libs"; then
@@ -4096,8 +4284,8 @@  func_mode_install ()
        case $nonopt in *shtool*) :;; *) false;; esac
     then
       # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
+      func_quote_arg pretty "$nonopt"
+      install_prog="$func_quote_arg_result "
       arg=$1
       shift
     else
@@ -4107,8 +4295,8 @@  func_mode_install ()
 
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
+    func_quote_arg pretty "$arg"
+    func_append install_prog "$func_quote_arg_result"
     install_shared_prog=$install_prog
     case " $install_prog " in
       *[\\\ /]cp\ *) install_cp=: ;;
@@ -4165,12 +4353,12 @@  func_mode_install ()
       esac
 
       # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
+      func_quote_arg pretty "$arg"
+      func_append install_prog " $func_quote_arg_result"
       if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
+	func_quote_arg pretty "$arg2"
       fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
+      func_append install_shared_prog " $func_quote_arg_result"
     done
 
     test -z "$install_prog" && \
@@ -4181,8 +4369,8 @@  func_mode_install ()
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
+	func_quote_arg pretty "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_arg_result"
       fi
     fi
 
@@ -4478,8 +4666,8 @@  func_mode_install ()
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
 	        $opt_quiet || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
+	          func_quote_arg expand,pretty "$relink_command"
+		  eval "func_echo $func_quote_arg_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
@@ -5258,7 +5446,8 @@  else
   if test \"\$libtool_execute_magic\" != \"$magic\"; then
     file=\"\$0\""
 
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    func_quote_arg pretty "$ECHO"
+    qECHO=$func_quote_arg_result
     $ECHO "\
 
 # A function that is used when there is no print builtin or printf.
@@ -5268,7 +5457,7 @@  func_fallback_echo ()
 \$1
 _LTECHO_EOF'
 }
-    ECHO=\"$qECHO\"
+    ECHO=$qECHO
   fi
 
 # Very basic option parsing. These options are (a) specific to
@@ -6611,9 +6800,9 @@  func_mode_link ()
     while test "$#" -gt 0; do
       arg=$1
       shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
+      func_quote_arg pretty,unquoted "$arg"
+      qarg=$func_quote_arg_unquoted_result
+      func_append libtool_args " $func_quote_arg_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
@@ -7211,9 +7400,9 @@  func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $func_quote_arg_result"
+	  func_append compiler_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7227,10 +7416,10 @@  func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $wl$func_quote_arg_result"
+	  func_append compiler_flags " $wl$func_quote_arg_result"
+	  func_append linker_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7254,8 +7443,8 @@  func_mode_link ()
 
       # -msg_* for osf cc
       -msg_*)
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -7279,8 +7468,8 @@  func_mode_link ()
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
       -specs=*|-fsanitize=*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
@@ -7301,15 +7490,15 @@  func_mode_link ()
 	  continue
         else
 	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
+	  func_quote_arg pretty "$arg"
+	  arg=$func_quote_arg_result
         fi
 	;;
 
       # Some other compiler flag.
       -* | +*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       *.$objext)
@@ -7429,8 +7618,8 @@  func_mode_link ()
       *)
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
       esac # arg
 
@@ -9942,8 +10131,8 @@  EOF
 	    for cmd in $concat_cmds; do
 	      IFS=$save_ifs
 	      $opt_quiet || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
+		  func_quote_arg expand,pretty "$cmd"
+		  eval "func_echo $func_quote_arg_result"
 	      }
 	      $opt_dry_run || eval "$cmd" || {
 		lt_exit=$?
@@ -10036,8 +10225,8 @@  EOF
 	  eval cmd=\"$cmd\"
 	  IFS=$save_ifs
 	  $opt_quiet || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
+	    func_quote_arg expand,pretty "$cmd"
+	    eval "func_echo $func_quote_arg_result"
 	  }
 	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
@@ -10511,12 +10700,12 @@  EOF
 	  elif eval var_value=\$$var; test -z "$var_value"; then
 	    relink_command="$var=; export $var; $relink_command"
 	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	    func_quote_arg pretty "$var_value"
+	    relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
 	  fi
 	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+	func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
+	relink_command=$func_quote_arg_unquoted_result
       fi
 
       # Only actually do things if not in dry run mode.
@@ -10756,13 +10945,14 @@  EOF
 	elif eval var_value=\$$var; test -z "$var_value"; then
 	  relink_command="$var=; export $var; $relink_command"
 	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  func_quote_arg pretty,unquoted "$var_value"
+	  relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
 	fi
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      func_quote_arg pretty,unquoted "$relink_command"
+      relink_command=$func_quote_arg_unquoted_result
       if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
diff --git a/spl/config/spl-build.m4 b/spl/config/spl-build.m4
index 3b1a495..5c6c02a 100644
--- a/spl/config/spl-build.m4
+++ b/spl/config/spl-build.m4
@@ -17,9 +17,6 @@  AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
 	KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
 	AC_SUBST(KERNELCPPFLAGS)
 
-	SPL_AC_DEBUG
-	SPL_AC_DEBUG_KMEM
-	SPL_AC_DEBUG_KMEM_TRACKING
 	SPL_AC_TEST_MODULE
 	SPL_AC_ATOMIC_SPINLOCK
 	SPL_AC_SHRINKER_CALLBACK
@@ -27,8 +24,6 @@  AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
 	SPL_AC_CONFIG_TRIM_UNUSED_KSYMS
 	SPL_AC_PDE_DATA
 	SPL_AC_SET_FS_PWD_WITH_CONST
-	SPL_AC_2ARGS_VFS_UNLINK
-	SPL_AC_4ARGS_VFS_RENAME
 	SPL_AC_2ARGS_VFS_FSYNC
 	SPL_AC_INODE_TRUNCATE_RANGE
 	SPL_AC_FS_STRUCT_SPINLOCK
@@ -54,9 +49,10 @@  AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
 	SPL_AC_KMEM_CACHE_CREATE_USERCOPY
 	SPL_AC_WAIT_QUEUE_ENTRY_T
 	SPL_AC_WAIT_QUEUE_HEAD_ENTRY
+	SPL_AC_IO_SCHEDULE_TIMEOUT
 	SPL_AC_KERNEL_WRITE
 	SPL_AC_KERNEL_READ
-	SPL_AC_TIMER_SETUP
+	SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST
 ])
 
 AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -229,9 +225,12 @@  AC_DEFUN([SPL_AC_RPM], [
 		AC_MSG_RESULT([$HAVE_RPMBUILD])
 	])
 
-	RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"'
+	RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1"'
+	RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM) 1"'
+	RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING) 1"'
 	RPM_DEFINE_UTIL=
 	RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+	RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
 	RPM_DEFINE_DKMS=
 
 	SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
@@ -754,1029 +753,3 @@  AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [
 	AC_MSG_CHECKING([whether kernel defines atomic64_t])
 	AC_MSG_RESULT([$have_atomic64_t])
 ])
-
-AC_DEFUN([SPL_AC_SHRINKER_CALLBACK],[
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	dnl #
-	dnl # 2.6.23 to 2.6.34 API change
-	dnl # ->shrink(int nr_to_scan, gfp_t gfp_mask)
-	dnl #
-	AC_MSG_CHECKING([whether old 2-argument shrinker exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/mm.h>
-
-		int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
-	],[
-		struct shrinker cache_shrinker = {
-			.shrink = shrinker_cb,
-			.seeks = DEFAULT_SEEKS,
-		};
-		register_shrinker(&cache_shrinker);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_2ARGS_OLD_SHRINKER_CALLBACK, 1,
-			[old shrinker callback wants 2 args])
-	],[
-		AC_MSG_RESULT(no)
-		dnl #
-		dnl # 2.6.35 - 2.6.39 API change
-		dnl # ->shrink(struct shrinker *,
-		dnl #          int nr_to_scan, gfp_t gfp_mask)
-		dnl #
-		AC_MSG_CHECKING([whether old 3-argument shrinker exists])
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/mm.h>
-
-			int shrinker_cb(struct shrinker *, int nr_to_scan,
-					gfp_t gfp_mask);
-		],[
-			struct shrinker cache_shrinker = {
-				.shrink = shrinker_cb,
-				.seeks = DEFAULT_SEEKS,
-			};
-			register_shrinker(&cache_shrinker);
-		],[
-			AC_MSG_RESULT(yes)
-			AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1,
-				[old shrinker callback wants 3 args])
-		],[
-			AC_MSG_RESULT(no)
-			dnl #
-			dnl # 3.0 - 3.11 API change
-			dnl # ->shrink(struct shrinker *,
-			dnl #          struct shrink_control *sc)
-			dnl #
-			AC_MSG_CHECKING(
-				[whether new 2-argument shrinker exists])
-			SPL_LINUX_TRY_COMPILE([
-				#include <linux/mm.h>
-
-				int shrinker_cb(struct shrinker *,
-						struct shrink_control *sc);
-			],[
-				struct shrinker cache_shrinker = {
-					.shrink = shrinker_cb,
-					.seeks = DEFAULT_SEEKS,
-				};
-				register_shrinker(&cache_shrinker);
-			],[
-				AC_MSG_RESULT(yes)
-				AC_DEFINE(HAVE_2ARGS_NEW_SHRINKER_CALLBACK, 1,
-					[new shrinker callback wants 2 args])
-			],[
-				AC_MSG_RESULT(no)
-				dnl #
-				dnl # 3.12 API change,
-				dnl # ->shrink() is logically split in to
-				dnl # ->count_objects() and ->scan_objects()
-				dnl #
-				AC_MSG_CHECKING(
-				    [whether ->count_objects callback exists])
-				SPL_LINUX_TRY_COMPILE([
-					#include <linux/mm.h>
-
-					unsigned long shrinker_cb(
-						struct shrinker *,
-						struct shrink_control *sc);
-				],[
-					struct shrinker cache_shrinker = {
-						.count_objects = shrinker_cb,
-						.scan_objects = shrinker_cb,
-						.seeks = DEFAULT_SEEKS,
-					};
-					register_shrinker(&cache_shrinker);
-				],[
-					AC_MSG_RESULT(yes)
-					AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK,
-						1, [->count_objects exists])
-				],[
-					AC_MSG_ERROR(error)
-				])
-			])
-		])
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 2.6.33 API change,
-dnl # Removed .ctl_name from struct ctl_table.
-dnl #
-AC_DEFUN([SPL_AC_CTL_NAME], [
-	AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/sysctl.h>
-	],[
-		struct ctl_table ctl __attribute__ ((unused));
-		ctl.ctl_name = 0;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 3.10 API change,
-dnl # PDE is replaced by PDE_DATA
-dnl #
-AC_DEFUN([SPL_AC_PDE_DATA], [
-	AC_MSG_CHECKING([whether PDE_DATA() is available])
-	SPL_LINUX_TRY_COMPILE_SYMBOL([
-		#include <linux/proc_fs.h>
-	], [
-		PDE_DATA(NULL);
-	], [PDE_DATA], [], [
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_PDE_DATA, 1, [yes])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 3.9 API change
-dnl # set_fs_pwd takes const struct path *
-dnl #
-AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	[AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/spinlock.h>
-		#include <linux/fs_struct.h>
-		#include <linux/path.h>
-		void (*const set_fs_pwd_func)
-			(struct fs_struct *, const struct path *)
-			= set_fs_pwd;
-	],[
-		return 0;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
-			[set_fs_pwd() needs const path *])
-	],[
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/spinlock.h>
-			#include <linux/fs_struct.h>
-			#include <linux/path.h>
-			void (*const set_fs_pwd_func)
-				(struct fs_struct *, struct path *)
-				= set_fs_pwd;
-		],[
-			return 0;
-		],[
-			AC_MSG_RESULT(no)
-		],[
-			AC_MSG_ERROR(unknown)
-		])
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.13 API change
-dnl # vfs_unlink() updated to take a third delegated_inode argument.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_UNLINK],
-	[AC_MSG_CHECKING([whether vfs_unlink() wants 2 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1,
-		          [vfs_unlink() wants 2 args])
-	],[
-		AC_MSG_RESULT(no)
-		dnl #
-		dnl # Linux 3.13 API change
-		dnl # Added delegated inode
-		dnl #
-		AC_MSG_CHECKING([whether vfs_unlink() wants 3 args])
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/fs.h>
-		],[
-			vfs_unlink((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
-		],[
-			AC_MSG_RESULT(yes)
-			AC_DEFINE(HAVE_3ARGS_VFS_UNLINK, 1,
-				  [vfs_unlink() wants 3 args])
-		],[
-			AC_MSG_ERROR(no)
-		])
-
-	])
-])
-
-dnl #
-dnl # 3.13 and 3.15 API changes
-dnl # Added delegated inode and flags argument.
-dnl #
-AC_DEFUN([SPL_AC_4ARGS_VFS_RENAME],
-	[AC_MSG_CHECKING([whether vfs_rename() wants 4 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
-			(struct inode *) NULL, (struct dentry *) NULL);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1,
-		          [vfs_rename() wants 4 args])
-	],[
-		AC_MSG_RESULT(no)
-		dnl #
-		dnl # Linux 3.13 API change
-		dnl # Added delegated inode
-		dnl #
-		AC_MSG_CHECKING([whether vfs_rename() wants 5 args])
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/fs.h>
-		],[
-			vfs_rename((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
-		],[
-			AC_MSG_RESULT(yes)
-			AC_DEFINE(HAVE_5ARGS_VFS_RENAME, 1,
-				  [vfs_rename() wants 5 args])
-		],[
-			AC_MSG_RESULT(no)
-			dnl #
-			dnl # Linux 3.15 API change
-			dnl # Added flags
-			dnl #
-			AC_MSG_CHECKING([whether vfs_rename() wants 6 args])
-			SPL_LINUX_TRY_COMPILE([
-				#include <linux/fs.h>
-			],[
-				vfs_rename((struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode **) NULL,
-					(unsigned int) 0);
-			],[
-				AC_MSG_RESULT(yes)
-				AC_DEFINE(HAVE_6ARGS_VFS_RENAME, 1,
-					  [vfs_rename() wants 6 args])
-			],[
-				AC_MSG_ERROR(no)
-			])
-		])
-	])
-])
-
-dnl #
-dnl # 2.6.36 API change,
-dnl # The 'struct fs_struct->lock' was changed from a rwlock_t to
-dnl # a spinlock_t to improve the fastpath performance.
-dnl #
-AC_DEFUN([SPL_AC_FS_STRUCT_SPINLOCK], [
-	AC_MSG_CHECKING([whether struct fs_struct uses spinlock_t])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/sched.h>
-		#include <linux/fs_struct.h>
-	],[
-		static struct fs_struct fs;
-		spin_lock_init(&fs.lock);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_FS_STRUCT_SPINLOCK, 1,
-		          [struct fs_struct uses spinlock_t])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # User namespaces, use kuid_t in place of uid_t
-dnl # where available. Not strictly a user namespaces thing
-dnl # but it should prevent surprises
-dnl #
-AC_DEFUN([SPL_AC_KUIDGID_T], [
-	AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/uidgid.h>
-	], [
-		kuid_t userid = KUIDT_INIT(0);
-		kgid_t groupid = KGIDT_INIT(0);
-	],[
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/uidgid.h>
-		], [
-			kuid_t userid = 0;
-			kgid_t groupid = 0;
-		],[
-			AC_MSG_RESULT(yes; optional)
-		],[
-			AC_MSG_RESULT(yes; mandatory)
-			AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use])
-		])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 2.6.35 API change,
-dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_FSYNC], [
-	AC_MSG_CHECKING([whether vfs_fsync() wants 2 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_fsync(NULL, 0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 3.5 API change,
-dnl # inode_operations.truncate_range removed
-dnl #
-AC_DEFUN([SPL_AC_INODE_TRUNCATE_RANGE], [
-	AC_MSG_CHECKING([whether truncate_range() inode operation is available])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		struct inode_operations ops;
-		ops.truncate_range = NULL;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1,
-			[truncate_range() inode operation is available])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # Linux 2.6.38 - 3.x API
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [
-	AC_MSG_CHECKING([whether fops->fallocate() exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-		struct file_operations fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # Linux 2.6.x - 2.6.37 API
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [
-	AC_MSG_CHECKING([whether iops->fallocate() exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
-		struct inode_operations fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # PaX Linux 2.6.38 - 3.x API
-dnl #
-AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
-	AC_MSG_CHECKING([whether fops->fallocate() exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-		struct file_operations_no_const fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # The fallocate callback was moved from the inode_operations
-dnl # structure to the file_operations structure.
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [
-	SPL_AC_KERNEL_FILE_FALLOCATE
-	SPL_AC_KERNEL_INODE_FALLOCATE
-	SPL_AC_PAX_KERNEL_FILE_FALLOCATE
-])
-
-dnl #
-dnl # zlib inflate compat,
-dnl # Verify the kernel has CONFIG_ZLIB_INFLATE support enabled.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_ZLIB_INFLATE], [
-	AC_MSG_CHECKING([whether CONFIG_ZLIB_INFLATE is defined])
-	SPL_LINUX_TRY_COMPILE([
-		#if !defined(CONFIG_ZLIB_INFLATE) && \
-		    !defined(CONFIG_ZLIB_INFLATE_MODULE)
-		#error CONFIG_ZLIB_INFLATE not defined
-		#endif
-	],[ ],[
-		AC_MSG_RESULT([yes])
-	],[
-		AC_MSG_RESULT([no])
-		AC_MSG_ERROR([
-	*** This kernel does not include the required zlib inflate support.
-	*** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set.])
-	])
-])
-
-dnl #
-dnl # zlib deflate compat,
-dnl # Verify the kernel has CONFIG_ZLIB_DEFLATE support enabled.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_ZLIB_DEFLATE], [
-	AC_MSG_CHECKING([whether CONFIG_ZLIB_DEFLATE is defined])
-	SPL_LINUX_TRY_COMPILE([
-		#if !defined(CONFIG_ZLIB_DEFLATE) && \
-		    !defined(CONFIG_ZLIB_DEFLATE_MODULE)
-		#error CONFIG_ZLIB_DEFLATE not defined
-		#endif
-	],[ ],[
-		AC_MSG_RESULT([yes])
-	],[
-		AC_MSG_RESULT([no])
-		AC_MSG_ERROR([
-	*** This kernel does not include the required zlib deflate support.
-	*** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set.])
-	])
-])
-
-dnl #
-dnl # config trim unused symbols,
-dnl # Verify the kernel has CONFIG_TRIM_UNUSED_KSYMS DISABLED.
-dnl #
-AC_DEFUN([SPL_AC_CONFIG_TRIM_UNUSED_KSYMS], [
-	AC_MSG_CHECKING([whether CONFIG_TRIM_UNUSED_KSYM is disabled])
-	SPL_LINUX_TRY_COMPILE([
-		#if defined(CONFIG_TRIM_UNUSED_KSYMS)
-		#error CONFIG_TRIM_UNUSED_KSYMS not defined
-		#endif
-	],[ ],[
-		AC_MSG_RESULT([yes])
-	],[
-		AC_MSG_RESULT([no])
-		AC_MSG_ERROR([
-	*** This kernel has unused symbols trimming enabled, please disable.
-	*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
-	])
-])
-
-dnl #
-dnl # 2.6.39 API compat,
-dnl # The function zlib_deflate_workspacesize() now take 2 arguments.
-dnl # This was done to avoid always having to allocate the maximum size
-dnl # workspace (268K).  The caller can now specific the windowBits and
-dnl # memLevel compression parameters to get a smaller workspace.
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE],
-	[AC_MSG_CHECKING([whether zlib_deflate_workspacesize() wants 2 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/zlib.h>
-	],[
-		return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1,
-		          [zlib_deflate_workspacesize() wants 2 args])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 2.6.39 API change,
-dnl # Shrinker adjust to use common shrink_control structure.
-dnl #
-AC_DEFUN([SPL_AC_SHRINK_CONTROL_STRUCT], [
-	AC_MSG_CHECKING([whether struct shrink_control exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/mm.h>
-	],[
-		struct shrink_control sc __attribute__ ((unused));
-
-		sc.nr_to_scan = 0;
-		sc.gfp_mask = GFP_KERNEL;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1,
-			[struct shrink_control exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 3.1 API Change
-dnl #
-dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
-dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [
-	AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/rwsem.h>
-	],[
-		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-		raw_spinlock_t dummy_lock __attribute__ ((unused)) =
-		    __RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
-		dummy_semaphore.wait_lock = dummy_lock;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(RWSEM_SPINLOCK_IS_RAW, 1,
-		[struct rw_semaphore member wait_lock is raw_spinlock_t])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.16 API Change
-dnl #
-dnl # rwsem-spinlock "->activity" changed to "->count"
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_ACTIVITY], [
-	AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/rwsem.h>
-	],[
-		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-		dummy_semaphore.activity = 0;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
-		[struct rw_semaphore has member activity])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.8 API Change
-dnl #
-dnl # rwsem "->count" changed to atomic_long_t type
-dnl #
-AC_DEFUN([SPL_AC_RWSEM_ATOMIC_LONG_COUNT], [
-	AC_MSG_CHECKING(
-	[whether struct rw_semaphore has atomic_long_t member count])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/rwsem.h>
-	],[
-		DECLARE_RWSEM(dummy_semaphore);
-		(void) atomic_long_read(&dummy_semaphore.count);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
-		[struct rw_semaphore has atomic_long_t member count])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 3.9 API change,
-dnl # Moved things from linux/sched.h to linux/sched/rt.h
-dnl #
-AC_DEFUN([SPL_AC_SCHED_RT_HEADER],
-	[AC_MSG_CHECKING([whether header linux/sched/rt.h exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/sched.h>
-		#include <linux/sched/rt.h>
-	],[
-		return 0;
-	],[
-		AC_DEFINE(HAVE_SCHED_RT_HEADER, 1, [linux/sched/rt.h exists])
-		AC_MSG_RESULT(yes)
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 4.11 API change,
-dnl # Moved things from linux/sched.h to linux/sched/signal.h
-dnl #
-AC_DEFUN([SPL_AC_SCHED_SIGNAL_HEADER],
-	[AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/sched.h>
-		#include <linux/sched/signal.h>
-	],[
-		return 0;
-	],[
-		AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1, [linux/sched/signal.h exists])
-		AC_MSG_RESULT(yes)
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 4.11 API, a528d35e@torvalds/linux
-dnl # vfs_getattr(const struct path *p, struct kstat *s, u32 m, unsigned int f)
-dnl #
-AC_DEFUN([SPL_AC_4ARGS_VFS_GETATTR], [
-	AC_MSG_CHECKING([whether vfs_getattr() wants 4 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_getattr((const struct path *)NULL,
-			(struct kstat *)NULL,
-			(u32)0,
-			(unsigned int)0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_4ARGS_VFS_GETATTR, 1,
-		  [vfs_getattr wants 4 args])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 3.9 API 
-dnl # vfs_getattr(struct path *p, struct kstat *s)
-dnl #
-AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
-	AC_MSG_CHECKING([whether vfs_getattr() wants 2 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_getattr((struct path *) NULL,
-			(struct kstat *)NULL);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
-			  [vfs_getattr wants 2 args])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # <3.9 API 
-dnl # vfs_getattr(struct vfsmount *v, struct dentry *d, struct kstat *k)
-dnl #
-AC_DEFUN([SPL_AC_3ARGS_VFS_GETATTR], [
-	AC_MSG_CHECKING([whether vfs_getattr() wants 3 args])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		vfs_getattr((struct vfsmount *)NULL,
-			(struct dentry *)NULL,
-			(struct kstat *)NULL);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_3ARGS_VFS_GETATTR, 1,
-		  [vfs_getattr wants 3 args])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 2.6.36 API compatibility.
-dnl # Added usleep_range timer.
-dnl # usleep_range is a finer precision implementation of msleep
-dnl # designed to be a drop-in replacement for udelay where a precise
-dnl # sleep / busy-wait is unnecessary.
-dnl #
-AC_DEFUN([SPL_AC_USLEEP_RANGE], [
-	AC_MSG_CHECKING([whether usleep_range() is available])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/delay.h>
-	],[
-		usleep_range(0, 0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_USLEEP_RANGE, 1,
-		          [usleep_range is available])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 2.6.35 API change,
-dnl # The cachep->gfpflags member was renamed cachep->allocflags.  These are
-dnl # private allocation flags which are applied when allocating a new slab
-dnl # in kmem_getpages().  Unfortunately there is no public API for setting
-dnl # non-default flags.
-dnl #
-AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
-	AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/slab.h>
-	],[
-		struct kmem_cache cachep __attribute__ ((unused));
-		cachep.allocflags = GFP_KERNEL;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
-			[struct kmem_cache has allocflags])
-	],[
-		AC_MSG_RESULT(no)
-
-		AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
-		SPL_LINUX_TRY_COMPILE([
-			#include <linux/slab.h>
-		],[
-			struct kmem_cache cachep __attribute__ ((unused));
-			cachep.gfpflags = GFP_KERNEL;
-		],[
-			AC_MSG_RESULT(yes)
-			AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
-				[struct kmem_cache has gfpflags])
-		],[
-			AC_MSG_RESULT(no)
-		])
-	])
-])
-
-dnl #
-dnl # 3.17 API change,
-dnl # wait_on_bit() no longer requires an action argument. The former
-dnl # "wait_on_bit" interface required an 'action' function to be provided
-dnl # which does the actual waiting. There were over 20 such functions in the
-dnl # kernel, many of them identical, though most cases can be satisfied by one
-dnl # of just two functions: one which uses io_schedule() and one which just
-dnl # uses schedule().  This API change was made to consolidate all of those
-dnl # redundant wait functions.
-dnl #
-AC_DEFUN([SPL_AC_WAIT_ON_BIT], [
-	AC_MSG_CHECKING([whether wait_on_bit() takes an action])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/wait.h>
-	],[
-		int (*action)(void *) = NULL;
-		wait_on_bit(NULL, 0, action, 0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_WAIT_ON_BIT_ACTION, 1, [yes])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 4.7 API change
-dnl # i_mutex is changed to i_rwsem. Instead of directly using
-dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
-dnl # We test inode_lock_shared because inode_lock is introduced earlier.
-dnl #
-AC_DEFUN([SPL_AC_INODE_LOCK], [
-	AC_MSG_CHECKING([whether inode_lock_shared() exists])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		struct inode *inode = NULL;
-		inode_lock_shared(inode);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.9 API change
-dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
-dnl #
-AC_DEFUN([SPL_AC_GROUP_INFO_GID], [
-	AC_MSG_CHECKING([whether group_info->gid exists])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/cred.h>
-	],[
-		struct group_info *gi = groups_alloc(1);
-		gi->gid[0] = KGIDT_INIT(0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # grsecurity API change,
-dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
-dnl # kmem_cache_create_usercopy().
-dnl #
-AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_USERCOPY], [
-	AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/slab.h>
-		static void ctor(void *foo)
-		{
-			// fake ctor
-		}
-	],[
-		struct kmem_cache *skc_linux_cache;
-		const char *name = "test";
-		size_t size = 4096;
-		size_t align = 8;
-		unsigned long flags = 0;
-		size_t useroffset = 0;
-		size_t usersize = size - useroffset;
-
-		skc_linux_cache = kmem_cache_create_usercopy(
-			name, size, align, flags, useroffset, usersize, ctor);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
-				[kmem_cache_create_usercopy() exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.13 API change
-dnl # Renamed struct wait_queue -> struct wait_queue_entry.
-dnl #
-AC_DEFUN([SPL_AC_WAIT_QUEUE_ENTRY_T], [
-	AC_MSG_CHECKING([whether wait_queue_entry_t exists])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/wait.h>
-	],[
-		wait_queue_entry_t *entry __attribute__ ((unused));
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY_T, 1,
-		    [wait_queue_entry_t exists])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 4.13 API change
-dnl # Renamed wait_queue_head::task_list -> wait_queue_head::head
-dnl # Renamed wait_queue_entry::task_list -> wait_queue_entry::entry
-dnl #
-AC_DEFUN([SPL_AC_WAIT_QUEUE_HEAD_ENTRY], [
-	AC_MSG_CHECKING([whether wq_head->head and wq_entry->entry exist])
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/wait.h>
-
-		#ifdef HAVE_WAIT_QUEUE_ENTRY_T
-		typedef wait_queue_head_t	spl_wait_queue_head_t;
-		typedef wait_queue_entry_t	spl_wait_queue_entry_t;
-		#else
-		typedef wait_queue_head_t	spl_wait_queue_head_t;
-		typedef wait_queue_t		spl_wait_queue_entry_t;
-		#endif
-	],[
-		spl_wait_queue_head_t wq_head;
-		spl_wait_queue_entry_t wq_entry;
-		struct list_head *head __attribute__ ((unused));
-		struct list_head *entry __attribute__ ((unused));
-
-		head = &wq_head.head;
-		entry = &wq_entry.entry;
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_WAIT_QUEUE_HEAD_ENTRY, 1,
-		    [wq_head->head and wq_entry->entry exist])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
-
-dnl #
-dnl # 4.14 API change
-dnl # kernel_write() which was introduced in 3.9 was updated to take
-dnl # the offset as a pointer which is needed by vn_rdwr().
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_WRITE], [
-	AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		struct file *file = NULL;
-		const void *buf = NULL;
-		size_t count = 0;
-		loff_t *pos = NULL;
-		ssize_t ret;
-
-		ret = kernel_write(file, buf, count, pos);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
-		    [kernel_write() take loff_t pointer])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.14 API change
-dnl # kernel_read() which has existed for forever was updated to take
-dnl # the offset as a pointer which is needed by vn_rdwr().
-dnl #
-AC_DEFUN([SPL_AC_KERNEL_READ], [
-	AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-		#include <linux/fs.h>
-	],[
-		struct file *file = NULL;
-		void *buf = NULL;
-		size_t count = 0;
-		loff_t *pos = NULL;
-		ssize_t ret;
-
-		ret = kernel_read(file, buf, count, pos);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
-		    [kernel_read() take loff_t pointer])
-	],[
-		AC_MSG_RESULT(no)
-	])
-	EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 4.16 new API
-dnl # new timer_setup()
-dnl #
-AC_DEFUN([SPL_AC_TIMER_SETUP], [
-	AC_MSG_CHECKING([whether timer_setup() exists])
-	tmp_flags="$EXTRA_KCFLAGS"
-        EXTRA_KCFLAGS="-Werror"
-	SPL_LINUX_TRY_COMPILE([
-                #include <linux/timer.h>
-        ],[
-		struct timer_list timer;
-
-		timer_setup(&timer, NULL, 0);
-        ],[
-                AC_MSG_RESULT(yes)
-                AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1,
-                    [use timer_setup() for timer initialization])
-        ],[
-                AC_MSG_RESULT(no)
-        ])
-        EXTRA_KCFLAGS="$tmp_flags"
-])
diff --git a/spl/configure b/spl/configure
index b26f8f3..5f9a799 100755
--- a/spl/configure
+++ b/spl/configure
@@ -1,6 +1,6 @@ 
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for spl 0.7.5.
+# Generated by GNU Autoconf 2.69 for spl 0.7.9.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@  MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='spl'
 PACKAGE_TARNAME='spl'
-PACKAGE_VERSION='0.7.5'
-PACKAGE_STRING='spl 0.7.5'
+PACKAGE_VERSION='0.7.9'
+PACKAGE_STRING='spl 0.7.9'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -632,14 +632,14 @@  ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
-CONFIG_KERNEL_FALSE
-CONFIG_KERNEL_TRUE
-CONFIG_USER_FALSE
-CONFIG_USER_TRUE
 DEBUG_KMEM_TRACKING
 DEBUG_KMEM
 DEBUG_SPL
 DEBUG_CFLAGS
+CONFIG_KERNEL_FALSE
+CONFIG_KERNEL_TRUE
+CONFIG_USER_FALSE
+CONFIG_USER_TRUE
 KERNELCPPFLAGS
 KERNELMAKE_PARAMS
 LINUX_SYMBOLS
@@ -824,10 +824,10 @@  with_config
 enable_linux_builtin
 with_linux
 with_linux_obj
+enable_atomic_spinlocks
 enable_debug
 enable_debug_kmem
 enable_debug_kmem_tracking
-enable_atomic_spinlocks
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1389,7 +1389,7 @@  if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures spl 0.7.5 to adapt to many kinds of systems.
+\`configure' configures spl 0.7.9 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1461,7 +1461,7 @@  fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of spl 0.7.5:";;
+     short | recursive ) echo "Configuration of spl 0.7.9:";;
    esac
   cat <<\_ACEOF
 
@@ -1485,12 +1485,12 @@  Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-linux-builtin  Configure for builtin in-tree kernel modules
                           [default=no]
+  --enable-atomic-spinlocks
+                          Atomic types use spinlocks [default=check]
   --enable-debug          Enable generic debug support [default=no]
   --enable-debug-kmem     Enable basic kmem accounting [default=no]
   --enable-debug-kmem-tracking
                           Enable detailed kmem tracking [default=no]
-  --enable-atomic-spinlocks
-                          Atomic types use spinlocks [default=check]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1586,7 +1586,7 @@  fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-spl configure 0.7.5
+spl configure 0.7.9
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1864,7 +1864,7 @@  cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by spl $as_me 0.7.5, which was
+It was created by spl $as_me 0.7.9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3005,7 +3005,7 @@  fi
 
 # Define the identity of the package.
  PACKAGE='spl'
- VERSION='0.7.5'
+ VERSION='0.7.9'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12256,9 +12256,12 @@  $as_echo "$HAVE_RPMBUILD" >&6; }
 
 fi
 
-	RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"'
+	RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1"'
+	RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM) 1"'
+	RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING) 1"'
 	RPM_DEFINE_UTIL=
 	RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+	RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
 	RPM_DEFINE_DKMS=
 
 	SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
@@ -12544,94 +12547,6 @@  $as_echo "$LINUX_SYMBOLS" >&6; }
 	KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
 
 
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
-$as_echo_n "checking whether debugging is enabled... " >&6; }
-	# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
-  enableval=$enable_debug;
-else
-  enable_debug=no
-fi
-
-
-	if test "x$enable_debug" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
-		DEBUG_CFLAGS="-DDEBUG -Werror"
-		DEBUG_SPL="_with_debug"
-
-else
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
-		DEBUG_CFLAGS="-DNDEBUG"
-		DEBUG_SPL="_without_debug"
-
-fi
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
-$as_echo "$enable_debug" >&6; }
-
-
-	# Check whether --enable-debug-kmem was given.
-if test "${enable_debug_kmem+set}" = set; then :
-  enableval=$enable_debug_kmem;
-else
-  enable_debug_kmem=no
-fi
-
-
-	if test "x$enable_debug_kmem" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
-		DEBUG_KMEM="_with_debug_kmem"
-
-$as_echo "#define DEBUG_KMEM 1" >>confdefs.h
-
-
-else
-
-		DEBUG_KMEM="_without_debug_kmem"
-
-fi
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether basic kmem accounting is enabled" >&5
-$as_echo_n "checking whether basic kmem accounting is enabled... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem" >&5
-$as_echo "$enable_debug_kmem" >&6; }
-
-
-	# Check whether --enable-debug-kmem-tracking was given.
-if test "${enable_debug_kmem_tracking+set}" = set; then :
-  enableval=$enable_debug_kmem_tracking;
-else
-  enable_debug_kmem_tracking=no
-fi
-
-
-	if test "x$enable_debug_kmem_tracking" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
-		DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
-
-$as_echo "#define DEBUG_KMEM_TRACKING 1" >>confdefs.h
-
-
-else
-
-		DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
-
-fi
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether detailed kmem tracking is enabled" >&5
-$as_echo_n "checking whether detailed kmem tracking is enabled... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem_tracking" >&5
-$as_echo "$enable_debug_kmem_tracking" >&6; }
-
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
 $as_echo_n "checking whether modules can be built... " >&6; }
 
@@ -13435,8 +13350,9 @@  fi
 
 	EXTRA_KCFLAGS="$tmp_flags"
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 2 args" >&5
-$as_echo_n "checking whether vfs_unlink() wants 2 args... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_fsync() wants 2 args" >&5
+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -13448,7 +13364,7 @@  int
 main (void)
 {
 
-		vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
+		vfs_fsync(NULL, 0);
 
   ;
   return 0;
@@ -13476,7 +13392,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_2ARGS_VFS_UNLINK 1" >>confdefs.h
+$as_echo "#define HAVE_2ARGS_VFS_FSYNC 1" >>confdefs.h
 
 
 else
@@ -13485,22 +13401,30 @@  sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-										{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 3 args" >&5
-$as_echo_n "checking whether vfs_unlink() wants 3 args... " >&6; }
+
+
+
+fi
+	rm -Rf build
+
+
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_range() inode operation is available" >&5
+$as_echo_n "checking whether truncate_range() inode operation is available... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/fs.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-			vfs_unlink((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
+		struct inode_operations ops;
+		ops.truncate_range = NULL;
 
   ;
   return 0;
@@ -13525,17 +13449,18 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_3ARGS_VFS_UNLINK 1" >>confdefs.h
+$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-			as_fn_error $? "no" "$LINENO" 5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
 
 
@@ -13545,28 +13470,24 @@  fi
 
 
 
-
-
-fi
-	rm -Rf build
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 4 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 4 args... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct fs_struct uses spinlock_t" >&5
+$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/sched.h>
+		#include <linux/fs_struct.h>
 
 int
 main (void)
 {
 
-		vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
-			(struct inode *) NULL, (struct dentry *) NULL);
+		static struct fs_struct fs;
+		spin_lock_init(&fs.lock);
 
   ;
   return 0;
@@ -13594,7 +13515,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_4ARGS_VFS_RENAME 1" >>confdefs.h
+$as_echo "#define HAVE_FS_STRUCT_SPINLOCK 1" >>confdefs.h
 
 
 else
@@ -13603,24 +13524,31 @@  sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-										{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 5 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 5 args... " >&6; }
+
+
+
+fi
+	rm -Rf build
+
+
+	EXTRA_KCFLAGS="$tmp_flags"
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kuid_t/kgid_t is available" >&5
+$as_echo_n "checking whether kuid_t/kgid_t is available... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/fs.h>
+		#include <linux/uidgid.h>
 
 int
 main (void)
 {
 
-			vfs_rename((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
+		kuid_t userid = KUIDT_INIT(0);
+		kgid_t groupid = KGIDT_INIT(0);
 
   ;
   return 0;
@@ -13645,37 +13573,19 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_5ARGS_VFS_RENAME 1" >>confdefs.h
-
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-															{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 6 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 6 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-				#include <linux/fs.h>
+			#include <linux/uidgid.h>
 
 int
 main (void)
 {
 
-				vfs_rename((struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode **) NULL,
-					(unsigned int) 0);
+			kuid_t userid = 0;
+			kgid_t groupid = 0;
 
   ;
   return 0;
@@ -13700,23 +13610,17 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_6ARGS_VFS_RENAME 1" >>confdefs.h
-
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; optional" >&5
+$as_echo "yes; optional" >&6; }
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-				as_fn_error $? "no" "$LINENO" 5
-
-
-
-fi
-	rm -Rf build
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; mandatory" >&5
+$as_echo "yes; mandatory" >&6; }
 
+$as_echo "#define HAVE_KUIDGID_T 1" >>confdefs.h
 
 
 
@@ -13726,6 +13630,13 @@  fi
 
 
 
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
 
 
 fi
@@ -13734,8 +13645,9 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_fsync() wants 2 args" >&5
-$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -13747,7 +13659,10 @@  int
 main (void)
 {
 
-		vfs_fsync(NULL, 0);
+		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+		struct file_operations fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
 
   ;
   return 0;
@@ -13775,7 +13690,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_2ARGS_VFS_FSYNC 1" >>confdefs.h
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
 
 
 else
@@ -13793,8 +13708,8 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_range() inode operation is available" >&5
-$as_echo_n "checking whether truncate_range() inode operation is available... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
+$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -13806,8 +13721,10 @@  int
 main (void)
 {
 
-		struct inode_operations ops;
-		ops.truncate_range = NULL;
+		long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+		struct inode_operations fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
 
   ;
   return 0;
@@ -13835,7 +13752,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
+$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
 
 
 else
@@ -13853,24 +13770,23 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct fs_struct uses spinlock_t" >&5
-$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/sched.h>
-		#include <linux/fs_struct.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		static struct fs_struct fs;
-		spin_lock_init(&fs.lock);
+		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+		struct file_operations_no_const fops __attribute__ ((unused)) = {
+			.fallocate = fallocate,
+		};
 
   ;
   return 0;
@@ -13898,7 +13814,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_FS_STRUCT_SPINLOCK 1" >>confdefs.h
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
 
 
 else
@@ -13914,25 +13830,25 @@  fi
 	rm -Rf build
 
 
-	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kuid_t/kgid_t is available" >&5
-$as_echo_n "checking whether kuid_t/kgid_t is available... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_INFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_INFLATE is defined... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/uidgid.h>
+		#if !defined(CONFIG_ZLIB_INFLATE) && \
+		    !defined(CONFIG_ZLIB_INFLATE_MODULE)
+		#error CONFIG_ZLIB_INFLATE not defined
+		#endif
 
 int
 main (void)
 {
 
-		kuid_t userid = KUIDT_INIT(0);
-		kgid_t groupid = KGIDT_INIT(0);
-
   ;
   return 0;
 }
@@ -13956,20 +13872,43 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-			#include <linux/uidgid.h>
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		as_fn_error $? "
+	*** This kernel does not include the required zlib inflate support.
+	*** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set." "$LINENO" 5
+
+
+
+fi
+	rm -Rf build
+
+
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_DEFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_DEFLATE is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+		#if !defined(CONFIG_ZLIB_DEFLATE) && \
+		    !defined(CONFIG_ZLIB_DEFLATE_MODULE)
+		#error CONFIG_ZLIB_DEFLATE not defined
+		#endif
 
 int
 main (void)
 {
 
-			kuid_t userid = 0;
-			kgid_t groupid = 0;
-
   ;
   return 0;
 }
@@ -13993,25 +13932,8 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; optional" >&5
-$as_echo "yes; optional" >&6; }
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; mandatory" >&5
-$as_echo "yes; mandatory" >&6; }
-
-$as_echo "#define HAVE_KUIDGID_T 1" >>confdefs.h
-
-
-
-
-fi
-	rm -Rf build
-
-
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
   $as_echo "$as_me: failed program was:" >&5
@@ -14019,6 +13941,9 @@  sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+		as_fn_error $? "
+	*** This kernel does not include the required zlib deflate support.
+	*** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set." "$LINENO" 5
 
 
 
@@ -14027,25 +13952,20 @@  fi
 
 
 
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
-$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether zlib_deflate_workspacesize() wants 2 args" >&5
+$as_echo_n "checking whether zlib_deflate_workspacesize() wants 2 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/zlib.h>
 
 int
 main (void)
 {
 
-		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-		struct file_operations fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
+		return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
 
   ;
   return 0;
@@ -14073,7 +13993,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+$as_echo "#define HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE 1" >>confdefs.h
 
 
 else
@@ -14091,23 +14011,23 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
-$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct shrink_control exists" >&5
+$as_echo_n "checking whether struct shrink_control exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/mm.h>
 
 int
 main (void)
 {
 
-		long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
-		struct inode_operations fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
+		struct shrink_control sc __attribute__ ((unused));
+
+		sc.nr_to_scan = 0;
+		sc.gfp_mask = GFP_KERNEL;
 
   ;
   return 0;
@@ -14135,7 +14055,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
+$as_echo "#define HAVE_SHRINK_CONTROL_STRUCT 1" >>confdefs.h
 
 
 else
@@ -14153,23 +14073,25 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
-$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore member wait_lock is raw" >&5
+$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/rwsem.h>
 
 int
 main (void)
 {
 
-		long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
-		struct file_operations_no_const fops __attribute__ ((unused)) = {
-			.fallocate = fallocate,
-		};
+		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+		raw_spinlock_t dummy_lock __attribute__ ((unused)) =
+		    __RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
+		dummy_semaphore.wait_lock = dummy_lock;
 
   ;
   return 0;
@@ -14197,7 +14119,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+$as_echo "#define RWSEM_SPINLOCK_IS_RAW 1" >>confdefs.h
 
 
 else
@@ -14213,25 +14135,27 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_INFLATE is defined" >&5
-$as_echo_n "checking whether CONFIG_ZLIB_INFLATE is defined... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore has member activity" >&5
+$as_echo_n "checking whether struct rw_semaphore has member activity... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#if !defined(CONFIG_ZLIB_INFLATE) && \
-		    !defined(CONFIG_ZLIB_INFLATE_MODULE)
-		#error CONFIG_ZLIB_INFLATE not defined
-		#endif
+		#include <linux/rwsem.h>
 
 int
 main (void)
 {
 
+		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+		dummy_semaphore.activity = 0;
+
   ;
   return 0;
 }
@@ -14258,15 +14182,15 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+$as_echo "#define HAVE_RWSEM_ACTIVITY 1" >>confdefs.h
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-		as_fn_error $? "
-	*** This kernel does not include the required zlib inflate support.
-	*** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set." "$LINENO" 5
 
 
 
@@ -14274,24 +14198,27 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_DEFLATE is defined" >&5
-$as_echo_n "checking whether CONFIG_ZLIB_DEFLATE is defined... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore has atomic_long_t member count" >&5
+$as_echo_n "checking whether struct rw_semaphore has atomic_long_t member count... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#if !defined(CONFIG_ZLIB_DEFLATE) && \
-		    !defined(CONFIG_ZLIB_DEFLATE_MODULE)
-		#error CONFIG_ZLIB_DEFLATE not defined
-		#endif
+		#include <linux/rwsem.h>
 
 int
 main (void)
 {
 
+		DECLARE_RWSEM(dummy_semaphore);
+		(void) atomic_long_read(&dummy_semaphore.count);
+
   ;
   return 0;
 }
@@ -14318,15 +14245,15 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+$as_echo "#define HAVE_RWSEM_ATOMIC_LONG_COUNT 1" >>confdefs.h
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-		as_fn_error $? "
-	*** This kernel does not include the required zlib deflate support.
-	*** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set." "$LINENO" 5
 
 
 
@@ -14334,21 +14261,23 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether zlib_deflate_workspacesize() wants 2 args" >&5
-$as_echo_n "checking whether zlib_deflate_workspacesize() wants 2 args... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/rt.h exists" >&5
+$as_echo_n "checking whether header linux/sched/rt.h exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/zlib.h>
+		#include <linux/sched.h>
+		#include <linux/sched/rt.h>
 
 int
 main (void)
 {
 
-		return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
+		return 0;
 
   ;
   return 0;
@@ -14373,11 +14302,11 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE 1" >>confdefs.h
+$as_echo "#define HAVE_SCHED_RT_HEADER 1" >>confdefs.h
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
   $as_echo "$as_me: failed program was:" >&5
@@ -14393,24 +14322,21 @@  fi
 
 
 
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct shrink_control exists" >&5
-$as_echo_n "checking whether struct shrink_control exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/signal.h exists" >&5
+$as_echo_n "checking whether header linux/sched/signal.h exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/mm.h>
+		#include <linux/sched.h>
+		#include <linux/sched/signal.h>
 
 int
 main (void)
 {
 
-		struct shrink_control sc __attribute__ ((unused));
-
-		sc.nr_to_scan = 0;
-		sc.gfp_mask = GFP_KERNEL;
+		return 0;
 
   ;
   return 0;
@@ -14435,11 +14361,11 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_SHRINK_CONTROL_STRUCT 1" >>confdefs.h
+$as_echo "#define HAVE_SCHED_SIGNAL_HEADER 1" >>confdefs.h
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
   $as_echo "$as_me: failed program was:" >&5
@@ -14456,25 +14382,23 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore member wait_lock is raw" >&5
-$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 4 args" >&5
+$as_echo_n "checking whether vfs_getattr() wants 4 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/rwsem.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-		raw_spinlock_t dummy_lock __attribute__ ((unused)) =
-		    __RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
-		dummy_semaphore.wait_lock = dummy_lock;
+		vfs_getattr((const struct path *)NULL,
+			(struct kstat *)NULL,
+			(u32)0,
+			(unsigned int)0);
 
   ;
   return 0;
@@ -14502,7 +14426,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define RWSEM_SPINLOCK_IS_RAW 1" >>confdefs.h
+$as_echo "#define HAVE_4ARGS_VFS_GETATTR 1" >>confdefs.h
 
 
 else
@@ -14518,26 +14442,24 @@  fi
 	rm -Rf build
 
 
-	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore has member activity" >&5
-$as_echo_n "checking whether struct rw_semaphore has member activity... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 3 args" >&5
+$as_echo_n "checking whether vfs_getattr() wants 3 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/rwsem.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		struct rw_semaphore dummy_semaphore __attribute__ ((unused));
-		dummy_semaphore.activity = 0;
+		vfs_getattr((struct vfsmount *)NULL,
+			(struct dentry *)NULL,
+			(struct kstat *)NULL);
 
   ;
   return 0;
@@ -14565,7 +14487,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_RWSEM_ACTIVITY 1" >>confdefs.h
+$as_echo "#define HAVE_3ARGS_VFS_GETATTR 1" >>confdefs.h
 
 
 else
@@ -14581,26 +14503,23 @@  fi
 	rm -Rf build
 
 
-	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore has atomic_long_t member count" >&5
-$as_echo_n "checking whether struct rw_semaphore has atomic_long_t member count... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 2 args" >&5
+$as_echo_n "checking whether vfs_getattr() wants 2 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/rwsem.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		DECLARE_RWSEM(dummy_semaphore);
-		(void) atomic_long_read(&dummy_semaphore.count);
+		vfs_getattr((struct path *) NULL,
+			(struct kstat *)NULL);
 
   ;
   return 0;
@@ -14628,7 +14547,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_RWSEM_ATOMIC_LONG_COUNT 1" >>confdefs.h
+$as_echo "#define HAVE_2ARGS_VFS_GETATTR 1" >>confdefs.h
 
 
 else
@@ -14644,23 +14563,22 @@  fi
 	rm -Rf build
 
 
-	EXTRA_KCFLAGS="$tmp_flags"
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/rt.h exists" >&5
-$as_echo_n "checking whether header linux/sched/rt.h exists... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether usleep_range() is available" >&5
+$as_echo_n "checking whether usleep_range() is available... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/sched.h>
-		#include <linux/sched/rt.h>
+		#include <linux/delay.h>
 
 int
 main (void)
 {
 
-		return 0;
+		usleep_range(0, 0);
 
   ;
   return 0;
@@ -14685,12 +14603,12 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-
-$as_echo "#define HAVE_SCHED_RT_HEADER 1" >>confdefs.h
-
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+$as_echo "#define HAVE_USLEEP_RANGE 1" >>confdefs.h
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -14705,22 +14623,23 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/signal.h exists" >&5
-$as_echo_n "checking whether header linux/sched/signal.h exists... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has allocflags" >&5
+$as_echo_n "checking whether struct kmem_cache has allocflags... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/sched.h>
-		#include <linux/sched/signal.h>
+		#include <linux/slab.h>
 
 int
 main (void)
 {
 
-		return 0;
-
+		struct kmem_cache cachep __attribute__ ((unused));
+		cachep.allocflags = GFP_KERNEL;
+
   ;
   return 0;
 }
@@ -14744,12 +14663,12 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-
-$as_echo "#define HAVE_SCHED_SIGNAL_HEADER 1" >>confdefs.h
-
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+$as_echo "#define HAVE_KMEM_CACHE_ALLOCFLAGS 1" >>confdefs.h
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -14757,31 +14676,21 @@  sed 's/^/| /' conftest.$ac_ext >&5
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
-
-
-fi
-	rm -Rf build
-
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 4 args" >&5
-$as_echo_n "checking whether vfs_getattr() wants 4 args... " >&6; }
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has gfpflags" >&5
+$as_echo_n "checking whether struct kmem_cache has gfpflags... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+			#include <linux/slab.h>
 
 int
 main (void)
 {
 
-		vfs_getattr((const struct path *)NULL,
-			(struct kstat *)NULL,
-			(u32)0,
-			(unsigned int)0);
+			struct kmem_cache cachep __attribute__ ((unused));
+			cachep.gfpflags = GFP_KERNEL;
 
   ;
   return 0;
@@ -14806,17 +14715,17 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_4ARGS_VFS_GETATTR 1" >>confdefs.h
+$as_echo "#define HAVE_KMEM_CACHE_GFPFLAGS 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 
@@ -14827,22 +14736,28 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 3 args" >&5
-$as_echo_n "checking whether vfs_getattr() wants 3 args... " >&6; }
+
+fi
+	rm -Rf build
+
+
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_on_bit() takes an action" >&5
+$as_echo_n "checking whether wait_on_bit() takes an action... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/wait.h>
 
 int
 main (void)
 {
 
-		vfs_getattr((struct vfsmount *)NULL,
-			(struct dentry *)NULL,
-			(struct kstat *)NULL);
+		int (*action)(void *) = NULL;
+		wait_on_bit(NULL, 0, action, 0);
 
   ;
   return 0;
@@ -14870,7 +14785,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_3ARGS_VFS_GETATTR 1" >>confdefs.h
+$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 1" >>confdefs.h
 
 
 else
@@ -14888,8 +14803,10 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants 2 args" >&5
-$as_echo_n "checking whether vfs_getattr() wants 2 args... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_lock_shared() exists" >&5
+$as_echo_n "checking whether inode_lock_shared() exists... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -14901,8 +14818,8 @@  int
 main (void)
 {
 
-		vfs_getattr((struct path *) NULL,
-			(struct kstat *)NULL);
+		struct inode *inode = NULL;
+		inode_lock_shared(inode);
 
   ;
   return 0;
@@ -14930,7 +14847,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_2ARGS_VFS_GETATTR 1" >>confdefs.h
+$as_echo "#define HAVE_INODE_LOCK_SHARED 1" >>confdefs.h
 
 
 else
@@ -14946,22 +14863,26 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether usleep_range() is available" >&5
-$as_echo_n "checking whether usleep_range() is available... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether group_info->gid exists" >&5
+$as_echo_n "checking whether group_info->gid exists... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/delay.h>
+		#include <linux/cred.h>
 
 int
 main (void)
 {
 
-		usleep_range(0, 0);
+		struct group_info *gi = groups_alloc(1);
+		gi->gid[0] = KGIDT_INIT(0);
 
   ;
   return 0;
@@ -14989,7 +14910,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_USLEEP_RANGE 1" >>confdefs.h
+$as_echo "#define HAVE_GROUP_INFO_GID 1" >>confdefs.h
 
 
 else
@@ -15005,23 +14926,38 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has allocflags" >&5
-$as_echo_n "checking whether struct kmem_cache has allocflags... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kmem_cache_create_usercopy() exists" >&5
+$as_echo_n "checking whether kmem_cache_create_usercopy() exists... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
 		#include <linux/slab.h>
+		static void ctor(void *foo)
+		{
+			// fake ctor
+		}
 
 int
 main (void)
 {
 
-		struct kmem_cache cachep __attribute__ ((unused));
-		cachep.allocflags = GFP_KERNEL;
+		struct kmem_cache *skc_linux_cache;
+		const char *name = "test";
+		size_t size = 4096;
+		size_t align = 8;
+		unsigned long flags = 0;
+		size_t useroffset = 0;
+		size_t usersize = size - useroffset;
+
+		skc_linux_cache = kmem_cache_create_usercopy(
+			name, size, align, flags, useroffset, usersize, ctor);
 
   ;
   return 0;
@@ -15049,7 +14985,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_KMEM_CACHE_ALLOCFLAGS 1" >>confdefs.h
+$as_echo "#define HAVE_KMEM_CACHE_CREATE_USERCOPY 1" >>confdefs.h
 
 
 else
@@ -15059,21 +14995,29 @@  sed 's/^/| /' conftest.$ac_ext >&5
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has gfpflags" >&5
-$as_echo_n "checking whether struct kmem_cache has gfpflags... " >&6; }
+
+
+fi
+	rm -Rf build
+
+
+	EXTRA_KCFLAGS="$tmp_flags"
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_queue_entry_t exists" >&5
+$as_echo_n "checking whether wait_queue_entry_t exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/slab.h>
+		#include <linux/wait.h>
 
 int
 main (void)
 {
 
-			struct kmem_cache cachep __attribute__ ((unused));
-			cachep.gfpflags = GFP_KERNEL;
+		wait_queue_entry_t *entry __attribute__ ((unused));
 
   ;
   return 0;
@@ -15098,17 +15042,17 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_KMEM_CACHE_GFPFLAGS 1" >>confdefs.h
+$as_echo "#define HAVE_WAIT_QUEUE_ENTRY_T 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 
@@ -15119,15 +15063,8 @@  fi
 
 
 
-
-fi
-	rm -Rf build
-
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_on_bit() takes an action" >&5
-$as_echo_n "checking whether wait_on_bit() takes an action... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wq_head->head and wq_entry->entry exist" >&5
+$as_echo_n "checking whether wq_head->head and wq_entry->entry exist... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
@@ -15135,12 +15072,25 @@  cat confdefs.h - <<_ACEOF >conftest.c
 
 		#include <linux/wait.h>
 
+		#ifdef HAVE_WAIT_QUEUE_ENTRY_T
+		typedef wait_queue_head_t	spl_wait_queue_head_t;
+		typedef wait_queue_entry_t	spl_wait_queue_entry_t;
+		#else
+		typedef wait_queue_head_t	spl_wait_queue_head_t;
+		typedef wait_queue_t		spl_wait_queue_entry_t;
+		#endif
+
 int
 main (void)
 {
 
-		int (*action)(void *) = NULL;
-		wait_on_bit(NULL, 0, action, 0);
+		spl_wait_queue_head_t wq_head;
+		spl_wait_queue_entry_t wq_entry;
+		struct list_head *head __attribute__ ((unused));
+		struct list_head *entry __attribute__ ((unused));
+
+		head = &wq_head.head;
+		entry = &wq_entry.entry;
 
   ;
   return 0;
@@ -15168,7 +15118,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 1" >>confdefs.h
+$as_echo "#define HAVE_WAIT_QUEUE_HEAD_ENTRY 1" >>confdefs.h
 
 
 else
@@ -15186,23 +15136,21 @@  fi
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_lock_shared() exists" >&5
-$as_echo_n "checking whether inode_lock_shared() exists... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether io_schedule_timeout() is available" >&5
+$as_echo_n "checking whether io_schedule_timeout() is available... " >&6; }
+
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/sched.h>
 
 int
 main (void)
 {
 
-		struct inode *inode = NULL;
-		inode_lock_shared(inode);
+		(void) io_schedule_timeout(1);
 
   ;
   return 0;
@@ -15226,31 +15174,69 @@  _ACEOF
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_INODE_LOCK_SHARED 1" >>confdefs.h
+fi
+	rm -Rf build
 
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+	if test $rc -ne 0; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+	else
+		if test "x$enable_linux_builtin" != xyes; then
+
+	grep -q -E '[[:space:]]io_schedule_timeout[[:space:]]' \
+		$LINUX_OBJ/Module*.symvers 2>/dev/null
+	rc=$?
+	if test $rc -ne 0; then
+		export=0
+		for file in ; do
+			grep -q -E "EXPORT_SYMBOL.*(io_schedule_timeout)" \
+				"$LINUX_OBJ/$file" 2>/dev/null
+			rc=$?
+			if test $rc -eq 0; then
+				export=1
+				break;
+			fi
+		done
+		if test $export -eq 0; then :
+			rc=1
+		else :
+			rc=0
+		fi
+	else :
+		rc=0
+	fi
+
+		fi
+		if test $rc -ne 0; then :
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
+		else :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+$as_echo "#define HAVE_IO_SCHEDULE_TIMEOUT 1" >>confdefs.h
 
-fi
-	rm -Rf build
 
+		fi
+	fi
 
-	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether group_info->gid exists" >&5
-$as_echo_n "checking whether group_info->gid exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel_write() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_write() takes loff_t pointer... " >&6; }
 	tmp_flags="$EXTRA_KCFLAGS"
 	EXTRA_KCFLAGS="-Werror"
 
@@ -15258,14 +15244,19 @@  $as_echo_n "checking whether group_info->gid exists... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/cred.h>
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		struct group_info *gi = groups_alloc(1);
-		gi->gid[0] = KGIDT_INIT(0);
+		struct file *file = NULL;
+		const void *buf = NULL;
+		size_t count = 0;
+		loff_t *pos = NULL;
+		ssize_t ret;
+
+		ret = kernel_write(file, buf, count, pos);
 
   ;
   return 0;
@@ -15293,7 +15284,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_GROUP_INFO_GID 1" >>confdefs.h
+$as_echo "#define HAVE_KERNEL_WRITE_PPOS 1" >>confdefs.h
 
 
 else
@@ -15312,8 +15303,8 @@  fi
 	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kmem_cache_create_usercopy() exists" >&5
-$as_echo_n "checking whether kmem_cache_create_usercopy() exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel_read() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_read() takes loff_t pointer... " >&6; }
 	tmp_flags="$EXTRA_KCFLAGS"
 	EXTRA_KCFLAGS="-Werror"
 
@@ -15321,26 +15312,19 @@  $as_echo_n "checking whether kmem_cache_create_usercopy() exists... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/slab.h>
-		static void ctor(void *foo)
-		{
-			// fake ctor
-		}
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-		struct kmem_cache *skc_linux_cache;
-		const char *name = "test";
-		size_t size = 4096;
-		size_t align = 8;
-		unsigned long flags = 0;
-		size_t useroffset = 0;
-		size_t usersize = size - useroffset;
+		struct file *file = NULL;
+		void *buf = NULL;
+		size_t count = 0;
+		loff_t *pos = NULL;
+		ssize_t ret;
 
-		skc_linux_cache = kmem_cache_create_usercopy(
-			name, size, align, flags, useroffset, usersize, ctor);
+		ret = kernel_read(file, buf, count, pos);
 
   ;
   return 0;
@@ -15368,7 +15352,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_KMEM_CACHE_CREATE_USERCOPY 1" >>confdefs.h
+$as_echo "#define HAVE_KERNEL_READ_PPOS 1" >>confdefs.h
 
 
 else
@@ -15387,20 +15371,29 @@  fi
 	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_queue_entry_t exists" >&5
-$as_echo_n "checking whether wait_queue_entry_t exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether timer_list.function gets a timer_list" >&5
+$as_echo_n "checking whether timer_list.function gets a timer_list... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/wait.h>
+		#include <linux/timer.h>
+		void task_expire(struct timer_list *tl) {}
 
 int
 main (void)
 {
 
-		wait_queue_entry_t *entry __attribute__ ((unused));
+		#ifndef from_timer
+		#error "No from_timer() macro"
+		#endif
+
+		struct timer_list timer;
+		timer.function = task_expire;
+		timer_setup(&timer, NULL, 0);
 
   ;
   return 0;
@@ -15428,7 +15421,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_WAIT_QUEUE_ENTRY_T 1" >>confdefs.h
+$as_echo "#define HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST 1" >>confdefs.h
 
 
 else
@@ -15444,104 +15437,173 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
+ ;;
+		user)      ;;
+		all)
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wq_head->head and wq_entry->entry exist" >&5
-$as_echo_n "checking whether wq_head->head and wq_entry->entry exist... " >&6; }
 
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then :
+  withval=$with_linux; kernelsrc="$withval"
+fi
 
-cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/wait.h>
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then :
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
 
-		#ifdef HAVE_WAIT_QUEUE_ENTRY_T
-		typedef wait_queue_head_t	spl_wait_queue_head_t;
-		typedef wait_queue_entry_t	spl_wait_queue_entry_t;
-		#else
-		typedef wait_queue_head_t	spl_wait_queue_head_t;
-		typedef wait_queue_t		spl_wait_queue_entry_t;
-		#endif
 
-int
-main (void)
-{
+	{ $as_echo "$as_me:${as_lineno-$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
 
-		spl_wait_queue_head_t wq_head;
-		spl_wait_queue_entry_t wq_entry;
-		struct list_head *head __attribute__ ((unused));
-		struct list_head *entry __attribute__ ((unused));
+		if test -n "$sourcelink" && test -e ${sourcelink}; then
+			kernelsrc=`readlink -f ${sourcelink}`
+		else
+			kernelsrc="Not found"
+		fi
+	else
+		if test "$kernelsrc" = "NONE"; then
+			kernsrcver=NONE
+		fi
+		withlinux=yes
+	fi
 
-		head = &wq_head.head;
-		entry = &wq_entry.entry;
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
+$as_echo "$kernelsrc" >&6; }
+	if test ! -d "$kernelsrc"; then
+		as_fn_error $? "
+	*** Please make sure the kernel devel package for your distribution
+	*** is installed and then try again.  If that fails, you can specify the
+	*** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
+	fi
 
-  ;
-  return 0;
-}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
+$as_echo_n "checking kernel build directory... " >&6; }
+	if test -z "$kernelbuild"; then
+		if test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"; then
+			kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
+		elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+			kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+		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:${as_lineno-$LINENO}: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
 
-_ACEOF
+	{ $as_echo "$as_me:${as_lineno-$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`
 
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
+		if test -z "$kernsrcver"; then
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+			as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
+		fi
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+		if test "x$enable_linux_builtin" != xyes; then
+			as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
+		else
+			as_fn_error $? "
+	*** Cannot find UTS_RELEASE definition.
+	*** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
+		fi
+	fi
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
 
-$as_echo "#define HAVE_WAIT_QUEUE_HEAD_ENTRY 1" >>confdefs.h
+	LINUX=${kernelsrc}
+	LINUX_OBJ=${kernelbuild}
+	LINUX_VERSION=${kernsrcver}
 
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 
 
 
-fi
-	rm -Rf build
+	modpost=$LINUX/scripts/Makefile.modpost
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
+$as_echo_n "checking kernel file name for module symbols... " >&6; }
+	if test "x$enable_linux_builtin" != xyes -a -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_fn_error $? "
+	*** Please make sure the kernel devel package for your distribution
+	*** is installed.  If you are 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." "$LINENO" 5
+		fi
+	else
+		LINUX_SYMBOLS=NONE
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
 
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel_write() takes loff_t pointer" >&5
-$as_echo_n "checking whether kernel_write() takes loff_t pointer... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
+
+	if test "${LINUX_OBJ}" != "${LINUX}"; then
+		KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+	fi
 
 
-cat confdefs.h - <<_ACEOF >conftest.c
+	KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
 
 
-		#include <linux/fs.h>
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
+$as_echo_n "checking whether modules can be built... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
 
 int
 main (void)
 {
 
-		struct file *file = NULL;
-		const void *buf = NULL;
-		size_t count = 0;
-		loff_t *pos = NULL;
-		ssize_t ret;
-
-		ret = kernel_write(file, buf, count, pos);
-
   ;
   return 0;
 }
@@ -15568,15 +15630,19 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_KERNEL_WRITE_PPOS 1" >>confdefs.h
-
-
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+		if test "x$enable_linux_builtin" != xyes; then
+			as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
+		else
+			as_fn_error $? "
+	*** Unable to build an empty module.
+	*** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
+		fi
 
 
 
@@ -15584,782 +15650,68 @@  fi
 	rm -Rf build
 
 
-	EXTRA_KCFLAGS="$tmp_flags"
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel_read() takes loff_t pointer" >&5
-$as_echo_n "checking whether kernel_read() takes loff_t pointer... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
 
+	if test "x$cross_compiling" != xyes; then :
 
-cat confdefs.h - <<_ACEOF >conftest.c
+		if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-		#include <linux/fs.h>
+				#include "$LINUX/include/linux/license.h"
 
 int
-main (void)
+main ()
 {
 
-		struct file *file = NULL;
-		void *buf = NULL;
-		size_t count = 0;
-		loff_t *pos = NULL;
-		ssize_t ret;
-
-		ret = kernel_read(file, buf, count, pos);
+				return !license_is_gpl_compatible(
+				    "$SPL_META_LICENSE");
 
   ;
   return 0;
 }
 
 _ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
 
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_KERNEL_READ_PPOS 1" >>confdefs.h
-
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-
-
-fi
-	rm -Rf build
-
-
-	EXTRA_KCFLAGS="$tmp_flags"
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether timer_setup() exists" >&5
-$as_echo_n "checking whether timer_setup() exists... " >&6; }
-	tmp_flags="$EXTRA_KCFLAGS"
-        EXTRA_KCFLAGS="-Werror"
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-                #include <linux/timer.h>
-
-int
-main (void)
-{
-
-		struct timer_list timer;
-
-		timer_setup(&timer, NULL, 0);
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_KERNEL_TIMER_SETUP 1" >>confdefs.h
-
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-
-
-fi
-	rm -Rf build
-
-
-        EXTRA_KCFLAGS="$tmp_flags"
-
- ;;
-		user)      ;;
-		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:${as_lineno-$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
-			kernelsrc="Not found"
-		fi
-	else
-		if test "$kernelsrc" = "NONE"; then
-			kernsrcver=NONE
-		fi
-		withlinux=yes
-	fi
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
-$as_echo "$kernelsrc" >&6; }
-	if test ! -d "$kernelsrc"; then
-		as_fn_error $? "
-	*** Please make sure the kernel devel package for your distribution
-	*** is installed and then try again.  If that fails, you can specify the
-	*** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
-	fi
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
-$as_echo_n "checking kernel build directory... " >&6; }
-	if test -z "$kernelbuild"; then
-		if test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"; then
-			kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
-		elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
-			kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
-		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:${as_lineno-$LINENO}: result: $kernelbuild" >&5
-$as_echo "$kernelbuild" >&6; }
-
-	{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: Not found" >&5
-$as_echo "Not found" >&6; }
-			as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
-		fi
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
-$as_echo "Not found" >&6; }
-		if test "x$enable_linux_builtin" != xyes; then
-			as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
-		else
-			as_fn_error $? "
-	*** Cannot find UTS_RELEASE definition.
-	*** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
-		fi
-	fi
-
-	{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
-$as_echo_n "checking kernel file name for module symbols... " >&6; }
-	if test "x$enable_linux_builtin" != xyes -a -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_fn_error $? "
-	*** Please make sure the kernel devel package for your distribution
-	*** is installed.  If you are 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." "$LINENO" 5
-		fi
-	else
-		LINUX_SYMBOLS=NONE
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
-$as_echo "$LINUX_SYMBOLS" >&6; }
-
-
-
-
-	if test "${LINUX_OBJ}" != "${LINUX}"; then
-		KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
-	fi
-
-
-	KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
-$as_echo_n "checking whether debugging is enabled... " >&6; }
-	# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
-  enableval=$enable_debug;
-else
-  enable_debug=no
-fi
-
-
-	if test "x$enable_debug" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
-		DEBUG_CFLAGS="-DDEBUG -Werror"
-		DEBUG_SPL="_with_debug"
-
-else
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
-		DEBUG_CFLAGS="-DNDEBUG"
-		DEBUG_SPL="_without_debug"
-
-fi
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
-$as_echo "$enable_debug" >&6; }
-
-
-	# Check whether --enable-debug-kmem was given.
-if test "${enable_debug_kmem+set}" = set; then :
-  enableval=$enable_debug_kmem;
-else
-  enable_debug_kmem=no
-fi
-
-
-	if test "x$enable_debug_kmem" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
-		DEBUG_KMEM="_with_debug_kmem"
-
-$as_echo "#define DEBUG_KMEM 1" >>confdefs.h
-
-
-else
-
-		DEBUG_KMEM="_without_debug_kmem"
-
-fi
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether basic kmem accounting is enabled" >&5
-$as_echo_n "checking whether basic kmem accounting is enabled... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem" >&5
-$as_echo "$enable_debug_kmem" >&6; }
-
-
-	# Check whether --enable-debug-kmem-tracking was given.
-if test "${enable_debug_kmem_tracking+set}" = set; then :
-  enableval=$enable_debug_kmem_tracking;
-else
-  enable_debug_kmem_tracking=no
-fi
-
-
-	if test "x$enable_debug_kmem_tracking" = xyes; then :
-
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
-		DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
-
-$as_echo "#define DEBUG_KMEM_TRACKING 1" >>confdefs.h
-
-
-else
-
-		DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
-
-fi
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether detailed kmem tracking is enabled" >&5
-$as_echo_n "checking whether detailed kmem tracking is enabled... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem_tracking" >&5
-$as_echo "$enable_debug_kmem_tracking" >&6; }
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
-$as_echo_n "checking whether modules can be built... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-int
-main (void)
-{
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		if test "x$enable_linux_builtin" != xyes; then
-			as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
-		else
-			as_fn_error $? "
-	*** Unable to build an empty module.
-	*** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
-		fi
-
-
-
-fi
-	rm -Rf build
-
-
-
-	if test "x$cross_compiling" != xyes; then :
-
-		if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-				#include "$LINUX/include/linux/license.h"
-
-int
-main ()
-{
-
-				return !license_is_gpl_compatible(
-				    "$SPL_META_LICENSE");
-
-  ;
-  return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-
-$as_echo "#define SPL_IS_GPL_COMPATIBLE 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-
-
-	# Check whether --enable-atomic-spinlocks was given.
-if test "${enable_atomic_spinlocks+set}" = set; then :
-  enableval=$enable_atomic_spinlocks;
-else
-  enable_atomic_spinlocks=check
-fi
-
-
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-		#include <linux/fs.h>
-
-int
-main (void)
-{
-
-		atomic64_t *ptr __attribute__ ((unused));
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-		have_atomic64_t=yes
-
-$as_echo "#define HAVE_ATOMIC64_T 1" >>confdefs.h
-
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-		have_atomic64_t=no
-
-
-
-fi
-	rm -Rf build
-
-
-
-	if test "x$enable_atomic_spinlocks" = xcheck; then :
-
-		if test "x$have_atomic64_t" = xyes; then :
-
-			enable_atomic_spinlocks=no
-
-else
-
-			enable_atomic_spinlocks=yes
-
-fi
-
-fi
-
-	if test "x$enable_atomic_spinlocks" = xyes; then :
-
-
-$as_echo "#define ATOMIC_SPINLOCK 1" >>confdefs.h
-
-
-else
-
-		if test "x$have_atomic64_t" = xno; then :
-
-			{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "--disable-atomic-spinlocks given but required atomic64 support is unavailable
-See \`config.log' for more details" "$LINENO" 5; }
-
-fi
-
-fi
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic types use spinlocks" >&5
-$as_echo_n "checking whether atomic types use spinlocks... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_spinlocks" >&5
-$as_echo "$enable_atomic_spinlocks" >&6; }
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines atomic64_t" >&5
-$as_echo_n "checking whether kernel defines atomic64_t... " >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_atomic64_t" >&5
-$as_echo "$have_atomic64_t" >&6; }
-
-
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-					{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 2-argument shrinker exists" >&5
-$as_echo_n "checking whether old 2-argument shrinker exists... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-		#include <linux/mm.h>
-
-		int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
-
-int
-main (void)
-{
-
-		struct shrinker cache_shrinker = {
-			.shrink = shrinker_cb,
-			.seeks = DEFAULT_SEEKS,
-		};
-		register_shrinker(&cache_shrinker);
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_2ARGS_OLD_SHRINKER_CALLBACK 1" >>confdefs.h
-
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-												{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 3-argument shrinker exists" >&5
-$as_echo_n "checking whether old 3-argument shrinker exists... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-			#include <linux/mm.h>
-
-			int shrinker_cb(struct shrinker *, int nr_to_scan,
-					gfp_t gfp_mask);
-
-int
-main (void)
-{
-
-			struct shrinker cache_shrinker = {
-				.shrink = shrinker_cb,
-				.seeks = DEFAULT_SEEKS,
-			};
-			register_shrinker(&cache_shrinker);
-
-  ;
-  return 0;
-}
-
-_ACEOF
+$as_echo "#define SPL_IS_GPL_COMPATIBLE 1" >>confdefs.h
 
 
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_3ARGS_SHRINKER_CALLBACK 1" >>confdefs.h
+fi
 
 
+	# Check whether --enable-atomic-spinlocks was given.
+if test "${enable_atomic_spinlocks+set}" = set; then :
+  enableval=$enable_atomic_spinlocks;
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-																		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether new 2-argument shrinker exists" >&5
-$as_echo_n "checking whether new 2-argument shrinker exists... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-				#include <linux/mm.h>
-
-				int shrinker_cb(struct shrinker *,
-						struct shrink_control *sc);
-
-int
-main (void)
-{
-
-				struct shrinker cache_shrinker = {
-					.shrink = shrinker_cb,
-					.seeks = DEFAULT_SEEKS,
-				};
-				register_shrinker(&cache_shrinker);
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_2ARGS_NEW_SHRINKER_CALLBACK 1" >>confdefs.h
-
+  enable_atomic_spinlocks=check
+fi
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-																								{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ->count_objects callback exists" >&5
-$as_echo_n "checking whether ->count_objects callback exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-					#include <linux/mm.h>
-
-					unsigned long shrinker_cb(
-						struct shrinker *,
-						struct shrink_control *sc);
+		#include <linux/fs.h>
 
 int
 main (void)
 {
 
-					struct shrinker cache_shrinker = {
-						.count_objects = shrinker_cb,
-						.scan_objects = shrinker_cb,
-						.seeks = DEFAULT_SEEKS,
-					};
-					register_shrinker(&cache_shrinker);
+		atomic64_t *ptr __attribute__ ((unused));
 
   ;
   return 0;
@@ -16384,17 +15736,16 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-					{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+		have_atomic64_t=yes
 
-$as_echo "#define HAVE_SPLIT_SHRINKER_CALLBACK 1" >>confdefs.h
+$as_echo "#define HAVE_ATOMIC64_T 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-					as_fn_error $? "error" "$LINENO" 5
+		have_atomic64_t=no
 
 
 
@@ -16403,104 +15754,73 @@  fi
 
 
 
+	if test "x$enable_atomic_spinlocks" = xcheck; then :
 
+		if test "x$have_atomic64_t" = xyes; then :
 
-fi
-	rm -Rf build
-
-
+			enable_atomic_spinlocks=no
 
+else
 
+			enable_atomic_spinlocks=yes
 
 fi
-	rm -Rf build
-
-
-
-
 
 fi
-	rm -Rf build
-
-
-	EXTRA_KCFLAGS="$tmp_flags"
-
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct ctl_table has ctl_name" >&5
-$as_echo_n "checking whether struct ctl_table has ctl_name... " >&6; }
-
-
-cat confdefs.h - <<_ACEOF >conftest.c
-
-
-		#include <linux/sysctl.h>
-
-int
-main (void)
-{
-
-		struct ctl_table ctl __attribute__ ((unused));
-		ctl.ctl_name = 0;
-
-  ;
-  return 0;
-}
-
-_ACEOF
-
-
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
+	if test "x$enable_atomic_spinlocks" = xyes; then :
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_CTL_NAME 1" >>confdefs.h
+$as_echo "#define ATOMIC_SPINLOCK 1" >>confdefs.h
 
 
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+		if test "x$have_atomic64_t" = xno; then :
 
+			{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "--disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details" "$LINENO" 5; }
 
+fi
 
 fi
-	rm -Rf build
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic types use spinlocks" >&5
+$as_echo_n "checking whether atomic types use spinlocks... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_spinlocks" >&5
+$as_echo "$enable_atomic_spinlocks" >&6; }
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines atomic64_t" >&5
+$as_echo_n "checking whether kernel defines atomic64_t... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_atomic64_t" >&5
+$as_echo "$have_atomic64_t" >&6; }
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_TRIM_UNUSED_KSYM is disabled" >&5
-$as_echo_n "checking whether CONFIG_TRIM_UNUSED_KSYM is disabled... " >&6; }
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+					{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 2-argument shrinker exists" >&5
+$as_echo_n "checking whether old 2-argument shrinker exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#if defined(CONFIG_TRIM_UNUSED_KSYMS)
-		#error CONFIG_TRIM_UNUSED_KSYMS not defined
-		#endif
+		#include <linux/mm.h>
+
+		int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
 
 int
 main (void)
 {
 
+		struct shrinker cache_shrinker = {
+			.shrink = shrinker_cb,
+			.seeks = DEFAULT_SEEKS,
+		};
+		register_shrinker(&cache_shrinker);
+
   ;
   return 0;
 }
@@ -16527,39 +15847,36 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		as_fn_error $? "
-	*** This kernel has unused symbols trimming enabled, please disable.
-	*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set." "$LINENO" 5
-
-
-
-fi
-	rm -Rf build
-
-
+$as_echo "#define HAVE_2ARGS_OLD_SHRINKER_CALLBACK 1" >>confdefs.h
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PDE_DATA() is available" >&5
-$as_echo_n "checking whether PDE_DATA() is available... " >&6; }
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+												{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 3-argument shrinker exists" >&5
+$as_echo_n "checking whether old 3-argument shrinker exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/proc_fs.h>
+			#include <linux/mm.h>
+
+			int shrinker_cb(struct shrinker *, int nr_to_scan,
+					gfp_t gfp_mask);
 
 int
 main (void)
 {
 
-		PDE_DATA(NULL);
+			struct shrinker cache_shrinker = {
+				.shrink = shrinker_cb,
+				.seeks = DEFAULT_SEEKS,
+			};
+			register_shrinker(&cache_shrinker);
 
   ;
   return 0;
@@ -16583,87 +15900,40 @@  _ACEOF
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
-  rc=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- rc=1
-
-
-fi
-	rm -Rf build
-
-
-	if test $rc -ne 0; then :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-	else
-		if test "x$enable_linux_builtin" != xyes; then
-
-	grep -q -E '[[:space:]]PDE_DATA[[:space:]]' \
-		$LINUX_OBJ/Module*.symvers 2>/dev/null
-	rc=$?
-	if test $rc -ne 0; then
-		export=0
-		for file in ; do
-			grep -q -E "EXPORT_SYMBOL.*(PDE_DATA)" \
-				"$LINUX_OBJ/$file" 2>/dev/null
-			rc=$?
-			if test $rc -eq 0; then
-				export=1
-				break;
-			fi
-		done
-		if test $export -eq 0; then :
-			rc=1
-		else :
-			rc=0
-		fi
-	else :
-		rc=0
-	fi
-
-		fi
-		if test $rc -ne 0; then :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 
-		else :
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_PDE_DATA 1" >>confdefs.h
-
+$as_echo "#define HAVE_3ARGS_SHRINKER_CALLBACK 1" >>confdefs.h
 
-		fi
-	fi
 
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-	tmp_flags="$EXTRA_KCFLAGS"
-	EXTRA_KCFLAGS="-Werror"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_fs_pwd() requires const struct path *" >&5
-$as_echo_n "checking whether set_fs_pwd() requires const struct path *... " >&6; }
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+																		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether new 2-argument shrinker exists" >&5
+$as_echo_n "checking whether new 2-argument shrinker exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/spinlock.h>
-		#include <linux/fs_struct.h>
-		#include <linux/path.h>
-		void (*const set_fs_pwd_func)
-			(struct fs_struct *, const struct path *)
-			= set_fs_pwd;
+				#include <linux/mm.h>
+
+				int shrinker_cb(struct shrinker *,
+						struct shrink_control *sc);
 
 int
 main (void)
 {
 
-		return 0;
+				struct shrinker cache_shrinker = {
+					.shrink = shrinker_cb,
+					.seeks = DEFAULT_SEEKS,
+				};
+				register_shrinker(&cache_shrinker);
 
   ;
   return 0;
@@ -16688,33 +15958,41 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_SET_FS_PWD_WITH_CONST 1" >>confdefs.h
+$as_echo "#define HAVE_2ARGS_NEW_SHRINKER_CALLBACK 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+																								{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ->count_objects callback exists" >&5
+$as_echo_n "checking whether ->count_objects callback exists... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/spinlock.h>
-			#include <linux/fs_struct.h>
-			#include <linux/path.h>
-			void (*const set_fs_pwd_func)
-				(struct fs_struct *, struct path *)
-				= set_fs_pwd;
+					#include <linux/mm.h>
+
+					unsigned long shrinker_cb(
+						struct shrinker *,
+						struct shrink_control *sc);
 
 int
 main (void)
 {
 
-			return 0;
+					struct shrinker cache_shrinker = {
+						.count_objects = shrinker_cb,
+						.scan_objects = shrinker_cb,
+						.seeks = DEFAULT_SEEKS,
+					};
+					register_shrinker(&cache_shrinker);
 
   ;
   return 0;
@@ -16739,14 +16017,31 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+					{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SPLIT_SHRINKER_CALLBACK 1" >>confdefs.h
+
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-			as_fn_error $? "unknown" "$LINENO" 5
+					as_fn_error $? "error" "$LINENO" 5
+
+
+
+fi
+	rm -Rf build
+
+
+
+
+
+fi
+	rm -Rf build
+
+
 
 
 
@@ -16763,20 +16058,22 @@  fi
 
 	EXTRA_KCFLAGS="$tmp_flags"
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 2 args" >&5
-$as_echo_n "checking whether vfs_unlink() wants 2 args... " >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct ctl_table has ctl_name" >&5
+$as_echo_n "checking whether struct ctl_table has ctl_name... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/sysctl.h>
 
 int
 main (void)
 {
 
-		vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
+		struct ctl_table ctl __attribute__ ((unused));
+		ctl.ctl_name = 0;
 
   ;
   return 0;
@@ -16804,7 +16101,7 @@  _ACEOF
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_2ARGS_VFS_UNLINK 1" >>confdefs.h
+$as_echo "#define HAVE_CTL_NAME 1" >>confdefs.h
 
 
 else
@@ -16813,23 +16110,30 @@  sed 's/^/| /' conftest.$ac_ext >&5
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-										{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 3 args" >&5
-$as_echo_n "checking whether vfs_unlink() wants 3 args... " >&6; }
+
+
+
+fi
+	rm -Rf build
+
+
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_TRIM_UNUSED_KSYM is disabled" >&5
+$as_echo_n "checking whether CONFIG_TRIM_UNUSED_KSYM is disabled... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/fs.h>
+		#if defined(CONFIG_TRIM_UNUSED_KSYMS)
+		#error CONFIG_TRIM_UNUSED_KSYMS not defined
+		#endif
 
 int
 main (void)
 {
 
-			vfs_unlink((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
-
   ;
   return 0;
 }
@@ -16853,17 +16157,18 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_3ARGS_VFS_UNLINK 1" >>confdefs.h
-
-
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-			as_fn_error $? "no" "$LINENO" 5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		as_fn_error $? "
+	*** This kernel has unused symbols trimming enabled, please disable.
+	*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set." "$LINENO" 5
 
 
 
@@ -16873,82 +16178,125 @@  fi
 
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PDE_DATA() is available" >&5
+$as_echo_n "checking whether PDE_DATA() is available... " >&6; }
 
 
-fi
-	rm -Rf build
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 4 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 4 args... " >&6; }
-
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-		#include <linux/fs.h>
+		#include <linux/proc_fs.h>
 
 int
 main (void)
 {
 
-		vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
-			(struct inode *) NULL, (struct dentry *) NULL);
+		PDE_DATA(NULL);
 
   ;
   return 0;
 }
 
-_ACEOF
+_ACEOF
+
+
+	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+	echo "obj-m := conftest.o" >build/Makefile
+	modpost_flag=''
+	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+	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 $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+	rm -Rf build
+
+
+	if test $rc -ne 0; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+	else
+		if test "x$enable_linux_builtin" != xyes; then
+
+	grep -q -E '[[:space:]]PDE_DATA[[:space:]]' \
+		$LINUX_OBJ/Module*.symvers 2>/dev/null
+	rc=$?
+	if test $rc -ne 0; then
+		export=0
+		for file in ; do
+			grep -q -E "EXPORT_SYMBOL.*(PDE_DATA)" \
+				"$LINUX_OBJ/$file" 2>/dev/null
+			rc=$?
+			if test $rc -eq 0; then
+				export=1
+				break;
+			fi
+		done
+		if test $export -eq 0; then :
+			rc=1
+		else :
+			rc=0
+		fi
+	else :
+		rc=0
+	fi
+
+		fi
+		if test $rc -ne 0; then :
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
-	echo "obj-m := conftest.o" >build/Makefile
-	modpost_flag=''
-	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
-	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 $modpost_flag'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
+		else :
 
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_4ARGS_VFS_RENAME 1" >>confdefs.h
+$as_echo "#define HAVE_PDE_DATA 1" >>confdefs.h
 
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+		fi
+	fi
 
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-										{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 5 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 5 args... " >&6; }
+
+	tmp_flags="$EXTRA_KCFLAGS"
+	EXTRA_KCFLAGS="-Werror"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_fs_pwd() requires const struct path *" >&5
+$as_echo_n "checking whether set_fs_pwd() requires const struct path *... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-			#include <linux/fs.h>
+		#include <linux/spinlock.h>
+		#include <linux/fs_struct.h>
+		#include <linux/path.h>
+		void (*const set_fs_pwd_func)
+			(struct fs_struct *, const struct path *)
+			= set_fs_pwd;
 
 int
 main (void)
 {
 
-			vfs_rename((struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode *) NULL,
-				(struct dentry *) NULL,
-				(struct inode **) NULL);
+		return 0;
 
   ;
   return 0;
@@ -16973,37 +16321,33 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_5ARGS_VFS_RENAME 1" >>confdefs.h
+$as_echo "#define HAVE_SET_FS_PWD_WITH_CONST 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-															{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 6 args" >&5
-$as_echo_n "checking whether vfs_rename() wants 6 args... " >&6; }
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-				#include <linux/fs.h>
+			#include <linux/spinlock.h>
+			#include <linux/fs_struct.h>
+			#include <linux/path.h>
+			void (*const set_fs_pwd_func)
+				(struct fs_struct *, struct path *)
+				= set_fs_pwd;
 
 int
 main (void)
 {
 
-				vfs_rename((struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode *) NULL,
-					(struct dentry *) NULL,
-					(struct inode **) NULL,
-					(unsigned int) 0);
+			return 0;
 
   ;
   return 0;
@@ -17028,24 +16372,14 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_6ARGS_VFS_RENAME 1" >>confdefs.h
-
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-				as_fn_error $? "no" "$LINENO" 5
-
-
-
-fi
-	rm -Rf build
-
-
+			as_fn_error $? "unknown" "$LINENO" 5
 
 
 
@@ -17060,6 +16394,7 @@  fi
 	rm -Rf build
 
 
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_fsync() wants 2 args" >&5
@@ -18847,6 +18182,105 @@  fi
 
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether io_schedule_timeout() is available" >&5
+$as_echo_n "checking whether io_schedule_timeout() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+		#include <linux/sched.h>
+
+int
+main (void)
+{
+
+		(void) io_schedule_timeout(1);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+	rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+	echo "obj-m := conftest.o" >build/Makefile
+	modpost_flag=''
+	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+	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 $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+	rm -Rf build
+
+
+	if test $rc -ne 0; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+	else
+		if test "x$enable_linux_builtin" != xyes; then
+
+	grep -q -E '[[:space:]]io_schedule_timeout[[:space:]]' \
+		$LINUX_OBJ/Module*.symvers 2>/dev/null
+	rc=$?
+	if test $rc -ne 0; then
+		export=0
+		for file in ; do
+			grep -q -E "EXPORT_SYMBOL.*(io_schedule_timeout)" \
+				"$LINUX_OBJ/$file" 2>/dev/null
+			rc=$?
+			if test $rc -eq 0; then
+				export=1
+				break;
+			fi
+		done
+		if test $export -eq 0; then :
+			rc=1
+		else :
+			rc=0
+		fi
+	else :
+		rc=0
+	fi
+
+		fi
+		if test $rc -ne 0; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+		else :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_IO_SCHEDULE_TIMEOUT 1" >>confdefs.h
+
+
+		fi
+	fi
+
+
+
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel_write() takes loff_t pointer" >&5
 $as_echo_n "checking whether kernel_write() takes loff_t pointer... " >&6; }
 	tmp_flags="$EXTRA_KCFLAGS"
@@ -18983,23 +18417,28 @@  fi
 	EXTRA_KCFLAGS="$tmp_flags"
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether timer_setup() exists" >&5
-$as_echo_n "checking whether timer_setup() exists... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether timer_list.function gets a timer_list" >&5
+$as_echo_n "checking whether timer_list.function gets a timer_list... " >&6; }
 	tmp_flags="$EXTRA_KCFLAGS"
-        EXTRA_KCFLAGS="-Werror"
+	EXTRA_KCFLAGS="-Werror"
 
 
 cat confdefs.h - <<_ACEOF >conftest.c
 
 
-                #include <linux/timer.h>
+		#include <linux/timer.h>
+		void task_expire(struct timer_list *tl) {}
 
 int
 main (void)
 {
 
-		struct timer_list timer;
+		#ifndef from_timer
+		#error "No from_timer() macro"
+		#endif
 
+		struct timer_list timer;
+		timer.function = task_expire;
 		timer_setup(&timer, NULL, 0);
 
   ;
@@ -19025,17 +18464,17 @@  _ACEOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then :
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_KERNEL_TIMER_SETUP 1" >>confdefs.h
+$as_echo "#define HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST 1" >>confdefs.h
 
 
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 
@@ -19044,7 +18483,7 @@  fi
 	rm -Rf build
 
 
-        EXTRA_KCFLAGS="$tmp_flags"
+	EXTRA_KCFLAGS="$tmp_flags"
 
 
 		           ;;
@@ -19075,7 +18514,95 @@  fi
 
 
 
-ac_config_files="$ac_config_files Makefile man/Makefile man/man1/Makefile man/man5/Makefile lib/Makefile cmd/Makefile cmd/splat/Makefile cmd/splslab/Makefile module/Makefile module/spl/Makefile module/splat/Makefile include/Makefile include/fs/Makefile include/linux/Makefile include/rpc/Makefile include/sharefs/Makefile include/sys/Makefile include/sys/fm/Makefile include/sys/fs/Makefile include/sys/sysevent/Makefile include/util/Makefile include/vm/Makefile scripts/Makefile rpm/Makefile rpm/redhat/Makefile rpm/redhat/spl.spec rpm/redhat/spl-kmod.spec rpm/redhat/spl-dkms.spec rpm/generic/Makefile rpm/generic/spl.spec rpm/generic/spl-kmod.spec rpm/generic/spl-dkms.spec spl.release"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
+$as_echo_n "checking whether debugging is enabled... " >&6; }
+	# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
+else
+  enable_debug=no
+fi
+
+
+	if test "x$enable_debug" = xyes; then :
+
+		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
+		DEBUG_CFLAGS="-DDEBUG -Werror"
+		DEBUG_SPL="_with_debug"
+
+else
+
+		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
+		DEBUG_CFLAGS="-DNDEBUG"
+		DEBUG_SPL="_without_debug"
+
+fi
+
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
+$as_echo "$enable_debug" >&6; }
+
+
+	# Check whether --enable-debug-kmem was given.
+if test "${enable_debug_kmem+set}" = set; then :
+  enableval=$enable_debug_kmem;
+else
+  enable_debug_kmem=no
+fi
+
+
+	if test "x$enable_debug_kmem" = xyes; then :
+
+		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
+		DEBUG_KMEM="_with_debug_kmem"
+
+$as_echo "#define DEBUG_KMEM 1" >>confdefs.h
+
+
+else
+
+		DEBUG_KMEM="_without_debug_kmem"
+
+fi
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether basic kmem accounting is enabled" >&5
+$as_echo_n "checking whether basic kmem accounting is enabled... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem" >&5
+$as_echo "$enable_debug_kmem" >&6; }
+
+
+	# Check whether --enable-debug-kmem-tracking was given.
+if test "${enable_debug_kmem_tracking+set}" = set; then :
+  enableval=$enable_debug_kmem_tracking;
+else
+  enable_debug_kmem_tracking=no
+fi
+
+
+	if test "x$enable_debug_kmem_tracking" = xyes; then :
+
+		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
+		DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
+
+$as_echo "#define DEBUG_KMEM_TRACKING 1" >>confdefs.h
+
+
+else
+
+		DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
+
+fi
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether detailed kmem tracking is enabled" >&5
+$as_echo_n "checking whether detailed kmem tracking is enabled... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem_tracking" >&5
+$as_echo "$enable_debug_kmem_tracking" >&6; }
+
+
+ac_config_files="$ac_config_files Makefile man/Makefile man/man1/Makefile man/man5/Makefile lib/Makefile cmd/Makefile cmd/splat/Makefile cmd/splslab/Makefile module/Makefile module/spl/Makefile module/splat/Makefile include/Makefile include/fs/Makefile include/linux/Makefile include/rpc/Makefile include/sharefs/Makefile include/sys/Makefile include/sys/fm/Makefile include/sys/fs/Makefile include/util/Makefile include/vm/Makefile scripts/Makefile rpm/Makefile rpm/redhat/Makefile rpm/redhat/spl.spec rpm/redhat/spl-kmod.spec rpm/redhat/spl-dkms.spec rpm/generic/Makefile rpm/generic/spl.spec rpm/generic/spl-kmod.spec rpm/generic/spl-dkms.spec spl.release"
 
 
 cat >confcache <<\_ACEOF
@@ -19620,7 +19147,7 @@  cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by spl $as_me 0.7.5, which was
+This file was extended by spl $as_me 0.7.9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19686,7 +19213,7 @@  _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-spl config.status 0.7.5
+spl config.status 0.7.9
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -20120,7 +19647,6 @@  do
     "include/sys/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/Makefile" ;;
     "include/sys/fm/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fm/Makefile" ;;
     "include/sys/fs/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fs/Makefile" ;;
-    "include/sys/sysevent/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/sysevent/Makefile" ;;
     "include/util/Makefile") CONFIG_FILES="$CONFIG_FILES include/util/Makefile" ;;
     "include/vm/Makefile") CONFIG_FILES="$CONFIG_FILES include/vm/Makefile" ;;
     "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
diff --git a/spl/configure.ac b/spl/configure.ac
index 70735ce..ab53879 100644
--- a/spl/configure.ac
+++ b/spl/configure.ac
@@ -46,6 +46,9 @@  AC_PROG_LIBTOOL
 SPL_AC_LICENSE
 SPL_AC_PACKAGE
 SPL_AC_CONFIG
+SPL_AC_DEBUG
+SPL_AC_DEBUG_KMEM
+SPL_AC_DEBUG_KMEM_TRACKING
 
 AC_CONFIG_FILES([
 	Makefile
@@ -67,7 +70,6 @@  AC_CONFIG_FILES([
 	include/sys/Makefile
 	include/sys/fm/Makefile
 	include/sys/fs/Makefile
-	include/sys/sysevent/Makefile
 	include/util/Makefile
 	include/vm/Makefile
 	scripts/Makefile
diff --git a/spl/dkms.conf b/spl/dkms.conf
index bb94065..88a2a27 100644
--- a/spl/dkms.conf
+++ b/spl/dkms.conf
@@ -1,6 +1,6 @@ 
 AUTOINSTALL="yes"
 PACKAGE_NAME="spl"
-PACKAGE_VERSION="0.7.5"
+PACKAGE_VERSION="0.7.9"
 PRE_BUILD="configure
   --prefix=/usr
   --with-config=kernel
diff --git a/spl/include/Makefile.in b/spl/include/Makefile.in
index c9319cb..241e3bb 100644
--- a/spl/include/Makefile.in
+++ b/spl/include/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/fs/Makefile.in b/spl/include/fs/Makefile.in
index cdfd165..9d02154 100644
--- a/spl/include/fs/Makefile.in
+++ b/spl/include/fs/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/fs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/fs/fs_subr.h b/spl/include/fs/fs_subr.h
index 33ccc68..881a4cd 100644
--- a/spl/include/fs/fs_subr.h
+++ b/spl/include/fs/fs_subr.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_FS_FS_SUBR_H
-#define _SPL_FS_FS_SUBR_H
+#define	_SPL_FS_FS_SUBR_H
 
 #endif /* SPL_FS_FS_SUBR_H */
diff --git a/spl/include/linux/Makefile.in b/spl/include/linux/Makefile.in
index e3bad5e..c74fa64 100644
--- a/spl/include/linux/Makefile.in
+++ b/spl/include/linux/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/linux
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/linux/math64_compat.h b/spl/include/linux/math64_compat.h
index 2c911a6..173b380 100644
--- a/spl/include/linux/math64_compat.h
+++ b/spl/include/linux/math64_compat.h
@@ -26,7 +26,8 @@ 
 #define _SPL_MATH64_COMPAT_H
 
 #ifndef abs64
-#define abs64(x)	({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
+/* CSTYLED */
+#define	abs64(x)	({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
 #endif
 
 #endif /* _SPL_MATH64_COMPAT_H */
diff --git a/spl/include/rpc/Makefile.in b/spl/include/rpc/Makefile.in
index 3e95825..1ebea41 100644
--- a/spl/include/rpc/Makefile.in
+++ b/spl/include/rpc/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/rpc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/rpc/types.h b/spl/include/rpc/types.h
index b57b4bd..915ace5 100644
--- a/spl/include/rpc/types.h
+++ b/spl/include/rpc/types.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_RPC_TYPES_H
-#define _SPL_RPC_TYPES_H
+#define	_SPL_RPC_TYPES_H
 
 typedef int bool_t;
 
diff --git a/spl/include/rpc/xdr.h b/spl/include/rpc/xdr.h
index d0f06b5..dc46f51 100644
--- a/spl/include/rpc/xdr.h
+++ b/spl/include/rpc/xdr.h
@@ -20,7 +20,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_RPC_XDR_H
-#define _SPL_RPC_XDR_H
+#define	_SPL_RPC_XDR_H
 
 #include <sys/types.h>
 #include <rpc/types.h>
@@ -36,11 +36,10 @@  enum xdr_op {
 struct xdr_ops;
 
 typedef struct {
-	struct xdr_ops *x_ops;      /* Also used to let caller know if
-	                               xdrmem_create() succeeds (sigh..) */
-	caddr_t         x_addr;     /* Current buffer addr */
-	caddr_t         x_addr_end; /* End of the buffer */
-	enum xdr_op     x_op;       /* Stream direction */
+	struct xdr_ops	*x_ops;	/* Let caller know xdrmem_create() succeeds */
+	caddr_t		x_addr;	/* Current buffer addr */
+	caddr_t		x_addr_end;	/* End of the buffer */
+	enum xdr_op	x_op;	/* Stream direction */
 } XDR;
 
 typedef bool_t (*xdrproc_t)(XDR *xdrs, void *ptr);
@@ -56,13 +55,13 @@  struct xdr_ops {
 	bool_t (*xdr_opaque)(XDR *, caddr_t, const uint_t);
 	bool_t (*xdr_string)(XDR *, char **, const uint_t);
 	bool_t (*xdr_array)(XDR *, caddr_t *, uint_t *, const uint_t,
-	                    const uint_t, const xdrproc_t);
+	    const uint_t, const xdrproc_t);
 };
 
 /*
  * XDR control operator.
  */
-#define XDR_GET_BYTES_AVAIL 1
+#define	XDR_GET_BYTES_AVAIL 1
 
 struct xdr_bytesrec {
 	bool_t xc_is_last_record;
@@ -74,11 +73,12 @@  struct xdr_bytesrec {
  */
 void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size,
     const enum xdr_op op);
-#define xdr_destroy(xdrs) ((void) 0) /* Currently not needed. If needed later,
-                                        we'll add it to struct xdr_ops */
 
-#define xdr_control(xdrs, req, info) (xdrs)->x_ops->xdr_control((xdrs),        \
-                                         (req), (info))
+/* Currently not needed. If needed later, we'll add it to struct xdr_ops */
+#define	xdr_destroy(xdrs) ((void) 0)
+
+#define	xdr_control(xdrs, req, info) \
+	(xdrs)->x_ops->xdr_control((xdrs), (req), (info))
 
 /*
  * For precaution, the following are defined as static inlines instead of macros
@@ -89,40 +89,40 @@  void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size,
  */
 static inline bool_t xdr_char(XDR *xdrs, char *cp)
 {
-	return xdrs->x_ops->xdr_char(xdrs, cp);
+	return (xdrs->x_ops->xdr_char(xdrs, cp));
 }
 
 static inline bool_t xdr_u_short(XDR *xdrs, unsigned short *usp)
 {
-	return xdrs->x_ops->xdr_u_short(xdrs, usp);
+	return (xdrs->x_ops->xdr_u_short(xdrs, usp));
 }
 
 static inline bool_t xdr_short(XDR *xdrs, short *sp)
 {
-	BUILD_BUG_ON(sizeof(short) != 2);
-	return xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp);
+	BUILD_BUG_ON(sizeof (short) != 2);
+	return (xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp));
 }
 
 static inline bool_t xdr_u_int(XDR *xdrs, unsigned *up)
 {
-	return xdrs->x_ops->xdr_u_int(xdrs, up);
+	return (xdrs->x_ops->xdr_u_int(xdrs, up));
 }
 
 static inline bool_t xdr_int(XDR *xdrs, int *ip)
 {
-	BUILD_BUG_ON(sizeof(int) != 4);
-	return xdrs->x_ops->xdr_u_int(xdrs, (unsigned *) ip);
+	BUILD_BUG_ON(sizeof (int) != 4);
+	return (xdrs->x_ops->xdr_u_int(xdrs, (unsigned *)ip));
 }
 
 static inline bool_t xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp)
 {
-	return xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp);
+	return (xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp));
 }
 
 static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp)
 {
-	BUILD_BUG_ON(sizeof(longlong_t) != 8);
-	return xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *) llp);
+	BUILD_BUG_ON(sizeof (longlong_t) != 8);
+	return (xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *)llp));
 }
 
 /*
@@ -130,7 +130,7 @@  static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp)
  */
 static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt)
 {
-	return xdrs->x_ops->xdr_opaque(xdrs, cp, cnt);
+	return (xdrs->x_ops->xdr_opaque(xdrs, cp, cnt));
 }
 
 /*
@@ -139,7 +139,7 @@  static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt)
  */
 static inline bool_t xdr_string(XDR *xdrs, char **sp, const uint_t maxsize)
 {
-	return xdrs->x_ops->xdr_string(xdrs, sp, maxsize);
+	return (xdrs->x_ops->xdr_string(xdrs, sp, maxsize));
 }
 
 /*
diff --git a/spl/include/sharefs/Makefile.in b/spl/include/sharefs/Makefile.in
index 40d1cb7..449c4db 100644
--- a/spl/include/sharefs/Makefile.in
+++ b/spl/include/sharefs/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/sharefs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/sharefs/share.h b/spl/include/sharefs/share.h
index fc248a2..13f0d9a 100644
--- a/spl/include/sharefs/share.h
+++ b/spl/include/sharefs/share.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SHARE_H
-#define _SPL_SHARE_H
+#define	_SPL_SHARE_H
 
 #endif /* SPL_SHARE_H */
diff --git a/spl/include/spl-ctl.h b/spl/include/spl-ctl.h
index bb24490..a31a0af 100644
--- a/spl/include/spl-ctl.h
+++ b/spl/include/spl-ctl.h
@@ -23,23 +23,23 @@ 
 \*****************************************************************************/
 
 #ifndef _DEBUG_CTL_H
-#define _DEBUG_CTL_H
+#define	_DEBUG_CTL_H
 
 /*
  * Contains shared definitions which both the user space
  * and kernel space portions of splat must agree on.
  */
 typedef struct spl_debug_header {
-        int ph_len;
-        int ph_flags;
-        int ph_subsys;
-        int ph_mask;
-        int ph_cpu_id;
-        int ph_sec;
-        long ph_usec;
-        int ph_stack;
-        int ph_pid;
-        int ph_line_num;
+	int ph_len;
+	int ph_flags;
+	int ph_subsys;
+	int ph_mask;
+	int ph_cpu_id;
+	int ph_sec;
+	long ph_usec;
+	int ph_stack;
+	int ph_pid;
+	int ph_line_num;
 } spl_debug_header_t;
 
 #endif /* _DEBUG_CTL_H */
diff --git a/spl/include/splat-ctl.h b/spl/include/splat-ctl.h
index 15fd01b..d049551 100644
--- a/spl/include/splat-ctl.h
+++ b/spl/include/splat-ctl.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPLAT_CTL_H
-#define _SPLAT_CTL_H
+#define	_SPLAT_CTL_H
 
 #include <linux/types.h>
 
@@ -32,11 +32,11 @@ 
  * ensure 32-bit/64-bit interoperability over ioctl()'s only types with
  * fixed sizes can be used.
  */
-#define SPLAT_NAME			"splatctl"
-#define SPLAT_DEV			"/dev/splatctl"
+#define	SPLAT_NAME			"splatctl"
+#define	SPLAT_DEV			"/dev/splatctl"
 
-#define SPLAT_NAME_SIZE			20
-#define SPLAT_DESC_SIZE			60
+#define	SPLAT_NAME_SIZE			20
+#define	SPLAT_DESC_SIZE			60
 
 typedef struct splat_user {
 	char name[SPLAT_NAME_SIZE];	/* Short name */
@@ -72,38 +72,38 @@  typedef struct splat_cmd {
 } splat_cmd_t;
 
 /* Valid ioctls */
-#define SPLAT_CFG			_IOWR('f', 101, splat_cfg_t)
-#define SPLAT_CMD			_IOWR('f', 102, splat_cmd_t)
+#define	SPLAT_CFG			_IOWR('f', 101, splat_cfg_t)
+#define	SPLAT_CMD			_IOWR('f', 102, splat_cmd_t)
 
 /* Valid configuration commands */
-#define SPLAT_CFG_BUFFER_CLEAR		0x001	/* Clear text buffer */
-#define SPLAT_CFG_BUFFER_SIZE		0x002	/* Resize text buffer */
-#define SPLAT_CFG_SUBSYSTEM_COUNT	0x101	/* Number of subsystem */
-#define SPLAT_CFG_SUBSYSTEM_LIST	0x102	/* List of N subsystems */
-#define SPLAT_CFG_TEST_COUNT		0x201	/* Number of tests */
-#define SPLAT_CFG_TEST_LIST		0x202	/* List of N tests */
+#define	SPLAT_CFG_BUFFER_CLEAR		0x001	/* Clear text buffer */
+#define	SPLAT_CFG_BUFFER_SIZE		0x002	/* Resize text buffer */
+#define	SPLAT_CFG_SUBSYSTEM_COUNT	0x101	/* Number of subsystem */
+#define	SPLAT_CFG_SUBSYSTEM_LIST	0x102	/* List of N subsystems */
+#define	SPLAT_CFG_TEST_COUNT		0x201	/* Number of tests */
+#define	SPLAT_CFG_TEST_LIST		0x202	/* List of N tests */
 
 /*
  * Valid subsystem and test commands are defined in each subsystem as
  * SPLAT_SUBSYSTEM_*.  We do need to be careful to avoid collisions, the
  * currently defined subsystems are as follows:
  */
-#define SPLAT_SUBSYSTEM_KMEM		0x0100
-#define SPLAT_SUBSYSTEM_TASKQ		0x0200
-#define SPLAT_SUBSYSTEM_KRNG		0x0300
-#define SPLAT_SUBSYSTEM_MUTEX		0x0400
-#define SPLAT_SUBSYSTEM_CONDVAR		0x0500
-#define SPLAT_SUBSYSTEM_THREAD		0x0600
-#define SPLAT_SUBSYSTEM_RWLOCK		0x0700
-#define SPLAT_SUBSYSTEM_TIME		0x0800
-#define SPLAT_SUBSYSTEM_VNODE		0x0900
-#define SPLAT_SUBSYSTEM_KOBJ		0x0a00
-#define SPLAT_SUBSYSTEM_ATOMIC		0x0b00
-#define SPLAT_SUBSYSTEM_LIST		0x0c00
-#define SPLAT_SUBSYSTEM_GENERIC		0x0d00
-#define SPLAT_SUBSYSTEM_CRED		0x0e00
-#define SPLAT_SUBSYSTEM_ZLIB		0x0f00
-#define SPLAT_SUBSYSTEM_LINUX		0x1000
-#define SPLAT_SUBSYSTEM_UNKNOWN		0xff00
+#define	SPLAT_SUBSYSTEM_KMEM		0x0100
+#define	SPLAT_SUBSYSTEM_TASKQ		0x0200
+#define	SPLAT_SUBSYSTEM_KRNG		0x0300
+#define	SPLAT_SUBSYSTEM_MUTEX		0x0400
+#define	SPLAT_SUBSYSTEM_CONDVAR		0x0500
+#define	SPLAT_SUBSYSTEM_THREAD		0x0600
+#define	SPLAT_SUBSYSTEM_RWLOCK		0x0700
+#define	SPLAT_SUBSYSTEM_TIME		0x0800
+#define	SPLAT_SUBSYSTEM_VNODE		0x0900
+#define	SPLAT_SUBSYSTEM_KOBJ		0x0a00
+#define	SPLAT_SUBSYSTEM_ATOMIC		0x0b00
+#define	SPLAT_SUBSYSTEM_LIST		0x0c00
+#define	SPLAT_SUBSYSTEM_GENERIC		0x0d00
+#define	SPLAT_SUBSYSTEM_CRED		0x0e00
+#define	SPLAT_SUBSYSTEM_ZLIB		0x0f00
+#define	SPLAT_SUBSYSTEM_LINUX		0x1000
+#define	SPLAT_SUBSYSTEM_UNKNOWN		0xff00
 
 #endif /* _SPLAT_CTL_H */
diff --git a/spl/include/strings.h b/spl/include/strings.h
index dc0f314..d0cf1e0 100644
--- a/spl/include/strings.h
+++ b/spl/include/strings.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_STRINGS_H
-#define _SPL_STRINGS_H
+#define	_SPL_STRINGS_H
 
 #endif /* SPL_STRINGS_H */
diff --git a/spl/include/sys/Makefile.am b/spl/include/sys/Makefile.am
index a16bd6c..45b6589 100644
--- a/spl/include/sys/Makefile.am
+++ b/spl/include/sys/Makefile.am
@@ -1,4 +1,4 @@ 
-SUBDIRS = fm fs sysevent
+SUBDIRS = fm fs
 
 COMMON_H =
 
@@ -77,7 +77,6 @@  KERNEL_H = \
 	$(top_srcdir)/include/sys/sunddi.h \
 	$(top_srcdir)/include/sys/sunldi.h \
 	$(top_srcdir)/include/sys/sysdc.h \
-	$(top_srcdir)/include/sys/sysevent.h \
 	$(top_srcdir)/include/sys/sysmacros.h \
 	$(top_srcdir)/include/sys/systeminfo.h \
 	$(top_srcdir)/include/sys/systm.h \
diff --git a/spl/include/sys/Makefile.in b/spl/include/sys/Makefile.in
index b908b22..674490e 100644
--- a/spl/include/sys/Makefile.in
+++ b/spl/include/sys/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/sys
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
@@ -207,7 +228,6 @@  am__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/acl.h \
 	$(top_srcdir)/include/sys/sunddi.h \
 	$(top_srcdir)/include/sys/sunldi.h \
 	$(top_srcdir)/include/sys/sysdc.h \
-	$(top_srcdir)/include/sys/sysevent.h \
 	$(top_srcdir)/include/sys/sysmacros.h \
 	$(top_srcdir)/include/sys/systeminfo.h \
 	$(top_srcdir)/include/sys/systm.h \
@@ -485,7 +505,7 @@  target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = fm fs sysevent
+SUBDIRS = fm fs
 COMMON_H = 
 KERNEL_H = \
 	$(top_srcdir)/include/sys/acl.h \
@@ -562,7 +582,6 @@  KERNEL_H = \
 	$(top_srcdir)/include/sys/sunddi.h \
 	$(top_srcdir)/include/sys/sunldi.h \
 	$(top_srcdir)/include/sys/sysdc.h \
-	$(top_srcdir)/include/sys/sysevent.h \
 	$(top_srcdir)/include/sys/sysmacros.h \
 	$(top_srcdir)/include/sys/systeminfo.h \
 	$(top_srcdir)/include/sys/systm.h \
diff --git a/spl/include/sys/acl.h b/spl/include/sys/acl.h
index f4a3de5..34f4508 100644
--- a/spl/include/sys/acl.h
+++ b/spl/include/sys/acl.h
@@ -23,95 +23,97 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ACL_H
-#define _SPL_ACL_H
+#define	_SPL_ACL_H
 
 #include <sys/types.h>
 
 typedef struct ace {
-        uid_t a_who;
-        uint32_t a_access_mask;
-        uint16_t a_flags;
-        uint16_t a_type;
+	uid_t a_who;
+	uint32_t a_access_mask;
+	uint16_t a_flags;
+	uint16_t a_type;
 } ace_t;
 
 typedef struct ace_object {
-        uid_t           a_who;          /* uid or gid */
-        uint32_t        a_access_mask;  /* read,write,... */
-        uint16_t        a_flags;        /* see below */
-        uint16_t        a_type;         /* allow or deny */
-        uint8_t         a_obj_type[16]; /* obj type */
-        uint8_t         a_inherit_obj_type[16];  /* inherit obj */
+	uid_t		a_who;		/* uid or gid */
+	uint32_t	a_access_mask;	/* read,write,... */
+	uint16_t	a_flags;	/* see below */
+	uint16_t	a_type;		/* allow or deny */
+	uint8_t		a_obj_type[16];	/* obj type */
+	uint8_t		a_inherit_obj_type[16];	/* inherit obj */
 } ace_object_t;
 
-#define MAX_ACL_ENTRIES					1024
+#define	MAX_ACL_ENTRIES					1024
 
-#define ACE_READ_DATA                                   0x00000001
-#define ACE_LIST_DIRECTORY                              0x00000001
-#define ACE_WRITE_DATA                                  0x00000002
-#define ACE_ADD_FILE                                    0x00000002
-#define ACE_APPEND_DATA                                 0x00000004
-#define ACE_ADD_SUBDIRECTORY                            0x00000004
-#define ACE_READ_NAMED_ATTRS                            0x00000008
-#define ACE_WRITE_NAMED_ATTRS                           0x00000010
-#define ACE_EXECUTE                                     0x00000020
-#define ACE_DELETE_CHILD                                0x00000040
-#define ACE_READ_ATTRIBUTES                             0x00000080
-#define ACE_WRITE_ATTRIBUTES                            0x00000100
-#define ACE_DELETE                                      0x00010000
-#define ACE_READ_ACL                                    0x00020000
-#define ACE_WRITE_ACL                                   0x00040000
-#define ACE_WRITE_OWNER                                 0x00080000
-#define ACE_SYNCHRONIZE                                 0x00100000
+#define	ACE_READ_DATA					0x00000001
+#define	ACE_LIST_DIRECTORY				0x00000001
+#define	ACE_WRITE_DATA					0x00000002
+#define	ACE_ADD_FILE					0x00000002
+#define	ACE_APPEND_DATA					0x00000004
+#define	ACE_ADD_SUBDIRECTORY				0x00000004
+#define	ACE_READ_NAMED_ATTRS				0x00000008
+#define	ACE_WRITE_NAMED_ATTRS				0x00000010
+#define	ACE_EXECUTE					0x00000020
+#define	ACE_DELETE_CHILD				0x00000040
+#define	ACE_READ_ATTRIBUTES				0x00000080
+#define	ACE_WRITE_ATTRIBUTES				0x00000100
+#define	ACE_DELETE					0x00010000
+#define	ACE_READ_ACL					0x00020000
+#define	ACE_WRITE_ACL					0x00040000
+#define	ACE_WRITE_OWNER					0x00080000
+#define	ACE_SYNCHRONIZE					0x00100000
 
-#define ACE_FILE_INHERIT_ACE                            0x0001
-#define ACE_DIRECTORY_INHERIT_ACE                       0x0002
-#define ACE_NO_PROPAGATE_INHERIT_ACE                    0x0004
-#define ACE_INHERIT_ONLY_ACE                            0x0008
-#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG                  0x0010
-#define ACE_FAILED_ACCESS_ACE_FLAG                      0x0020
-#define ACE_IDENTIFIER_GROUP                            0x0040
-#define ACE_INHERITED_ACE                               0x0080
-#define ACE_OWNER                                       0x1000
-#define ACE_GROUP                                       0x2000
-#define ACE_EVERYONE                                    0x4000
+#define	ACE_FILE_INHERIT_ACE				0x0001
+#define	ACE_DIRECTORY_INHERIT_ACE			0x0002
+#define	ACE_NO_PROPAGATE_INHERIT_ACE			0x0004
+#define	ACE_INHERIT_ONLY_ACE				0x0008
+#define	ACE_SUCCESSFUL_ACCESS_ACE_FLAG			0x0010
+#define	ACE_FAILED_ACCESS_ACE_FLAG			0x0020
+#define	ACE_IDENTIFIER_GROUP				0x0040
+#define	ACE_INHERITED_ACE				0x0080
+#define	ACE_OWNER					0x1000
+#define	ACE_GROUP					0x2000
+#define	ACE_EVERYONE					0x4000
 
-#define ACE_ACCESS_ALLOWED_ACE_TYPE                     0x0000
-#define ACE_ACCESS_DENIED_ACE_TYPE                      0x0001
-#define ACE_SYSTEM_AUDIT_ACE_TYPE                       0x0002
-#define ACE_SYSTEM_ALARM_ACE_TYPE                       0x0003
+#define	ACE_ACCESS_ALLOWED_ACE_TYPE			0x0000
+#define	ACE_ACCESS_DENIED_ACE_TYPE			0x0001
+#define	ACE_SYSTEM_AUDIT_ACE_TYPE			0x0002
+#define	ACE_SYSTEM_ALARM_ACE_TYPE			0x0003
 
-#define ACL_AUTO_INHERIT                                0x0001
-#define ACL_PROTECTED                                   0x0002
-#define ACL_DEFAULTED                                   0x0004
-#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED)
+#define	ACL_AUTO_INHERIT				0x0001
+#define	ACL_PROTECTED					0x0002
+#define	ACL_DEFAULTED					0x0004
+#define	ACL_FLAGS_ALL	(ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED)
 
-#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE            0x04
-#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE              0x05
-#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE               0x06
-#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE                0x07
-#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE                0x08
-#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE            0x09
-#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE             0x0A
-#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE     0x0B
-#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE      0x0C
-#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE              0x0D
-#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE              0x0E
-#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE       0x0F
-#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE       0x10
+#define	ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE		0x04
+#define	ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE		0x05
+#define	ACE_ACCESS_DENIED_OBJECT_ACE_TYPE		0x06
+#define	ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE		0x07
+#define	ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE		0x08
+#define	ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE		0x09
+#define	ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE		0x0A
+#define	ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE	0x0B
+#define	ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE	0x0C
+#define	ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE		0x0D
+#define	ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE		0x0E
+#define	ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE	0x0F
+#define	ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE	0x10
 
-#define ACE_ALL_TYPES   0x001F
+#define	ACE_ALL_TYPES	0x001F
 
-#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP)
+#define	ACE_TYPE_FLAGS	(ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP)
 
-#define ACE_ALL_PERMS   (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
+/* BEGIN CSTYLED */
+#define	ACE_ALL_PERMS	(ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
      ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
      ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
      ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
      ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
+/* END CSTYLED */
 
-#define VSA_ACE                                         0x0010
-#define VSA_ACECNT                                      0x0020
-#define VSA_ACE_ALLTYPES                                0x0040
-#define VSA_ACE_ACLFLAGS                                0x0080
+#define	VSA_ACE						0x0010
+#define	VSA_ACECNT					0x0020
+#define	VSA_ACE_ALLTYPES				0x0040
+#define	VSA_ACE_ACLFLAGS				0x0080
 
 #endif /* _SPL_ACL_H */
diff --git a/spl/include/sys/acl_impl.h b/spl/include/sys/acl_impl.h
index 67af713..c96cc52 100644
--- a/spl/include/sys/acl_impl.h
+++ b/spl/include/sys/acl_impl.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ACL_IMPL_H
-#define _SPL_ACL_IMPL_H
+#define	_SPL_ACL_IMPL_H
 
 #endif /* _SPL_ACL_IMPL_H */
diff --git a/spl/include/sys/atomic.h b/spl/include/sys/atomic.h
index 07b460e..1f730e2 100644
--- a/spl/include/sys/atomic.h
+++ b/spl/include/sys/atomic.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ATOMIC_H
-#define _SPL_ATOMIC_H
+#define	_SPL_ATOMIC_H
 
 #include <linux/module.h>
 #include <linux/spinlock.h>
@@ -91,7 +91,7 @@  atomic_inc_32_nv(volatile uint32_t *target)
 	nv = ++(*target);
 	spin_unlock(&atomic32_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint32_t
@@ -103,7 +103,7 @@  atomic_dec_32_nv(volatile uint32_t *target)
 	nv = --(*target);
 	spin_unlock(&atomic32_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint32_t
@@ -116,7 +116,7 @@  atomic_add_32_nv(volatile uint32_t *target, uint32_t delta)
 	nv = *target;
 	spin_unlock(&atomic32_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint32_t
@@ -129,12 +129,11 @@  atomic_sub_32_nv(volatile uint32_t *target, uint32_t delta)
 	nv = *target;
 	spin_unlock(&atomic32_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint32_t
-atomic_cas_32(volatile uint32_t *target,  uint32_t cmp,
-              uint32_t newval)
+atomic_cas_32(volatile uint32_t *target,  uint32_t cmp, uint32_t newval)
 {
 	uint32_t rc;
 
@@ -145,7 +144,7 @@  atomic_cas_32(volatile uint32_t *target,  uint32_t cmp,
 
 	spin_unlock(&atomic32_lock);
 
-	return rc;
+	return (rc);
 }
 
 static __inline__ uint32_t
@@ -158,7 +157,7 @@  atomic_swap_32(volatile uint32_t *target,  uint32_t newval)
 	*target = newval;
 	spin_unlock(&atomic32_lock);
 
-	return rc;
+	return (rc);
 }
 
 static __inline__ void
@@ -202,7 +201,7 @@  atomic_inc_64_nv(volatile uint64_t *target)
 	nv = ++(*target);
 	spin_unlock(&atomic64_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint64_t
@@ -214,7 +213,7 @@  atomic_dec_64_nv(volatile uint64_t *target)
 	nv = --(*target);
 	spin_unlock(&atomic64_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint64_t
@@ -227,7 +226,7 @@  atomic_add_64_nv(volatile uint64_t *target, uint64_t delta)
 	nv = *target;
 	spin_unlock(&atomic64_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint64_t
@@ -240,12 +239,11 @@  atomic_sub_64_nv(volatile uint64_t *target, uint64_t delta)
 	nv = *target;
 	spin_unlock(&atomic64_lock);
 
-	return nv;
+	return (nv);
 }
 
 static __inline__ uint64_t
-atomic_cas_64(volatile uint64_t *target,  uint64_t cmp,
-              uint64_t newval)
+atomic_cas_64(volatile uint64_t *target,  uint64_t cmp, uint64_t newval)
 {
 	uint64_t rc;
 
@@ -255,7 +253,7 @@  atomic_cas_64(volatile uint64_t *target,  uint64_t cmp,
 		*target = newval;
 	spin_unlock(&atomic64_lock);
 
-	return rc;
+	return (rc);
 }
 
 static __inline__ uint64_t
@@ -268,31 +266,31 @@  atomic_swap_64(volatile uint64_t *target,  uint64_t newval)
 	*target = newval;
 	spin_unlock(&atomic64_lock);
 
-	return rc;
+	return (rc);
 }
 
 #else /* ATOMIC_SPINLOCK */
 
-#define atomic_inc_32(v)	atomic_inc((atomic_t *)(v))
-#define atomic_dec_32(v)	atomic_dec((atomic_t *)(v))
-#define atomic_add_32(v, i)	atomic_add((i), (atomic_t *)(v))
-#define atomic_sub_32(v, i)	atomic_sub((i), (atomic_t *)(v))
-#define atomic_inc_32_nv(v)	atomic_inc_return((atomic_t *)(v))
-#define atomic_dec_32_nv(v)	atomic_dec_return((atomic_t *)(v))
-#define atomic_add_32_nv(v, i)	atomic_add_return((i), (atomic_t *)(v))
-#define atomic_sub_32_nv(v, i)	atomic_sub_return((i), (atomic_t *)(v))
-#define atomic_cas_32(v, x, y)	atomic_cmpxchg((atomic_t *)(v), x, y)
-#define atomic_swap_32(v, x)	atomic_xchg((atomic_t *)(v), x)
-#define atomic_inc_64(v)	atomic64_inc((atomic64_t *)(v))
-#define atomic_dec_64(v)	atomic64_dec((atomic64_t *)(v))
-#define atomic_add_64(v, i)	atomic64_add((i), (atomic64_t *)(v))
-#define atomic_sub_64(v, i)	atomic64_sub((i), (atomic64_t *)(v))
-#define atomic_inc_64_nv(v)	atomic64_inc_return((atomic64_t *)(v))
-#define atomic_dec_64_nv(v)	atomic64_dec_return((atomic64_t *)(v))
-#define atomic_add_64_nv(v, i)	atomic64_add_return((i), (atomic64_t *)(v))
-#define atomic_sub_64_nv(v, i)	atomic64_sub_return((i), (atomic64_t *)(v))
-#define atomic_cas_64(v, x, y)	atomic64_cmpxchg((atomic64_t *)(v), x, y)
-#define atomic_swap_64(v, x)	atomic64_xchg((atomic64_t *)(v), x)
+#define	atomic_inc_32(v)	atomic_inc((atomic_t *)(v))
+#define	atomic_dec_32(v)	atomic_dec((atomic_t *)(v))
+#define	atomic_add_32(v, i)	atomic_add((i), (atomic_t *)(v))
+#define	atomic_sub_32(v, i)	atomic_sub((i), (atomic_t *)(v))
+#define	atomic_inc_32_nv(v)	atomic_inc_return((atomic_t *)(v))
+#define	atomic_dec_32_nv(v)	atomic_dec_return((atomic_t *)(v))
+#define	atomic_add_32_nv(v, i)	atomic_add_return((i), (atomic_t *)(v))
+#define	atomic_sub_32_nv(v, i)	atomic_sub_return((i), (atomic_t *)(v))
+#define	atomic_cas_32(v, x, y)	atomic_cmpxchg((atomic_t *)(v), x, y)
+#define	atomic_swap_32(v, x)	atomic_xchg((atomic_t *)(v), x)
+#define	atomic_inc_64(v)	atomic64_inc((atomic64_t *)(v))
+#define	atomic_dec_64(v)	atomic64_dec((atomic64_t *)(v))
+#define	atomic_add_64(v, i)	atomic64_add((i), (atomic64_t *)(v))
+#define	atomic_sub_64(v, i)	atomic64_sub((i), (atomic64_t *)(v))
+#define	atomic_inc_64_nv(v)	atomic64_inc_return((atomic64_t *)(v))
+#define	atomic_dec_64_nv(v)	atomic64_dec_return((atomic64_t *)(v))
+#define	atomic_add_64_nv(v, i)	atomic64_add_return((i), (atomic64_t *)(v))
+#define	atomic_sub_64_nv(v, i)	atomic64_sub_return((i), (atomic64_t *)(v))
+#define	atomic_cas_64(v, x, y)	atomic64_cmpxchg((atomic64_t *)(v), x, y)
+#define	atomic_swap_64(v, x)	atomic64_xchg((atomic64_t *)(v), x)
 
 #endif /* ATOMIC_SPINLOCK */
 
@@ -300,15 +298,15 @@  atomic_swap_64(volatile uint64_t *target,  uint64_t newval)
 static __inline__ void *
 atomic_cas_ptr(volatile void *target,  void *cmp, void *newval)
 {
-	return (void *)atomic_cas_64((volatile uint64_t *)target,
-	                             (uint64_t)cmp, (uint64_t)newval);
+	return ((void *)atomic_cas_64((volatile uint64_t *)target,
+	    (uint64_t)cmp, (uint64_t)newval));
 }
 #else /* _LP64 */
 static __inline__ void *
 atomic_cas_ptr(volatile void *target,  void *cmp, void *newval)
 {
-	return (void *)atomic_cas_32((volatile uint32_t *)target,
-	                             (uint32_t)cmp, (uint32_t)newval);
+	return ((void *)atomic_cas_32((volatile uint32_t *)target,
+	    (uint32_t)cmp, (uint32_t)newval));
 }
 #endif /* _LP64 */
 
diff --git a/spl/include/sys/attr.h b/spl/include/sys/attr.h
index 5fb609c..48c5e26 100644
--- a/spl/include/sys/attr.h
+++ b/spl/include/sys/attr.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ATTR_H
-#define _SPL_ATTR_H
+#define	_SPL_ATTR_H
 
 #endif /* SPL_ATTR_H */
diff --git a/spl/include/sys/bitmap.h b/spl/include/sys/bitmap.h
index e4acb0b..d940c14 100644
--- a/spl/include/sys/bitmap.h
+++ b/spl/include/sys/bitmap.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_BITMAP_H
-#define _SPL_BITMAP_H
+#define	_SPL_BITMAP_H
 
 #endif /* SPL_BITMAP_H */
diff --git a/spl/include/sys/bootconf.h b/spl/include/sys/bootconf.h
index 4e032ad..d83a478 100644
--- a/spl/include/sys/bootconf.h
+++ b/spl/include/sys/bootconf.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_BOOTCONF_H
-#define _SPL_BOOTCONF_H
+#define	_SPL_BOOTCONF_H
 
 #endif /* SPL_BOOTCONF_H */
diff --git a/spl/include/sys/bootprops.h b/spl/include/sys/bootprops.h
index a562ec9..ac54bc2 100644
--- a/spl/include/sys/bootprops.h
+++ b/spl/include/sys/bootprops.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_BOOTPROPS_H
-#define _SPL_BOOTPROPS_H
+#define	_SPL_BOOTPROPS_H
 
 #endif /* SPL_BOOTPROPS_H */
diff --git a/spl/include/sys/buf.h b/spl/include/sys/buf.h
index 8596c83..6879188 100644
--- a/spl/include/sys/buf.h
+++ b/spl/include/sys/buf.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_BUF_H
-#define _SPL_BUF_H
+#define	_SPL_BUF_H
 
 #endif /* SPL_BUF_H */
diff --git a/spl/include/sys/byteorder.h b/spl/include/sys/byteorder.h
index 184b52d..2034f22 100644
--- a/spl/include/sys/byteorder.h
+++ b/spl/include/sys/byteorder.h
@@ -23,45 +23,49 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_BYTEORDER_H
-#define _SPL_BYTEORDER_H
+#define	_SPL_BYTEORDER_H
 
 #include <asm/byteorder.h>
 #include <sys/isa_defs.h>
 
-#define LE_16(x)	cpu_to_le16(x)
-#define LE_32(x)	cpu_to_le32(x)
-#define LE_64(x)	cpu_to_le64(x)
-#define BE_16(x)	cpu_to_be16(x)
-#define BE_32(x)	cpu_to_be32(x)
-#define BE_64(x)	cpu_to_be64(x)
+#define	LE_16(x)	cpu_to_le16(x)
+#define	LE_32(x)	cpu_to_le32(x)
+#define	LE_64(x)	cpu_to_le64(x)
+#define	BE_16(x)	cpu_to_be16(x)
+#define	BE_32(x)	cpu_to_be32(x)
+#define	BE_64(x)	cpu_to_be64(x)
 
-#define BE_IN8(xa) \
+#define	BE_IN8(xa) \
 	*((uint8_t *)(xa))
 
-#define BE_IN16(xa) \
+#define	BE_IN16(xa) \
 	(((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1))
 
-#define BE_IN32(xa) \
+#define	BE_IN32(xa) \
 	(((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
 
 #ifdef _BIG_ENDIAN
 static __inline__ uint64_t
-htonll(uint64_t n) {
+htonll(uint64_t n)
+{
 	return (n);
 }
 
 static __inline__ uint64_t
-ntohll(uint64_t n) {
+ntohll(uint64_t n)
+{
 	return (n);
 }
 #else
 static __inline__ uint64_t
-htonll(uint64_t n) {
+htonll(uint64_t n)
+{
 	return ((((uint64_t)htonl(n)) << 32) + htonl(n >> 32));
 }
 
 static __inline__ uint64_t
-ntohll(uint64_t n) {
+ntohll(uint64_t n)
+{
 	return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
 }
 #endif
diff --git a/spl/include/sys/callb.h b/spl/include/sys/callb.h
index fbe4128..33e12b8 100644
--- a/spl/include/sys/callb.h
+++ b/spl/include/sys/callb.h
@@ -23,33 +23,32 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CALLB_H
-#define _SPL_CALLB_H
+#define	_SPL_CALLB_H
 
 #include <linux/module.h>
 #include <sys/mutex.h>
 
-#define CALLB_CPR_ASSERT(cp)		ASSERT(MUTEX_HELD((cp)->cc_lockp));
+#define	CALLB_CPR_ASSERT(cp)		ASSERT(MUTEX_HELD((cp)->cc_lockp));
 
 typedef struct callb_cpr {
-        kmutex_t        *cc_lockp;
+	kmutex_t	*cc_lockp;
 } callb_cpr_t;
 
-#define CALLB_CPR_INIT(cp, lockp, func, name)   {               \
-        (cp)->cc_lockp = lockp;                                 \
+#define	CALLB_CPR_INIT(cp, lockp, func, name)   {               \
+	(cp)->cc_lockp = lockp;                                 \
 }
 
-#define CALLB_CPR_SAFE_BEGIN(cp) {                              \
+#define	CALLB_CPR_SAFE_BEGIN(cp) {                              \
 	CALLB_CPR_ASSERT(cp);					\
 }
 
-#define CALLB_CPR_SAFE_END(cp, lockp) {                         \
+#define	CALLB_CPR_SAFE_END(cp, lockp) {                         \
 	CALLB_CPR_ASSERT(cp);					\
 }
 
-#define CALLB_CPR_EXIT(cp) {                                    \
-        ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
-        mutex_exit((cp)->cc_lockp);                             \
+#define	CALLB_CPR_EXIT(cp) {                                    \
+	ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
+	mutex_exit((cp)->cc_lockp);                             \
 }
 
 #endif  /* _SPL_CALLB_H */
-
diff --git a/spl/include/sys/callo.h b/spl/include/sys/callo.h
index 0d9fbcb..c7eea68 100644
--- a/spl/include/sys/callo.h
+++ b/spl/include/sys/callo.h
@@ -22,7 +22,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CALLO_H
-#define _SPL_CALLO_H
+#define	_SPL_CALLO_H
 
 /*
  * Callout flags:
@@ -44,9 +44,9 @@ 
  *      Legacy interfaces timeout() and realtime_timeout() pass this flag
  *      to timeout_generic() to indicate that a 32-bit ID should be allocated.
  */
-#define CALLOUT_FLAG_ROUNDUP            0x1
-#define CALLOUT_FLAG_ABSOLUTE           0x2
-#define CALLOUT_FLAG_HRESTIME           0x4
-#define CALLOUT_FLAG_32BIT              0x8
+#define	CALLOUT_FLAG_ROUNDUP		0x1
+#define	CALLOUT_FLAG_ABSOLUTE		0x2
+#define	CALLOUT_FLAG_HRESTIME		0x4
+#define	CALLOUT_FLAG_32BIT		0x8
 
 #endif  /* _SPL_CALLB_H */
diff --git a/spl/include/sys/cmn_err.h b/spl/include/sys/cmn_err.h
index 1291510..f1c077e 100644
--- a/spl/include/sys/cmn_err.h
+++ b/spl/include/sys/cmn_err.h
@@ -23,20 +23,20 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CMN_ERR_H
-#define _SPL_CMN_ERR_H
+#define	_SPL_CMN_ERR_H
 
 #include <sys/varargs.h>
 
-#define CE_CONT         0       /* continuation         */
-#define CE_NOTE         1       /* notice               */
-#define CE_WARN         2       /* warning              */
-#define CE_PANIC        3       /* panic                */
-#define CE_IGNORE       4       /* print nothing        */
+#define	CE_CONT		0 /* continuation */
+#define	CE_NOTE		1 /* notice */
+#define	CE_WARN		2 /* warning */
+#define	CE_PANIC	3 /* panic */
+#define	CE_IGNORE	4 /* print nothing */
 
 extern void cmn_err(int, const char *, ...);
 extern void vcmn_err(int, const char *, __va_list);
 extern void vpanic(const char *, __va_list);
 
-#define fm_panic	panic
+#define	fm_panic	panic
 
 #endif /* SPL_CMN_ERR_H */
diff --git a/spl/include/sys/compress.h b/spl/include/sys/compress.h
index 55822f0..1a946ce 100644
--- a/spl/include/sys/compress.h
+++ b/spl/include/sys/compress.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_COMPRESS_H
-#define _SPL_COMPRESS_H
+#define	_SPL_COMPRESS_H
 
 #endif /* SPL_COMPRESS_H */
diff --git a/spl/include/sys/condvar.h b/spl/include/sys/condvar.h
index 5479e75..5fcc906 100644
--- a/spl/include/sys/condvar.h
+++ b/spl/include/sys/condvar.h
@@ -56,6 +56,7 @@  extern void __cv_wait(kcondvar_t *, kmutex_t *);
 extern void __cv_wait_io(kcondvar_t *, kmutex_t *);
 extern void __cv_wait_sig(kcondvar_t *, kmutex_t *);
 extern clock_t __cv_timedwait(kcondvar_t *, kmutex_t *, clock_t);
+extern clock_t __cv_timedwait_io(kcondvar_t *, kmutex_t *, clock_t);
 extern clock_t __cv_timedwait_sig(kcondvar_t *, kmutex_t *, clock_t);
 extern clock_t cv_timedwait_hires(kcondvar_t *, kmutex_t *, hrtime_t,
     hrtime_t res, int flag);
@@ -71,6 +72,7 @@  extern void __cv_broadcast(kcondvar_t *c);
 #define	cv_wait_sig(cvp, mp)			__cv_wait_sig(cvp, mp)
 #define	cv_wait_interruptible(cvp, mp)		cv_wait_sig(cvp, mp)
 #define	cv_timedwait(cvp, mp, t)		__cv_timedwait(cvp, mp, t)
+#define	cv_timedwait_io(cvp, mp, t)		__cv_timedwait_io(cvp, mp, t)
 #define	cv_timedwait_sig(cvp, mp, t)		__cv_timedwait_sig(cvp, mp, t)
 #define	cv_timedwait_interruptible(cvp, mp, t)	cv_timedwait_sig(cvp, mp, t)
 #define	cv_signal(cvp)				__cv_signal(cvp)
diff --git a/spl/include/sys/conf.h b/spl/include/sys/conf.h
index eece0c7..e4c8f6c 100644
--- a/spl/include/sys/conf.h
+++ b/spl/include/sys/conf.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CONF_H
-#define _SPL_CONF_H
+#define	_SPL_CONF_H
 
 #endif /* SPL_CONF_H */
diff --git a/spl/include/sys/console.h b/spl/include/sys/console.h
index 76ef618..dfa38c9 100644
--- a/spl/include/sys/console.h
+++ b/spl/include/sys/console.h
@@ -28,17 +28,17 @@ 
 void
 console_vprintf(const char *fmt, va_list args)
 {
-        vprintk(fmt, args);
+	vprintk(fmt, args);
 }
 
 void
 console_printf(const char *fmt, ...)
 {
-        va_list args;
+	va_list args;
 
-        va_start(args, fmt);
-        console_vprintf(fmt, args);
-        va_end(args);
+	va_start(args, fmt);
+	console_vprintf(fmt, args);
+	va_end(args);
 }
 
 #endif /* _SPL_CONSOLE_H */
diff --git a/spl/include/sys/cpupart.h b/spl/include/sys/cpupart.h
index fddeed6..eb819ff 100644
--- a/spl/include/sys/cpupart.h
+++ b/spl/include/sys/cpupart.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CPUPART_H
-#define _SPL_CPUPART_H
+#define	_SPL_CPUPART_H
 
 #endif /* SPL_CPUPART_H */
diff --git a/spl/include/sys/cpuvar.h b/spl/include/sys/cpuvar.h
index 1284f94..6963067 100644
--- a/spl/include/sys/cpuvar.h
+++ b/spl/include/sys/cpuvar.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CPUVAR_H
-#define _SPL_CPUVAR_H
+#define	_SPL_CPUVAR_H
 
 #endif /* SPL_CPUVAR_H */
diff --git a/spl/include/sys/crc32.h b/spl/include/sys/crc32.h
index 1981f35..c14384a 100644
--- a/spl/include/sys/crc32.h
+++ b/spl/include/sys/crc32.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CRC32_H
-#define _SPL_CRC32_H
+#define	_SPL_CRC32_H
 
 #endif /* SPL_CRC32_H */
diff --git a/spl/include/sys/cred.h b/spl/include/sys/cred.h
index 2ad7115..3e96a07 100644
--- a/spl/include/sys/cred.h
+++ b/spl/include/sys/cred.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CRED_H
-#define _SPL_CRED_H
+#define	_SPL_CRED_H
 
 #include <linux/module.h>
 #include <sys/types.h>
@@ -68,7 +68,7 @@  extern gid_t crgetrgid(const cred_t *cr);
 extern gid_t crgetsgid(const cred_t *cr);
 extern gid_t crgetfsgid(const cred_t *cr);
 extern int crgetngroups(const cred_t *cr);
-extern gid_t * crgetgroups(const cred_t *cr);
+extern gid_t *crgetgroups(const cred_t *cr);
 extern int groupmember(gid_t gid, const cred_t *cr);
 
 #endif  /* _SPL_CRED_H */
diff --git a/spl/include/sys/ctype.h b/spl/include/sys/ctype.h
index 52037f9..86f29de 100644
--- a/spl/include/sys/ctype.h
+++ b/spl/include/sys/ctype.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_CTYPE_H
-#define _SPL_CTYPE_H
+#define	_SPL_CTYPE_H
 
 #include <linux/ctype.h>
 
diff --git a/spl/include/sys/ddi.h b/spl/include/sys/ddi.h
index 2fa1388..b0af3cb 100644
--- a/spl/include/sys/ddi.h
+++ b/spl/include/sys/ddi.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_DDI_H
-#define _SPL_DDI_H
+#define	_SPL_DDI_H
 
 #endif /* SPL_DDI_H */
diff --git a/spl/include/sys/debug.h b/spl/include/sys/debug.h
index 98ccbaf..b523ea1 100644
--- a/spl/include/sys/debug.h
+++ b/spl/include/sys/debug.h
@@ -54,20 +54,24 @@  int spl_panic(const char *file, const char *func, int line,
     const char *fmt, ...);
 void spl_dumpstack(void);
 
+/* BEGIN CSTYLED */
 #define	PANIC(fmt, a...)						\
 	spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
 
 #define	VERIFY(cond)							\
-	(void)(unlikely(!(cond)) &&					\
+	(void) (unlikely(!(cond)) &&					\
 	    spl_panic(__FILE__, __FUNCTION__, __LINE__,			\
 	    "%s", "VERIFY(" #cond ") failed\n"))
 
-#define	VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST)			\
-	(void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) &&			\
-	    spl_panic(__FILE__, __FUNCTION__, __LINE__,			\
-	    "VERIFY3(" #LEFT " " #OP " " #RIGHT ") "			\
-	    "failed (" FMT " " #OP " " FMT ")\n",			\
-	    CAST (LEFT), CAST (RIGHT)))
+#define	VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST)	do {		\
+		TYPE _verify3_left = (TYPE)(LEFT);				\
+		TYPE _verify3_right = (TYPE)(RIGHT);				\
+		if (!(_verify3_left OP _verify3_right))			\
+		    spl_panic(__FILE__, __FUNCTION__, __LINE__,		\
+		    "VERIFY3(" #LEFT " " #OP " " #RIGHT ") "		\
+		    "failed (" FMT " " #OP " " FMT ")\n",		\
+		    CAST (_verify3_left), CAST (_verify3_right));	\
+	} while (0)
 
 #define	VERIFY3B(x,y,z)	VERIFY3_IMPL(x, y, z, boolean_t, "%d", (boolean_t))
 #define	VERIFY3S(x,y,z)	VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long))
@@ -120,6 +124,7 @@  void spl_dumpstack(void);
 	((void)((!!(A) == !!(B)) || \
 	    spl_panic(__FILE__, __FUNCTION__, __LINE__, \
 	    "(" #A ") is equivalent to (" #B ")")))
+/* END CSTYLED */
 
 #endif /* NDEBUG */
 
diff --git a/spl/include/sys/dirent.h b/spl/include/sys/dirent.h
index 68f75da..8a33588 100644
--- a/spl/include/sys/dirent.h
+++ b/spl/include/sys/dirent.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_DIRENT_H
-#define _SPL_DIRENT_H
+#define	_SPL_DIRENT_H
 
 #endif /* SPL_DIRENT_H */
diff --git a/spl/include/sys/disp.h b/spl/include/sys/disp.h
index c3077a7..7f5ec85 100644
--- a/spl/include/sys/disp.h
+++ b/spl/include/sys/disp.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_DISP_H
-#define _SPL_DISP_H
+#define	_SPL_DISP_H
 
 #include <linux/preempt.h>
 
diff --git a/spl/include/sys/dkioc_free_util.h b/spl/include/sys/dkioc_free_util.h
index bea5a5b..6b1b941 100644
--- a/spl/include/sys/dkioc_free_util.h
+++ b/spl/include/sys/dkioc_free_util.h
@@ -52,7 +52,7 @@  static inline void dfl_free(dkioc_free_list_t *dfl) {
 }
 
 static inline dkioc_free_list_t *dfl_alloc(uint64_t dfl_num_exts, int flags) {
-	return vmem_zalloc(DFL_SZ(dfl_num_exts), flags);
+	return (vmem_zalloc(DFL_SZ(dfl_num_exts), flags));
 }
 
 #endif /* _SPL_DKIOC_UTIL_H */
diff --git a/spl/include/sys/dnlc.h b/spl/include/sys/dnlc.h
index 99d16c8..2014af5 100644
--- a/spl/include/sys/dnlc.h
+++ b/spl/include/sys/dnlc.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_DNLC_H
-#define _SPL_DNLC_H
+#define	_SPL_DNLC_H
 
 #endif /* SPL_DNLC_H */
diff --git a/spl/include/sys/dumphdr.h b/spl/include/sys/dumphdr.h
index 1b45058..84c5b76 100644
--- a/spl/include/sys/dumphdr.h
+++ b/spl/include/sys/dumphdr.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_DUMPHDR_H
-#define _SPL_DUMPHDR_H
+#define	_SPL_DUMPHDR_H
 
 #endif /* SPL_DUMPHDR_H */
diff --git a/spl/include/sys/efi_partition.h b/spl/include/sys/efi_partition.h
index c392364..96739a1 100644
--- a/spl/include/sys/efi_partition.h
+++ b/spl/include/sys/efi_partition.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_EFI_PARTITION_H
-#define _SPL_EFI_PARTITION_H
+#define	_SPL_EFI_PARTITION_H
 
 #endif /* SPL_EFI_PARTITION_H */
diff --git a/spl/include/sys/errno.h b/spl/include/sys/errno.h
index 64d8482..6b151bb 100644
--- a/spl/include/sys/errno.h
+++ b/spl/include/sys/errno.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ERRNO_H
-#define _SPL_ERRNO_H
+#define	_SPL_ERRNO_H
 
 #endif /* SPL_ERRNO_H */
diff --git a/spl/include/sys/fcntl.h b/spl/include/sys/fcntl.h
index 88b7a69..d71c39b 100644
--- a/spl/include/sys/fcntl.h
+++ b/spl/include/sys/fcntl.h
@@ -22,11 +22,11 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_FCNTL_H
-#define _SPL_FCNTL_H
+#define	_SPL_FCNTL_H
 
 #include <asm/fcntl.h>
 
-#define F_FREESP 11
+#define	F_FREESP 11
 
 #ifdef CONFIG_64BIT
 typedef struct flock flock64_t;
diff --git a/spl/include/sys/file.h b/spl/include/sys/file.h
index 67b301c..20fa7dc 100644
--- a/spl/include/sys/file.h
+++ b/spl/include/sys/file.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_FILE_H
-#define _SPL_FILE_H
+#define	_SPL_FILE_H
 
 #define	FIGNORECASE	0x00080000
 #define	FKIOCTL		0x80000000
diff --git a/spl/include/sys/fm/Makefile.in b/spl/include/sys/fm/Makefile.in
index a245c8b..5b10aef 100644
--- a/spl/include/sys/fm/Makefile.in
+++ b/spl/include/sys/fm/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/sys/fm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/sys/fs/Makefile.in b/spl/include/sys/fs/Makefile.in
index 0495087..1574323 100644
--- a/spl/include/sys/fs/Makefile.in
+++ b/spl/include/sys/fs/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/sys/fs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/sys/fs/swapnode.h b/spl/include/sys/fs/swapnode.h
index a5df129..b4745f4 100644
--- a/spl/include/sys/fs/swapnode.h
+++ b/spl/include/sys/fs/swapnode.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SWAPNODE_H
-#define _SPL_SWAPNODE_H
+#define	_SPL_SWAPNODE_H
 
 #endif /* SPL_SWAPNODE_H */
diff --git a/spl/include/sys/idmap.h b/spl/include/sys/idmap.h
index 3618c65..f524a02 100644
--- a/spl/include/sys/idmap.h
+++ b/spl/include/sys/idmap.h
@@ -22,8 +22,8 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_IDMAP_H
-#define _SPL_IDMAP_H
+#define	_SPL_IDMAP_H
 
-#define IDMAP_WK_CREATOR_OWNER_UID	2147483648U
+#define	IDMAP_WK_CREATOR_OWNER_UID	2147483648U
 
 #endif /* SPL_IDMAP_H */
diff --git a/spl/include/sys/int_limits.h b/spl/include/sys/int_limits.h
index 64f0a11..689d9d7 100644
--- a/spl/include/sys/int_limits.h
+++ b/spl/include/sys/int_limits.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_INT_LIMITS_H
-#define _SPL_INT_LIMITS_H
+#define	_SPL_INT_LIMITS_H
 
 #endif /* SPL_INT_LIMITS_H */
diff --git a/spl/include/sys/int_types.h b/spl/include/sys/int_types.h
index 582fded..fd4dafa 100644
--- a/spl/include/sys/int_types.h
+++ b/spl/include/sys/int_types.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_INT_TYPES_H
-#define _SPL_INT_TYPES_H
+#define	_SPL_INT_TYPES_H
 
 #include <sys/inttypes.h>
 
diff --git a/spl/include/sys/inttypes.h b/spl/include/sys/inttypes.h
index 82e555c..e63383e 100644
--- a/spl/include/sys/inttypes.h
+++ b/spl/include/sys/inttypes.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_INTTYPES_H
-#define _SPL_INTTYPES_H
+#define	_SPL_INTTYPES_H
 
 #endif /* SPL_INTTYPES_H */
diff --git a/spl/include/sys/isa_defs.h b/spl/include/sys/isa_defs.h
index 738795c..5559782 100644
--- a/spl/include/sys/isa_defs.h
+++ b/spl/include/sys/isa_defs.h
@@ -29,59 +29,59 @@ 
 #if defined(__x86_64) || defined(__x86_64__)
 
 #if !defined(__x86_64)
-#define __x86_64
+#define	__x86_64
 #endif
 
 #if !defined(__amd64)
-#define __amd64
+#define	__amd64
 #endif
 
 #if !defined(__x86)
-#define __x86
+#define	__x86
 #endif
 
 #if !defined(_LP64)
-#define _LP64
+#define	_LP64
 #endif
 
-#define _ALIGNMENT_REQUIRED            1
+#define	_ALIGNMENT_REQUIRED	1
 
 
 /* i386 arch specific defines */
 #elif defined(__i386) || defined(__i386__)
 
 #if !defined(__i386)
-#define __i386
+#define	__i386
 #endif
 
 #if !defined(__x86)
-#define __x86
+#define	__x86
 #endif
 
 #if !defined(_ILP32)
-#define _ILP32
+#define	_ILP32
 #endif
 
-#define _ALIGNMENT_REQUIRED            0
+#define	_ALIGNMENT_REQUIRED	0
 
 /* powerpc (ppc64) arch specific defines */
 #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
 
 #if !defined(__powerpc)
-#define __powerpc
+#define	__powerpc
 #endif
 
 #if !defined(__powerpc__)
-#define __powerpc__
+#define	__powerpc__
 #endif
 
 #if defined(__powerpc64__)
 #if !defined(_LP64)
-#define _LP64
+#define	_LP64
 #endif
 #else
 #if !defined(_ILP32)
-#define _ILP32
+#define	_ILP32
 #endif
 #endif
 
@@ -89,65 +89,65 @@ 
  * Illumos doesn't define _ALIGNMENT_REQUIRED for PPC, so default to 1
  * out of paranoia.
  */
-#define _ALIGNMENT_REQUIRED            1
+#define	_ALIGNMENT_REQUIRED	1
 
 /* arm arch specific defines */
 #elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
 
 #if !defined(__arm)
-#define __arm
+#define	__arm
 #endif
 
 #if !defined(__arm__)
-#define __arm__
+#define	__arm__
 #endif
 
 #if defined(__aarch64__)
 #if !defined(_LP64)
-#define _LP64
+#define	_LP64
 #endif
 #else
 #if !defined(_ILP32)
-#define _ILP32
+#define	_ILP32
 #endif
 #endif
 
 #if defined(__ARMEL__) || defined(__AARCH64EL__)
-#define _LITTLE_ENDIAN
+#define	_LITTLE_ENDIAN
 #else
-#define _BIG_ENDIAN
+#define	_BIG_ENDIAN
 #endif
 
 /*
  * Illumos doesn't define _ALIGNMENT_REQUIRED for ARM, so default to 1
  * out of paranoia.
  */
-#define _ALIGNMENT_REQUIRED            1
+#define	_ALIGNMENT_REQUIRED	1
 
 /* sparc arch specific defines */
 #elif defined(__sparc) || defined(__sparc__)
 
 #if !defined(__sparc)
-#define __sparc
+#define	__sparc
 #endif
 
 #if !defined(__sparc__)
-#define __sparc__
+#define	__sparc__
 #endif
 
 #if defined(__arch64__)
 #if !defined(_LP64)
-#define _LP64
+#define	_LP64
 #endif
 #else
 #if !defined(_ILP32)
-#define _ILP32
+#define	_ILP32
 #endif
 #endif
 
-#define _BIG_ENDIAN
-#define _SUNOS_VTOC_16
-#define _ALIGNMENT_REQUIRED            1
+#define	_BIG_ENDIAN
+#define	_SUNOS_VTOC_16
+#define	_ALIGNMENT_REQUIRED	1
 
 /* s390 arch specific defines */
 #elif defined(__s390__)
@@ -167,7 +167,7 @@ 
  * Illumos doesn't define _ALIGNMENT_REQUIRED for s390, so default to 1
  * out of paranoia.
  */
-#define _ALIGNMENT_REQUIRED            1
+#define	_ALIGNMENT_REQUIRED	1
 
 /* MIPS arch specific defines */
 #elif defined(__mips__)
@@ -190,7 +190,7 @@ 
  * Illumos doesn't define _ALIGNMENT_REQUIRED for MIPS, so default to 1
  * out of paranoia.
  */
-#define _ALIGNMENT_REQUIRED            1
+#define	_ALIGNMENT_REQUIRED	1
 
 #else
 /*
@@ -211,11 +211,11 @@ 
 #include <sys/byteorder.h>
 
 #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
-#define _LITTLE_ENDIAN __LITTLE_ENDIAN
+#define	_LITTLE_ENDIAN __LITTLE_ENDIAN
 #endif
 
 #if defined(__BIG_ENDIAN) && !defined(_BIG_ENDIAN)
-#define _BIG_ENDIAN __BIG_ENDIAN
+#define	_BIG_ENDIAN __BIG_ENDIAN
 #endif
 
 #if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
diff --git a/spl/include/sys/kidmap.h b/spl/include/sys/kidmap.h
index 3d67b51..ce31d35 100644
--- a/spl/include/sys/kidmap.h
+++ b/spl/include/sys/kidmap.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_KIDMAP_H
-#define _SPL_KIDMAP_H
+#define	_SPL_KIDMAP_H
 
 #include <sys/idmap.h>
 
diff --git a/spl/include/sys/kobj.h b/spl/include/sys/kobj.h
index 334449a..a688843 100644
--- a/spl/include/sys/kobj.h
+++ b/spl/include/sys/kobj.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_KOBJ_H
-#define _SPL_KOBJ_H
+#define	_SPL_KOBJ_H
 
 #include <sys/vnode.h>
 
diff --git a/spl/include/sys/kstat.h b/spl/include/sys/kstat.h
index faf6b81..2018019 100644
--- a/spl/include/sys/kstat.h
+++ b/spl/include/sys/kstat.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_KSTAT_H
-#define _SPL_KSTAT_H
+#define	_SPL_KSTAT_H
 
 #include <linux/module.h>
 #include <linux/proc_compat.h>
@@ -32,63 +32,65 @@ 
 #include <sys/kmem.h>
 #include <sys/mutex.h>
 
-#define KSTAT_STRLEN            31
-#define KSTAT_RAW_MAX		(128*1024)
+#define	KSTAT_STRLEN		255
+#define	KSTAT_RAW_MAX		(128*1024)
 
-/* For reference valid classes are:
+/*
+ * For reference valid classes are:
  * disk, tape, net, controller, vm, kvm, hat, streams, kstat, misc
  */
 
-#define KSTAT_TYPE_RAW          0       /* can be anything; ks_ndata >= 1 */
-#define KSTAT_TYPE_NAMED        1       /* name/value pair; ks_ndata >= 1 */
-#define KSTAT_TYPE_INTR         2       /* interrupt stats; ks_ndata == 1 */
-#define KSTAT_TYPE_IO           3       /* I/O stats; ks_ndata == 1 */
-#define KSTAT_TYPE_TIMER        4       /* event timer; ks_ndata >= 1 */
-#define KSTAT_NUM_TYPES         5
-
-#define KSTAT_DATA_CHAR         0
-#define KSTAT_DATA_INT32        1
-#define KSTAT_DATA_UINT32       2
-#define KSTAT_DATA_INT64        3
-#define KSTAT_DATA_UINT64       4
-#define KSTAT_DATA_LONG         5
-#define KSTAT_DATA_ULONG        6
-#define KSTAT_DATA_STRING       7
-#define KSTAT_NUM_DATAS         8
-
-#define KSTAT_INTR_HARD         0
-#define KSTAT_INTR_SOFT         1
-#define KSTAT_INTR_WATCHDOG     2
-#define KSTAT_INTR_SPURIOUS     3
-#define KSTAT_INTR_MULTSVC      4
-#define KSTAT_NUM_INTRS         5
-
-#define KSTAT_FLAG_VIRTUAL      0x01
-#define KSTAT_FLAG_VAR_SIZE     0x02
-#define KSTAT_FLAG_WRITABLE     0x04
-#define KSTAT_FLAG_PERSISTENT   0x08
-#define KSTAT_FLAG_DORMANT      0x10
-#define KSTAT_FLAG_UNSUPPORTED  (KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
-				 KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
-
-
-#define KS_MAGIC                0x9d9d9d9d
+#define	KSTAT_TYPE_RAW		0 /* can be anything; ks_ndata >= 1 */
+#define	KSTAT_TYPE_NAMED	1 /* name/value pair; ks_ndata >= 1 */
+#define	KSTAT_TYPE_INTR		2 /* interrupt stats; ks_ndata == 1 */
+#define	KSTAT_TYPE_IO		3 /* I/O stats; ks_ndata == 1 */
+#define	KSTAT_TYPE_TIMER	4 /* event timer; ks_ndata >= 1 */
+#define	KSTAT_NUM_TYPES		5
+
+#define	KSTAT_DATA_CHAR		0
+#define	KSTAT_DATA_INT32	1
+#define	KSTAT_DATA_UINT32	2
+#define	KSTAT_DATA_INT64	3
+#define	KSTAT_DATA_UINT64	4
+#define	KSTAT_DATA_LONG		5
+#define	KSTAT_DATA_ULONG	6
+#define	KSTAT_DATA_STRING	7
+#define	KSTAT_NUM_DATAS		8
+
+#define	KSTAT_INTR_HARD		0
+#define	KSTAT_INTR_SOFT		1
+#define	KSTAT_INTR_WATCHDOG	2
+#define	KSTAT_INTR_SPURIOUS	3
+#define	KSTAT_INTR_MULTSVC	4
+#define	KSTAT_NUM_INTRS		5
+
+#define	KSTAT_FLAG_VIRTUAL	0x01
+#define	KSTAT_FLAG_VAR_SIZE	0x02
+#define	KSTAT_FLAG_WRITABLE	0x04
+#define	KSTAT_FLAG_PERSISTENT	0x08
+#define	KSTAT_FLAG_DORMANT	0x10
+#define	KSTAT_FLAG_UNSUPPORTED	\
+	(KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
+	KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
+
+
+#define	KS_MAGIC		0x9d9d9d9d
 
 /* Dynamic updates */
-#define KSTAT_READ              0
-#define KSTAT_WRITE             1
+#define	KSTAT_READ		0
+#define	KSTAT_WRITE		1
 
 struct kstat_s;
 typedef struct kstat_s kstat_t;
 
-typedef int kid_t;                                  /* unique kstat id */
-typedef int kstat_update_t(struct kstat_s *, int);  /* dynamic update cb */
+typedef int kid_t;				/* unique kstat id */
+typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
 
 typedef struct kstat_module {
-	char             ksm_name[KSTAT_STRLEN+1];  /* module name */
-	struct list_head ksm_module_list;           /* module linkage */
-	struct list_head ksm_kstat_list;            /* list of kstat entries */
-	struct proc_dir_entry *ksm_proc;            /* proc entry */
+	char ksm_name[KSTAT_STRLEN+1];		/* module name */
+	struct list_head ksm_module_list;	/* module linkage */
+	struct list_head ksm_kstat_list;	/* list of kstat entries */
+	struct proc_dir_entry *ksm_proc;	/* proc entry */
 } kstat_module_t;
 
 typedef struct kstat_raw_ops {
@@ -98,95 +100,96 @@  typedef struct kstat_raw_ops {
 } kstat_raw_ops_t;
 
 struct kstat_s {
-	int              ks_magic;                  /* magic value */
-        kid_t            ks_kid;                    /* unique kstat ID */
-        hrtime_t         ks_crtime;                 /* creation time */
-	hrtime_t         ks_snaptime;               /* last access time */
-        char             ks_module[KSTAT_STRLEN+1]; /* provider module name */
-        int              ks_instance;               /* provider module instance */
-        char             ks_name[KSTAT_STRLEN+1];   /* kstat name */
-        char             ks_class[KSTAT_STRLEN+1];  /* kstat class */
-        uchar_t          ks_type;                   /* kstat data type */
-        uchar_t          ks_flags;                  /* kstat flags */
-        void             *ks_data;                  /* kstat type-specific data */
-        uint_t           ks_ndata;                  /* # of type-specific data records */
-        size_t           ks_data_size;              /* size of kstat data section */
-        struct proc_dir_entry *ks_proc;             /* proc linkage */
-        kstat_update_t   *ks_update;                /* dynamic updates */
-        void             *ks_private;               /* private data */
-	kmutex_t         ks_private_lock;           /* kstat private data lock */
-	kmutex_t         *ks_lock;                  /* kstat data lock */
-        struct list_head ks_list;                   /* kstat linkage */
-	kstat_module_t   *ks_owner;                 /* kstat module linkage */
-	kstat_raw_ops_t  ks_raw_ops;                /* ops table for raw type */
-	char             *ks_raw_buf;               /* buf used for raw ops */
-	size_t           ks_raw_bufsize;            /* size of raw ops buffer */
+	int		ks_magic;		/* magic value */
+	kid_t		ks_kid;			/* unique kstat ID */
+	hrtime_t	ks_crtime;		/* creation time */
+	hrtime_t	ks_snaptime;		/* last access time */
+	char		ks_module[KSTAT_STRLEN+1]; /* provider module name */
+	int		ks_instance;		/* provider module instance */
+	char		ks_name[KSTAT_STRLEN+1]; /* kstat name */
+	char		ks_class[KSTAT_STRLEN+1]; /* kstat class */
+	uchar_t		ks_type;		/* kstat data type */
+	uchar_t		ks_flags;		/* kstat flags */
+	void		*ks_data;		/* kstat type-specific data */
+	uint_t		ks_ndata;		/* # of data records */
+	size_t		ks_data_size;		/* size of kstat data section */
+	struct proc_dir_entry *ks_proc;		/* proc linkage */
+	kstat_update_t	*ks_update;		/* dynamic updates */
+	void		*ks_private;		/* private data */
+	kmutex_t	ks_private_lock;	/* kstat private data lock */
+	kmutex_t	*ks_lock;		/* kstat data lock */
+	struct list_head ks_list;		/* kstat linkage */
+	kstat_module_t	*ks_owner;		/* kstat module linkage */
+	kstat_raw_ops_t	ks_raw_ops;		/* ops table for raw type */
+	char		*ks_raw_buf;		/* buf used for raw ops */
+	size_t		ks_raw_bufsize;		/* size of raw ops buffer */
 };
 
 typedef struct kstat_named_s {
-        char             name[KSTAT_STRLEN];        /* name of counter */
-        uchar_t          data_type;                 /* data type */
-        union {
-                char            c[16];              /* 128-bit int */
-                int32_t         i32;                /* 32-bit signed int */
-                uint32_t        ui32;               /* 32-bit unsigned int */
-                int64_t         i64;                /* 64-bit signed int */
-                uint64_t        ui64;               /* 64-bit unsigned int */
-                long            l;                  /* native signed long */
-                ulong_t         ul;                 /* native unsigned long */
-                struct {
-                        union {
-                                char *ptr;          /* NULL-term string */
-                                char __pad[8];      /* 64-bit padding */
-                        } addr;
-                        uint32_t len;               /* # bytes for strlen + '\0' */
-                } string;
-        } value;
+	char	name[KSTAT_STRLEN];	/* name of counter */
+	uchar_t	data_type;		/* data type */
+	union {
+		char c[16];	/* 128-bit int */
+		int32_t	i32;	/* 32-bit signed int */
+		uint32_t ui32;	/* 32-bit unsigned int */
+		int64_t i64;	/* 64-bit signed int */
+		uint64_t ui64;	/* 64-bit unsigned int */
+		long l;		/* native signed long */
+		ulong_t ul;	/* native unsigned long */
+		struct {
+			union {
+				char *ptr;	/* NULL-term string */
+				char __pad[8];	/* 64-bit padding */
+			} addr;
+			uint32_t len;		/* # bytes for strlen + '\0' */
+		} string;
+	} value;
 } kstat_named_t;
 
-#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr)
-#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len)
+#define	KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr)
+#define	KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len)
 
 typedef struct kstat_intr {
-        uint_t intrs[KSTAT_NUM_INTRS];
+	uint_t intrs[KSTAT_NUM_INTRS];
 } kstat_intr_t;
 
 typedef struct kstat_io {
-        u_longlong_t     nread;       /* number of bytes read */
-        u_longlong_t     nwritten;    /* number of bytes written */
-        uint_t           reads;       /* number of read operations */
-        uint_t           writes;      /* number of write operations */
-        hrtime_t         wtime;       /* cumulative wait (pre-service) time */
-        hrtime_t         wlentime;    /* cumulative wait length*time product*/
-        hrtime_t         wlastupdate; /* last time wait queue changed */
-        hrtime_t         rtime;       /* cumulative run (service) time */
-        hrtime_t         rlentime;    /* cumulative run length*time product */
-        hrtime_t         rlastupdate; /* last time run queue changed */
-        uint_t           wcnt;        /* count of elements in wait state */
-        uint_t           rcnt;        /* count of elements in run state */
+	u_longlong_t	nread;		/* number of bytes read */
+	u_longlong_t	nwritten;	/* number of bytes written */
+	uint_t		reads;		/* number of read operations */
+	uint_t		writes;		/* number of write operations */
+	hrtime_t	wtime;		/* cumulative wait (pre-service) time */
+	hrtime_t	wlentime;	/* cumulative wait len*time product */
+	hrtime_t	wlastupdate;	/* last time wait queue changed */
+	hrtime_t	rtime;		/* cumulative run (service) time */
+	hrtime_t	rlentime;	/* cumulative run length*time product */
+	hrtime_t	rlastupdate;	/* last time run queue changed */
+	uint_t		wcnt;		/* count of elements in wait state */
+	uint_t		rcnt;		/* count of elements in run state */
 } kstat_io_t;
 
 typedef struct kstat_timer {
-        char         name[KSTAT_STRLEN+1]; /* event name */
-        u_longlong_t num_events;           /* number of events */
-        hrtime_t     elapsed_time;         /* cumulative elapsed time */
-        hrtime_t     min_time;             /* shortest event duration */
-        hrtime_t     max_time;             /* longest event duration */
-        hrtime_t     start_time;           /* previous event start time */
-        hrtime_t     stop_time;            /* previous event stop time */
+	char		name[KSTAT_STRLEN+1]; /* event name */
+	u_longlong_t	num_events;	 /* number of events */
+	hrtime_t	elapsed_time;	 /* cumulative elapsed time */
+	hrtime_t	min_time;	 /* shortest event duration */
+	hrtime_t	max_time;	 /* longest event duration */
+	hrtime_t	start_time;	 /* previous event start time */
+	hrtime_t	stop_time;	 /* previous event stop time */
 } kstat_timer_t;
 
 int spl_kstat_init(void);
 void spl_kstat_fini(void);
 
 extern void __kstat_set_raw_ops(kstat_t *ksp,
-		    int (*headers)(char *buf, size_t size),
-		    int (*data)(char *buf, size_t size, void *data),
-		    void* (*addr)(kstat_t *ksp, loff_t index));
+    int (*headers)(char *buf, size_t size),
+    int (*data)(char *buf, size_t size, void *data),
+    void* (*addr)(kstat_t *ksp, loff_t index));
+
 extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
-			     const char *ks_name, const char *ks_class,
-			     uchar_t ks_type, uint_t ks_ndata,
-			     uchar_t ks_flags);
+    const char *ks_name, const char *ks_class, uchar_t ks_type,
+    uint_t ks_ndata, uchar_t ks_flags);
+
 extern void __kstat_install(kstat_t *ksp);
 extern void __kstat_delete(kstat_t *ksp);
 extern void kstat_waitq_enter(kstat_io_t *);
@@ -194,9 +197,12 @@  extern void kstat_waitq_exit(kstat_io_t *);
 extern void kstat_runq_enter(kstat_io_t *);
 extern void kstat_runq_exit(kstat_io_t *);
 
-#define kstat_set_raw_ops(k,h,d,a)	__kstat_set_raw_ops(k,h,d,a)
-#define kstat_create(m,i,n,c,t,s,f)	__kstat_create(m,i,n,c,t,s,f)
-#define kstat_install(k)		__kstat_install(k)
-#define kstat_delete(k)			__kstat_delete(k)
+#define	kstat_set_raw_ops(k, h, d, a) \
+    __kstat_set_raw_ops(k, h, d, a)
+#define	kstat_create(m, i, n, c, t, s, f) \
+    __kstat_create(m, i, n, c, t, s, f)
+
+#define	kstat_install(k)		__kstat_install(k)
+#define	kstat_delete(k)			__kstat_delete(k)
 
 #endif  /* _SPL_KSTAT_H */
diff --git a/spl/include/sys/list.h b/spl/include/sys/list.h
index 563784a..9aba3b4 100644
--- a/spl/include/sys/list.h
+++ b/spl/include/sys/list.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_LIST_H
-#define _SPL_LIST_H
+#define	_SPL_LIST_H
 
 #include <sys/types.h>
 #include <linux/list.h>
@@ -53,13 +53,13 @@  typedef struct list {
 	list_node_t list_head;
 } list_t;
 
-#define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
-#define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset))
+#define	list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
+#define	list_object(a, node) ((void *)(((char *)node) - (a)->list_offset))
 
 static inline int
 list_is_empty(list_t *list)
 {
-	return list_empty(&list->list_head);
+	return (list_empty(&list->list_head));
 }
 
 static inline void
@@ -74,7 +74,7 @@  list_create(list_t *list, size_t size, size_t offset)
 {
 	ASSERT(list);
 	ASSERT(size > 0);
-	ASSERT(size >= offset + sizeof(list_node_t));
+	ASSERT(size >= offset + sizeof (list_node_t));
 
 	list->list_size = size;
 	list->list_offset = offset;
@@ -132,10 +132,10 @@  list_remove_head(list_t *list)
 {
 	list_node_t *head = list->list_head.next;
 	if (head == &list->list_head)
-		return NULL;
+		return (NULL);
 
 	list_del(head);
-	return list_object(list, head);
+	return (list_object(list, head));
 }
 
 static inline void *
@@ -143,28 +143,28 @@  list_remove_tail(list_t *list)
 {
 	list_node_t *tail = list->list_head.prev;
 	if (tail == &list->list_head)
-		return NULL;
+		return (NULL);
 
 	list_del(tail);
-	return list_object(list, tail);
+	return (list_object(list, tail));
 }
 
 static inline void *
 list_head(list_t *list)
 {
 	if (list_is_empty(list))
-		return NULL;
+		return (NULL);
 
-	return list_object(list, list->list_head.next);
+	return (list_object(list, list->list_head.next));
 }
 
 static inline void *
 list_tail(list_t *list)
 {
 	if (list_is_empty(list))
-		return NULL;
+		return (NULL);
 
-	return list_object(list, list->list_head.prev);
+	return (list_object(list, list->list_head.prev));
 }
 
 static inline void *
@@ -173,9 +173,9 @@  list_next(list_t *list, void *object)
 	list_node_t *node = list_d2l(list, object);
 
 	if (node->next != &list->list_head)
-		return list_object(list, node->next);
+		return (list_object(list, node->next));
 
-	return NULL;
+	return (NULL);
 }
 
 static inline void *
@@ -184,9 +184,9 @@  list_prev(list_t *list, void *object)
 	list_node_t *node = list_d2l(list, object);
 
 	if (node->prev != &list->list_head)
-		return list_object(list, node->prev);
+		return (list_object(list, node->prev));
 
-	return NULL;
+	return (NULL);
 }
 
 static inline int
@@ -201,7 +201,7 @@  spl_list_move_tail(list_t *dst, list_t *src)
 	list_splice_init(&src->list_head, dst->list_head.prev);
 }
 
-#define list_move_tail(dst, src)	spl_list_move_tail(dst, src)
+#define	list_move_tail(dst, src)	spl_list_move_tail(dst, src)
 
 static inline void
 list_link_replace(list_node_t *old_node, list_node_t *new_node)
diff --git a/spl/include/sys/mkdev.h b/spl/include/sys/mkdev.h
index d765b73..8fbbc0c 100644
--- a/spl/include/sys/mkdev.h
+++ b/spl/include/sys/mkdev.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_MKDEV_H
-#define _SPL_MKDEV_H
+#define	_SPL_MKDEV_H
 
 #endif /* SPL_MKDEV_H */
diff --git a/spl/include/sys/mntent.h b/spl/include/sys/mntent.h
index 66fae87..61ccac3 100644
--- a/spl/include/sys/mntent.h
+++ b/spl/include/sys/mntent.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_MNTENT_H
-#define _SPL_MNTENT_H
+#define	_SPL_MNTENT_H
 
 #endif /* SPL_MNTENT_H */
diff --git a/spl/include/sys/modctl.h b/spl/include/sys/modctl.h
index 8d79e53..36dc9a6 100644
--- a/spl/include/sys/modctl.h
+++ b/spl/include/sys/modctl.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_MODCTL_H
-#define _SPL_MODCTL_H
+#define	_SPL_MODCTL_H
 
 #endif /* SPL_MODCTL_H */
diff --git a/spl/include/sys/mode.h b/spl/include/sys/mode.h
index d09965e..1b43e65 100644
--- a/spl/include/sys/mode.h
+++ b/spl/include/sys/mode.h
@@ -23,10 +23,10 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_MODE_H
-#define _SPL_MODE_H
+#define	_SPL_MODE_H
 
-#define IFTOVT(mode)	vn_mode_to_vtype(mode)
-#define VTTOIF(vtype)	vn_vtype_to_mode(vtype)
-#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT))
+#define	IFTOVT(mode)	vn_mode_to_vtype(mode)
+#define	VTTOIF(vtype)	vn_vtype_to_mode(vtype)
+#define	MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT))
 
 #endif /* SPL_MODE_H */
diff --git a/spl/include/sys/mount.h b/spl/include/sys/mount.h
index ca1796d..3e3d8e5 100644
--- a/spl/include/sys/mount.h
+++ b/spl/include/sys/mount.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_MOUNT_H
-#define _SPL_MOUNT_H
+#define	_SPL_MOUNT_H
 
 #endif /* SPL_MOUNT_H */
diff --git a/spl/include/sys/mutex.h b/spl/include/sys/mutex.h
index 8cbab7c..c7084b3c 100644
--- a/spl/include/sys/mutex.h
+++ b/spl/include/sys/mutex.h
@@ -84,13 +84,13 @@  spl_mutex_lockdep_on_maybe(kmutex_t *mp)			\
 		lockdep_on();					\
 }
 #else  /* CONFIG_LOCKDEP */
-#define spl_mutex_set_type(mp, type)
-#define spl_mutex_lockdep_off_maybe(mp)
-#define spl_mutex_lockdep_on_maybe(mp)
+#define	spl_mutex_set_type(mp, type)
+#define	spl_mutex_lockdep_off_maybe(mp)
+#define	spl_mutex_lockdep_on_maybe(mp)
 #endif /* CONFIG_LOCKDEP */
 
 /*
- * The following functions must be a #define and not static inline.
+ * The following functions must be a #define	and not static inline.
  * This ensures that the native linux mutex functions (lock/unlock)
  * will be correctly located in the users code which is important
  * for the built in kernel lock analysis tools
@@ -113,6 +113,7 @@  spl_mutex_lockdep_on_maybe(kmutex_t *mp)			\
 	VERIFY3P(mutex_owner(mp), ==, NULL);			\
 }
 
+/* BEGIN CSTYLED */
 #define	mutex_tryenter(mp)					\
 ({								\
 	int _rc_;						\
@@ -124,6 +125,7 @@  spl_mutex_lockdep_on_maybe(kmutex_t *mp)			\
 								\
 	_rc_;							\
 })
+/* END CSTYLED */
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 #define	mutex_enter_nested(mp, subclass)			\
diff --git a/spl/include/sys/note.h b/spl/include/sys/note.h
index 5117562..7480adf 100644
--- a/spl/include/sys/note.h
+++ b/spl/include/sys/note.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_NOTE_H
-#define _SPL_NOTE_H
+#define	_SPL_NOTE_H
 
 #endif /* SPL_NOTE_H */
diff --git a/spl/include/sys/open.h b/spl/include/sys/open.h
index e3ebd8c..bf55ee7 100644
--- a/spl/include/sys/open.h
+++ b/spl/include/sys/open.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_OPEN_H
-#define _SPL_OPEN_H
+#define	_SPL_OPEN_H
 
 #endif /* SPL_OPEN_H */
diff --git a/spl/include/sys/param.h b/spl/include/sys/param.h
index 665f641..274db42 100644
--- a/spl/include/sys/param.h
+++ b/spl/include/sys/param.h
@@ -23,14 +23,14 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_PARAM_H
-#define _SPL_PARAM_H
+#define	_SPL_PARAM_H
 
 #include <asm/page.h>
 
 /* Pages to bytes and back */
-#define ptob(pages)			((pages) << PAGE_SHIFT)
-#define btop(bytes)			((bytes) >> PAGE_SHIFT)
+#define	ptob(pages)			((pages) << PAGE_SHIFT)
+#define	btop(bytes)			((bytes) >> PAGE_SHIFT)
 
-#define MAXUID				UINT32_MAX
+#define	MAXUID				UINT32_MAX
 
 #endif /* SPL_PARAM_H */
diff --git a/spl/include/sys/pathname.h b/spl/include/sys/pathname.h
index 71ea441..812114e 100644
--- a/spl/include/sys/pathname.h
+++ b/spl/include/sys/pathname.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_PATHNAME_H
-#define _SPL_PATHNAME_H
+#define	_SPL_PATHNAME_H
 
 typedef struct pathname {
 	char	*pn_buf;		/* underlying storage */
diff --git a/spl/include/sys/policy.h b/spl/include/sys/policy.h
index 45e724b..2892ce1 100644
--- a/spl/include/sys/policy.h
+++ b/spl/include/sys/policy.h
@@ -23,25 +23,25 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_POLICY_H
-#define _SPL_POLICY_H
+#define	_SPL_POLICY_H
 
-#define	secpolicy_fs_unmount(c,vfs)			(0)
+#define	secpolicy_fs_unmount(c, vfs)			(0)
 #define	secpolicy_nfs(c)				(0)
-#define	secpolicy_sys_config(c,co)			(0)
+#define	secpolicy_sys_config(c, co)			(0)
 #define	secpolicy_zfs(c)				(0)
 #define	secpolicy_zinject(c)				(0)
-#define	secpolicy_vnode_setids_setgids(c,id)		(0)
+#define	secpolicy_vnode_setids_setgids(c, id)		(0)
 #define	secpolicy_vnode_setid_retain(c, sr)		(0)
 #define	secpolicy_setid_clear(v, c)			(0)
-#define	secpolicy_vnode_any_access(c,vp,o)		(0)
-#define	secpolicy_vnode_access2(c,cp,o,m1,m2)		(0)
-#define	secpolicy_vnode_chown(c,o)			(0)
-#define	secpolicy_vnode_setdac(c,o)			(0)
+#define	secpolicy_vnode_any_access(c, vp, o)		(0)
+#define	secpolicy_vnode_access2(c, cp, o, m1, m2)	(0)
+#define	secpolicy_vnode_chown(c, o)			(0)
+#define	secpolicy_vnode_setdac(c, o)			(0)
 #define	secpolicy_vnode_remove(c)			(0)
-#define	secpolicy_vnode_setattr(c,v,a,o,f,func,n)	(0)
+#define	secpolicy_vnode_setattr(c, v, a, o, f, func, n)	(0)
 #define	secpolicy_xvattr(x, o, c, t)			(0)
 #define	secpolicy_vnode_stky_modify(c)			(0)
-#define	secpolicy_setid_setsticky_clear(v,a,o,c)	(0)
+#define	secpolicy_setid_setsticky_clear(v, a, o, c)	(0)
 #define	secpolicy_basic_link(c)				(0)
 
 #endif /* SPL_POLICY_H */
diff --git a/spl/include/sys/pool.h b/spl/include/sys/pool.h
index bf6a0bb..410bb2f 100644
--- a/spl/include/sys/pool.h
+++ b/spl/include/sys/pool.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_POOL_H
-#define _SPL_POOL_H
+#define	_SPL_POOL_H
 
 #include <sys/pset.h>
 
diff --git a/spl/include/sys/priv_impl.h b/spl/include/sys/priv_impl.h
index f1507a8..ef11a62 100644
--- a/spl/include/sys/priv_impl.h
+++ b/spl/include/sys/priv_impl.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_PRIV_IMPL_H
-#define _SPL_PRIV_IMPL_H
+#define	_SPL_PRIV_IMPL_H
 
 #endif /* _SPL_PRIV_IMPL_H */
diff --git a/spl/include/sys/proc.h b/spl/include/sys/proc.h
index dbaf416..f926e1e 100644
--- a/spl/include/sys/proc.h
+++ b/spl/include/sys/proc.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_PROC_H
-#define _SPL_PROC_H
+#define	_SPL_PROC_H
 
 #endif /* SPL_PROC_H */
diff --git a/spl/include/sys/processor.h b/spl/include/sys/processor.h
index 60b1a21..2e325c3 100644
--- a/spl/include/sys/processor.h
+++ b/spl/include/sys/processor.h
@@ -25,7 +25,7 @@ 
 #ifndef	_SPL_PROCESSOR_H
 #define	_SPL_PROCESSOR_H
 
-#define getcpuid() smp_processor_id()
+#define	getcpuid() smp_processor_id()
 
 typedef int	processorid_t;
 
diff --git a/spl/include/sys/pset.h b/spl/include/sys/pset.h
index 2723d31..d588600 100644
--- a/spl/include/sys/pset.h
+++ b/spl/include/sys/pset.h
@@ -23,16 +23,16 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_PSET_H
-#define _SPL_PSET_H
+#define	_SPL_PSET_H
 
 typedef int psetid_t;
 
 /* special processor set id's */
-#define PS_NONE         -1
-#define PS_QUERY        -2
-#define PS_MYID         -3
-#define PS_SOFT         -4
-#define PS_HARD         -5
-#define PS_QUERY_TYPE   -6
+#define	PS_NONE		-1
+#define	PS_QUERY	-2
+#define	PS_MYID		-3
+#define	PS_SOFT		-4
+#define	PS_HARD		-5
+#define	PS_QUERY_TYPE	-6
 
 #endif /* SPL_PSET_H */
diff --git a/spl/include/sys/random.h b/spl/include/sys/random.h
index 64f70ee..1f05a58 100644
--- a/spl/include/sys/random.h
+++ b/spl/include/sys/random.h
@@ -31,8 +31,8 @@ 
 static __inline__ int
 random_get_bytes(uint8_t *ptr, size_t len)
 {
-	get_random_bytes((void *)ptr,(int)len);
-	return 0;
+	get_random_bytes((void *)ptr, (int)len);
+	return (0);
 }
 
 extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len);
diff --git a/spl/include/sys/refstr.h b/spl/include/sys/refstr.h
index 49a3417..fec0ab2 100644
--- a/spl/include/sys/refstr.h
+++ b/spl/include/sys/refstr.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_REFSTR_H
-#define _SPL_REFSTR_H
+#define	_SPL_REFSTR_H
 
 #endif /* SPL_REFSTR_H */
diff --git a/spl/include/sys/resource.h b/spl/include/sys/resource.h
index fe33655..0ff0a75 100644
--- a/spl/include/sys/resource.h
+++ b/spl/include/sys/resource.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_RESOURCE_H
-#define _SPL_RESOURCE_H
+#define	_SPL_RESOURCE_H
 
 #include <linux/resource.h>
 
diff --git a/spl/include/sys/rwlock.h b/spl/include/sys/rwlock.h
index ffb7b90..325dfc4 100644
--- a/spl/include/sys/rwlock.h
+++ b/spl/include/sys/rwlock.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_RWLOCK_H
-#define _SPL_RWLOCK_H
+#define	_SPL_RWLOCK_H
 
 #include <sys/types.h>
 #include <linux/rwsem.h>
@@ -55,7 +55,7 @@  typedef struct {
 #endif /* CONFIG_LOCKDEP */
 } krwlock_t;
 
-#define SEM(rwp)	(&(rwp)->rw_rwlock)
+#define	SEM(rwp)	(&(rwp)->rw_rwlock)
 
 static inline void
 spl_rw_set_owner(krwlock_t *rwp)
@@ -81,9 +81,9 @@  static inline kthread_t *
 rw_owner(krwlock_t *rwp)
 {
 #ifdef CONFIG_RWSEM_SPIN_ON_OWNER
-	return SEM(rwp)->owner;
+	return (SEM(rwp)->owner);
 #else
-	return rwp->rw_owner;
+	return (rwp->rw_owner);
 #endif
 }
 
@@ -106,9 +106,9 @@  spl_rw_lockdep_on_maybe(krwlock_t *rwp)			\
 		lockdep_on();				\
 }
 #else  /* CONFIG_LOCKDEP */
-#define spl_rw_set_type(rwp, type)
-#define spl_rw_lockdep_off_maybe(rwp)
-#define spl_rw_lockdep_on_maybe(rwp)
+#define	spl_rw_set_type(rwp, type)
+#define	spl_rw_lockdep_off_maybe(rwp)
+#define	spl_rw_lockdep_on_maybe(rwp)
 #endif /* CONFIG_LOCKDEP */
 
 static inline int
@@ -131,16 +131,17 @@  RW_WRITE_HELD(krwlock_t *rwp)
 static inline int
 RW_LOCK_HELD(krwlock_t *rwp)
 {
-	return spl_rwsem_is_locked(SEM(rwp));
+	return (spl_rwsem_is_locked(SEM(rwp)));
 }
 
 /*
- * The following functions must be a #define and not static inline.
+ * The following functions must be a #define	and not static inline.
  * This ensures that the native linux semaphore functions (down/up)
  * will be correctly located in the users code which is important
  * for the built in kernel lock analysis tools
  */
-#define rw_init(rwp, name, type, arg)					\
+/* BEGIN CSTYLED */
+#define	rw_init(rwp, name, type, arg)					\
 ({									\
 	static struct lock_class_key __key;				\
 	ASSERT(type == RW_DEFAULT || type == RW_NOLOCKDEP);		\
@@ -150,12 +151,12 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	spl_rw_set_type(rwp, type);					\
 })
 
-#define rw_destroy(rwp)							\
+#define	rw_destroy(rwp)							\
 ({									\
 	VERIFY(!RW_LOCK_HELD(rwp));					\
 })
 
-#define rw_tryenter(rwp, rw)						\
+#define	rw_tryenter(rwp, rw)						\
 ({									\
 	int _rc_ = 0;							\
 									\
@@ -175,7 +176,7 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	_rc_;								\
 })
 
-#define rw_enter(rwp, rw)						\
+#define	rw_enter(rwp, rw)						\
 ({									\
 	spl_rw_lockdep_off_maybe(rwp);					\
 	switch (rw) {							\
@@ -192,7 +193,7 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	spl_rw_lockdep_on_maybe(rwp);					\
 })
 
-#define rw_exit(rwp)							\
+#define	rw_exit(rwp)							\
 ({									\
 	spl_rw_lockdep_off_maybe(rwp);					\
 	if (RW_WRITE_HELD(rwp)) {					\
@@ -205,7 +206,7 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	spl_rw_lockdep_on_maybe(rwp);					\
 })
 
-#define rw_downgrade(rwp)						\
+#define	rw_downgrade(rwp)						\
 ({									\
 	spl_rw_lockdep_off_maybe(rwp);					\
 	spl_rw_clear_owner(rwp);					\
@@ -213,7 +214,7 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	spl_rw_lockdep_on_maybe(rwp);					\
 })
 
-#define rw_tryupgrade(rwp)						\
+#define	rw_tryupgrade(rwp)						\
 ({									\
 	int _rc_ = 0;							\
 									\
@@ -227,6 +228,7 @@  RW_LOCK_HELD(krwlock_t *rwp)
 	}								\
 	_rc_;								\
 })
+/* END CSTYLED */
 
 int spl_rw_init(void);
 void spl_rw_fini(void);
diff --git a/spl/include/sys/sdt.h b/spl/include/sys/sdt.h
index 287bfaa..8178eb8 100644
--- a/spl/include/sys/sdt.h
+++ b/spl/include/sys/sdt.h
@@ -23,8 +23,8 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SDT_H
-#define _SPL_SDT_H
+#define	_SPL_SDT_H
 
-#define SET_ERROR(x) (x)
+#define	SET_ERROR(x) (x)
 
 #endif /* SPL_SDT_H */
diff --git a/spl/include/sys/sid.h b/spl/include/sys/sid.h
index 8ee5d07..a54d78b 100644
--- a/spl/include/sys/sid.h
+++ b/spl/include/sys/sid.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SID_H
-#define _SPL_SID_H
+#define	_SPL_SID_H
 
 typedef struct ksiddomain {
 	char		*kd_name;
@@ -41,21 +41,21 @@  typedef int ksid_t;
 static inline ksiddomain_t *
 ksid_lookupdomain(const char *dom)
 {
-        ksiddomain_t *kd;
+	ksiddomain_t *kd;
 	int len = strlen(dom);
 
-        kd = kmem_zalloc(sizeof(ksiddomain_t), KM_SLEEP);
-        kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP);
+	kd = kmem_zalloc(sizeof (ksiddomain_t), KM_SLEEP);
+	kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP);
 	memcpy(kd->kd_name, dom, len);
 
-        return (kd);
+	return (kd);
 }
 
 static inline void
 ksiddomain_rele(ksiddomain_t *ksid)
 {
 	kmem_free(ksid->kd_name, strlen(ksid->kd_name) + 1);
-        kmem_free(ksid, sizeof(ksiddomain_t));
+	kmem_free(ksid, sizeof (ksiddomain_t));
 }
 
 #endif /* _SPL_SID_H */
diff --git a/spl/include/sys/signal.h b/spl/include/sys/signal.h
index 77cc2d3..849c6e9 100644
--- a/spl/include/sys/signal.h
+++ b/spl/include/sys/signal.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SIGNAL_H
-#define _SPL_SIGNAL_H
+#define	_SPL_SIGNAL_H
 
 #include <linux/sched.h>
 
@@ -34,7 +34,8 @@ 
 #define	FORREAL		0	/* Usual side-effects */
 #define	JUSTLOOKING	1	/* Don't stop the process */
 
-/* The "why" argument indicates the allowable side-effects of the call:
+/*
+ * The "why" argument indicates the allowable side-effects of the call:
  *
  * FORREAL:  Extract the next pending signal from p_sig into p_cursig;
  * stop the process if a stop has been requested or if a traced signal
@@ -48,7 +49,7 @@  issig(int why)
 {
 	ASSERT(why == FORREAL || why == JUSTLOOKING);
 
-	return signal_pending(current);
+	return (signal_pending(current));
 }
 
 #endif /* SPL_SIGNAL_H */
diff --git a/spl/include/sys/stat.h b/spl/include/sys/stat.h
index cde7556..c425b75 100644
--- a/spl/include/sys/stat.h
+++ b/spl/include/sys/stat.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_STAT_H
-#define _SPL_STAT_H
+#define	_SPL_STAT_H
 
 #include <linux/stat.h>
 
diff --git a/spl/include/sys/stropts.h b/spl/include/sys/stropts.h
index 25c7ee1..c0c8566 100644
--- a/spl/include/sys/stropts.h
+++ b/spl/include/sys/stropts.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_STROPTS_H
-#define _SPL_STROPTS_H
+#define	_SPL_STROPTS_H
 
 #endif /* SPL_STROPTS_H */
diff --git a/spl/include/sys/sunddi.h b/spl/include/sys/sunddi.h
index c49b0c2..1f78094 100644
--- a/spl/include/sys/sunddi.h
+++ b/spl/include/sys/sunddi.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SUNDDI_H
-#define _SPL_SUNDDI_H
+#define	_SPL_SUNDDI_H
 
 #include <sys/cred.h>
 #include <sys/uio.h>
@@ -44,9 +44,9 @@  typedef int ddi_devid_t;
 #define	DDI_SUCCESS				0
 #define	DDI_FAILURE				-1
 
-#define	ddi_prop_lookup_string(x1,x2,x3,x4,x5)	(*x5 = NULL)
-#define	ddi_prop_free(x)			(void)0
-#define	ddi_root_node()				(void)0
+#define	ddi_prop_lookup_string(x1, x2, x3, x4, x5)	(*x5 = NULL)
+#define	ddi_prop_free(x)				(void)0
+#define	ddi_root_node()					(void)0
 
 extern int ddi_strtoul(const char *, char **, int, unsigned long *);
 extern int ddi_strtol(const char *, char **, int, long *);
diff --git a/spl/include/sys/sunldi.h b/spl/include/sys/sunldi.h
index 05fde53..af5d54c 100644
--- a/spl/include/sys/sunldi.h
+++ b/spl/include/sys/sunldi.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SUNLDI_H
-#define _SPL_SUNLDI_H
+#define	_SPL_SUNLDI_H
 
 #include <sys/types.h>
 #include <linux/fs.h>
@@ -37,7 +37,7 @@ 
  * https://github.com/torvalds/linux/commit/233bde21.
  */
 #ifndef SECTOR_SIZE
-#define SECTOR_SIZE 512
+#define	SECTOR_SIZE 512
 #endif
 
 #endif /* SPL_SUNLDI_H */
diff --git a/spl/include/sys/sysdc.h b/spl/include/sys/sysdc.h
index 14ab48a..b6c0cf0 100644
--- a/spl/include/sys/sysdc.h
+++ b/spl/include/sys/sysdc.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SYSDC_H
-#define _SPL_SYSDC_H
+#define	_SPL_SYSDC_H
 
 #endif /* SPL_SYSDC_H */
diff --git a/spl/include/sys/sysevent.h b/spl/include/sys/sysevent.h
deleted file mode 100644
index 5a7ca41..0000000
--- a/spl/include/sys/sysevent.h
+++ /dev/null
@@ -1,28 +0,0 @@ 
-/*****************************************************************************\
- *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- *  Copyright (C) 2007 The Regents of the University of California.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
- *  UCRL-CODE-235197
- *
- *  This file is part of the SPL, Solaris Porting Layer.
- *  For details, see <http://zfsonlinux.org/>.
- *
- *  The SPL is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  The SPL is distributed in the hope that it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
-\*****************************************************************************/
-
-#ifndef	_SPL_SYSEVENT_H
-#define	_SPL_SYSEVENT_H
-
-#endif /* _SPL_SYSEVENT_H */
diff --git a/spl/include/sys/sysevent/Makefile.am b/spl/include/sys/sysevent/Makefile.am
deleted file mode 100644
index 63d9af3..0000000
--- a/spl/include/sys/sysevent/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@ 
-COMMON_H =
-
-KERNEL_H = \
-	$(top_srcdir)/include/sys/sysevent/eventdefs.h
-
-USER_H =
-
-EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
-
-if CONFIG_KERNEL
-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/sysevent
-kernel_HEADERS = $(KERNEL_H)
-endif
diff --git a/spl/include/sys/sysevent/Makefile.in b/spl/include/sys/sysevent/Makefile.in
deleted file mode 100644
index 32056b6..0000000
--- a/spl/include/sys/sysevent/Makefile.in
+++ /dev/null
@@ -1,622 +0,0 @@ 
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = { \
-  if test -z '$(MAKELEVEL)'; then \
-    false; \
-  elif test -n '$(MAKE_HOST)'; then \
-    true; \
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
-    true; \
-  else \
-    false; \
-  fi; \
-}
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = include/sys/sysevent
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
-	$(top_srcdir)/config/ltoptions.m4 \
-	$(top_srcdir)/config/ltsugar.m4 \
-	$(top_srcdir)/config/ltversion.m4 \
-	$(top_srcdir)/config/lt~obsolete.m4 \
-	$(top_srcdir)/config/spl-build.m4 \
-	$(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
-	$(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/spl_config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__kernel_HEADERS_DIST =  \
-	$(top_srcdir)/include/sys/sysevent/eventdefs.h
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(kerneldir)"
-HEADERS = $(kernel_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALIEN = @ALIEN@
-ALIEN_VERSION = @ALIEN_VERSION@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEBUG_CFLAGS = @DEBUG_CFLAGS@
-DEBUG_KMEM = @DEBUG_KMEM@
-DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
-DEBUG_SPL = @DEBUG_SPL@
-DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DPKG = @DPKG@
-DPKGBUILD = @DPKGBUILD@
-DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
-DPKG_VERSION = @DPKG_VERSION@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_ALIEN = @HAVE_ALIEN@
-HAVE_DPKG = @HAVE_DPKG@
-HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
-HAVE_RPM = @HAVE_RPM@
-HAVE_RPMBUILD = @HAVE_RPMBUILD@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-KERNELCPPFLAGS = @KERNELCPPFLAGS@
-KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LINUX = @LINUX@
-LINUX_OBJ = @LINUX_OBJ@
-LINUX_SYMBOLS = @LINUX_SYMBOLS@
-LINUX_VERSION = @LINUX_VERSION@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-RELEASE = @RELEASE@
-RPM = @RPM@
-RPMBUILD = @RPMBUILD@
-RPMBUILD_VERSION = @RPMBUILD_VERSION@
-RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
-RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
-RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
-RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
-RPM_SPEC_DIR = @RPM_SPEC_DIR@
-RPM_VERSION = @RPM_VERSION@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SPL_CONFIG = @SPL_CONFIG@
-SPL_META_ALIAS = @SPL_META_ALIAS@
-SPL_META_AUTHOR = @SPL_META_AUTHOR@
-SPL_META_DATA = @SPL_META_DATA@
-SPL_META_LICENSE = @SPL_META_LICENSE@
-SPL_META_LT_AGE = @SPL_META_LT_AGE@
-SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
-SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
-SPL_META_NAME = @SPL_META_NAME@
-SPL_META_RELEASE = @SPL_META_RELEASE@
-SPL_META_VERSION = @SPL_META_VERSION@
-SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
-SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
-SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
-SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
-STRIP = @STRIP@
-VENDOR = @VENDOR@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-runstatedir = @runstatedir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-COMMON_H = 
-KERNEL_H = \
-	$(top_srcdir)/include/sys/sysevent/eventdefs.h
-
-USER_H = 
-EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
-@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/sysevent
-@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/sysevent/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu include/sys/sysevent/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-kernelHEADERS: $(kernel_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
-	done
-
-uninstall-kernelHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(kerneldir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-kernelHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-kernelHEADERS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool cscopelist-am ctags ctags-am distclean \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-kernelHEADERS install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-kernelHEADERS
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/spl/include/sys/sysevent/eventdefs.h b/spl/include/sys/sysevent/eventdefs.h
deleted file mode 100644
index 592c78a..0000000
--- a/spl/include/sys/sysevent/eventdefs.h
+++ /dev/null
@@ -1,28 +0,0 @@ 
-/*****************************************************************************\
- *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- *  Copyright (C) 2007 The Regents of the University of California.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
- *  UCRL-CODE-235197
- *
- *  This file is part of the SPL, Solaris Porting Layer.
- *  For details, see <http://zfsonlinux.org/>.
- *
- *  The SPL is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  The SPL is distributed in the hope that it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
-\*****************************************************************************/
-
-#ifndef	_SPL_SYSEVENT_EVENTDEFS_H
-#define	_SPL_SYSEVENT_EVENTDEFS_H
-
-#endif /* _SPL_SYSEVENT_EVENTDEFS_H */
diff --git a/spl/include/sys/sysmacros.h b/spl/include/sys/sysmacros.h
index a4a9f3e..c5c691b 100644
--- a/spl/include/sys/sysmacros.h
+++ b/spl/include/sys/sysmacros.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SYSMACROS_H
-#define _SPL_SYSMACROS_H
+#define	_SPL_SYSMACROS_H
 
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -39,120 +39,122 @@ 
 #endif
 
 #ifndef _KERNEL
-#define _KERNEL				__KERNEL__
+#define	_KERNEL				__KERNEL__
 #endif
 
-#define FALSE				0
-#define TRUE				1
-
-#define INT8_MAX			(127)
-#define INT8_MIN			(-128)
-#define UINT8_MAX			(255)
-#define UINT8_MIN			(0)
-
-#define INT16_MAX			(32767)
-#define INT16_MIN			(-32768)
-#define UINT16_MAX			(65535)
-#define UINT16_MIN			(0)
-
-#define INT32_MAX			INT_MAX
-#define INT32_MIN			INT_MIN
-#define UINT32_MAX			UINT_MAX
-#define UINT32_MIN			UINT_MIN
-
-#define INT64_MAX			LLONG_MAX
-#define INT64_MIN			LLONG_MIN
-#define UINT64_MAX			ULLONG_MAX
-#define UINT64_MIN			ULLONG_MIN
-
-#define NBBY				8
-#define ENOTSUP				EOPNOTSUPP
-
-#define MAXMSGLEN			256
-#define MAXNAMELEN			256
-#define MAXPATHLEN			PATH_MAX
-#define MAXOFFSET_T			LLONG_MAX
-#define MAXBSIZE			8192
-#define DEV_BSIZE			512
-#define DEV_BSHIFT			9 /* log2(DEV_BSIZE) */
-
-#define proc_pageout			NULL
-#define curproc				current
-#define max_ncpus			num_possible_cpus()
-#define boot_ncpus			num_online_cpus()
-#define CPU_SEQID			smp_processor_id()
-#define _NOTE(x)
-#define is_system_labeled()		0
+#define	FALSE				0
+#define	TRUE				1
+
+#define	INT8_MAX			(127)
+#define	INT8_MIN			(-128)
+#define	UINT8_MAX			(255)
+#define	UINT8_MIN			(0)
+
+#define	INT16_MAX			(32767)
+#define	INT16_MIN			(-32768)
+#define	UINT16_MAX			(65535)
+#define	UINT16_MIN			(0)
+
+#define	INT32_MAX			INT_MAX
+#define	INT32_MIN			INT_MIN
+#define	UINT32_MAX			UINT_MAX
+#define	UINT32_MIN			UINT_MIN
+
+#define	INT64_MAX			LLONG_MAX
+#define	INT64_MIN			LLONG_MIN
+#define	UINT64_MAX			ULLONG_MAX
+#define	UINT64_MIN			ULLONG_MIN
+
+#define	NBBY				8
+#define	ENOTSUP				EOPNOTSUPP
+
+#define	MAXMSGLEN			256
+#define	MAXNAMELEN			256
+#define	MAXPATHLEN			PATH_MAX
+#define	MAXOFFSET_T			LLONG_MAX
+#define	MAXBSIZE			8192
+#define	DEV_BSIZE			512
+#define	DEV_BSHIFT			9 /* log2(DEV_BSIZE) */
+
+#define	proc_pageout			NULL
+#define	curproc				current
+#define	max_ncpus			num_possible_cpus()
+#define	boot_ncpus			num_online_cpus()
+#define	CPU_SEQID			smp_processor_id()
+#define	_NOTE(x)
+#define	is_system_labeled()		0
 
 #ifndef RLIM64_INFINITY
-#define RLIM64_INFINITY			(~0ULL)
+#define	RLIM64_INFINITY			(~0ULL)
 #endif
 
-/* 0..MAX_PRIO-1:		Process priority
+/*
+ * 0..MAX_PRIO-1:		Process priority
  * 0..MAX_RT_PRIO-1:		RT priority tasks
  * MAX_RT_PRIO..MAX_PRIO-1:	SCHED_NORMAL tasks
  *
  * Treat shim tasks as SCHED_NORMAL tasks
  */
-#define minclsyspri			(MAX_PRIO-1)
-#define maxclsyspri			(MAX_RT_PRIO)
-#define defclsyspri			(DEFAULT_PRIO)
+#define	minclsyspri			(MAX_PRIO-1)
+#define	maxclsyspri			(MAX_RT_PRIO)
+#define	defclsyspri			(DEFAULT_PRIO)
 
 #ifndef NICE_TO_PRIO
-#define NICE_TO_PRIO(nice)		(MAX_RT_PRIO + (nice) + 20)
+#define	NICE_TO_PRIO(nice)		(MAX_RT_PRIO + (nice) + 20)
 #endif
 #ifndef PRIO_TO_NICE
-#define PRIO_TO_NICE(prio)		((prio) - MAX_RT_PRIO - 20)
+#define	PRIO_TO_NICE(prio)		((prio) - MAX_RT_PRIO - 20)
 #endif
 
 /*
  * Missing macros
  */
 #ifndef PAGESIZE
-#define PAGESIZE			PAGE_SIZE
+#define	PAGESIZE			PAGE_SIZE
 #endif
 
 #ifndef PAGESHIFT
-#define PAGESHIFT			PAGE_SHIFT
+#define	PAGESHIFT			PAGE_SHIFT
 #endif
 
 /* from Solaris sys/byteorder.h */
-#define BSWAP_8(x)	((x) & 0xff)
-#define BSWAP_16(x)	((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
-#define BSWAP_32(x)	((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
-#define BSWAP_64(x)	((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
+#define	BSWAP_8(x)	((x) & 0xff)
+#define	BSWAP_16(x)	((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
+#define	BSWAP_32(x)	((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
+#define	BSWAP_64(x)	((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
 
-/* Map some simple functions.
+/*
+ * Map some simple functions.
  */
-#define bzero(ptr,size)			memset(ptr,0,size)
-#define bcopy(src,dest,size)		memmove(dest,src,size)
-#define bcmp(src,dest,size)		memcmp((src), (dest), (size_t)(size))
+#define	bzero(ptr, size)		memset(ptr, 0, size)
+#define	bcopy(src, dest, size)		memmove(dest, src, size)
+#define	bcmp(src, dest, size)		memcmp((src), (dest), (size_t)(size))
 
 /* Dtrace probes do not exist in the linux kernel */
 #ifdef DTRACE_PROBE
 #undef  DTRACE_PROBE
 #endif  /* DTRACE_PROBE */
-#define DTRACE_PROBE(a)					((void)0)
+#define	DTRACE_PROBE(a)					((void)0)
 
 #ifdef DTRACE_PROBE1
 #undef  DTRACE_PROBE1
 #endif  /* DTRACE_PROBE1 */
-#define DTRACE_PROBE1(a, b, c)				((void)0)
+#define	DTRACE_PROBE1(a, b, c)				((void)0)
 
 #ifdef DTRACE_PROBE2
 #undef  DTRACE_PROBE2
 #endif  /* DTRACE_PROBE2 */
-#define DTRACE_PROBE2(a, b, c, d, e)			((void)0)
+#define	DTRACE_PROBE2(a, b, c, d, e)			((void)0)
 
 #ifdef DTRACE_PROBE3
 #undef  DTRACE_PROBE3
 #endif  /* DTRACE_PROBE3 */
-#define DTRACE_PROBE3(a, b, c, d, e, f, g)		((void)0)
+#define	DTRACE_PROBE3(a, b, c, d, e, f, g)		((void)0)
 
 #ifdef DTRACE_PROBE4
 #undef  DTRACE_PROBE4
 #endif  /* DTRACE_PROBE4 */
-#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)	((void)0)
+#define	DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)	((void)0)
 
 /* Missing globals */
 extern char spl_version[32];
@@ -167,39 +169,39 @@  extern void spl_cleanup(void);
 #define	lowbit(x)		__ffs(x)
 
 #define	highbit64(x)		fls64(x)
-#define	makedevice(maj,min)	makedev(maj,min)
+#define	makedevice(maj, min)	makedev(maj, min)
 
 /* common macros */
 #ifndef MIN
-#define MIN(a, b)		((a) < (b) ? (a) : (b))
+#define	MIN(a, b)		((a) < (b) ? (a) : (b))
 #endif
 #ifndef MAX
-#define MAX(a, b)		((a) < (b) ? (b) : (a))
+#define	MAX(a, b)		((a) < (b) ? (b) : (a))
 #endif
 #ifndef ABS
-#define ABS(a)			((a) < 0 ? -(a) : (a))
+#define	ABS(a)			((a) < 0 ? -(a) : (a))
 #endif
 #ifndef DIV_ROUND_UP
-#define DIV_ROUND_UP(n,d)	(((n) + (d) - 1) / (d))
+#define	DIV_ROUND_UP(n, d)	(((n) + (d) - 1) / (d))
 #endif
 #ifndef roundup
-#define roundup(x, y)		((((x) + ((y) - 1)) / (y)) * (y))
+#define	roundup(x, y)		((((x) + ((y) - 1)) / (y)) * (y))
 #endif
 #ifndef howmany
-#define howmany(x, y)		(((x) + ((y) - 1)) / (y))
+#define	howmany(x, y)		(((x) + ((y) - 1)) / (y))
 #endif
 
 /*
  * Compatibility macros/typedefs needed for Solaris -> Linux port
  */
-#define P2ALIGN(x, align)	((x) & -(align))
-#define P2CROSS(x, y, align)	(((x) ^ (y)) > (align) - 1)
-#define P2ROUNDUP(x, align)	((((x) - 1) | ((align) - 1)) + 1)
-#define P2PHASE(x, align)	((x) & ((align) - 1))
-#define P2NPHASE(x, align)	(-(x) & ((align) - 1))
-#define ISP2(x)			(((x) & ((x) - 1)) == 0)
-#define IS_P2ALIGNED(v, a)	((((uintptr_t)(v)) & ((uintptr_t)(a) - 1))==0)
-#define P2BOUNDARY(off, len, align) \
+#define	P2ALIGN(x, align)	((x) & -(align))
+#define	P2CROSS(x, y, align)	(((x) ^ (y)) > (align) - 1)
+#define	P2ROUNDUP(x, align)	((((x) - 1) | ((align) - 1)) + 1)
+#define	P2PHASE(x, align)	((x) & ((align) - 1))
+#define	P2NPHASE(x, align)	(-(x) & ((align) - 1))
+#define	ISP2(x)			(((x) & ((x) - 1)) == 0)
+#define	IS_P2ALIGNED(v, a)	((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
+#define	P2BOUNDARY(off, len, align) \
 				(((off) ^ ((off) + (len) - 1)) > (align) - 1)
 
 /*
@@ -214,28 +216,28 @@  extern void spl_cleanup(void);
  * or
  * P2ROUNDUP_TYPED(x, PAGESIZE, uint64_t)
  */
-#define P2ALIGN_TYPED(x, align, type)   \
-        ((type)(x) & -(type)(align))
-#define P2PHASE_TYPED(x, align, type)   \
-        ((type)(x) & ((type)(align) - 1))
-#define P2NPHASE_TYPED(x, align, type)  \
-        (-(type)(x) & ((type)(align) - 1))
-#define P2ROUNDUP_TYPED(x, align, type) \
-        ((((type)(x) - 1) | ((type)(align) - 1)) + 1)
-#define P2END_TYPED(x, align, type)     \
-        (-(~(type)(x) & -(type)(align)))
-#define P2PHASEUP_TYPED(x, align, phase, type)  \
-        ((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align)))
-#define P2CROSS_TYPED(x, y, align, type)        \
-        (((type)(x) ^ (type)(y)) > (type)(align) - 1)
-#define P2SAMEHIGHBIT_TYPED(x, y, type) \
-        (((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))
+#define	P2ALIGN_TYPED(x, align, type)   \
+	((type)(x) & -(type)(align))
+#define	P2PHASE_TYPED(x, align, type)   \
+	((type)(x) & ((type)(align) - 1))
+#define	P2NPHASE_TYPED(x, align, type)  \
+	(-(type)(x) & ((type)(align) - 1))
+#define	P2ROUNDUP_TYPED(x, align, type) \
+	((((type)(x) - 1) | ((type)(align) - 1)) + 1)
+#define	P2END_TYPED(x, align, type)     \
+	(-(~(type)(x) & -(type)(align)))
+#define	P2PHASEUP_TYPED(x, align, phase, type)  \
+	((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align)))
+#define	P2CROSS_TYPED(x, y, align, type)	\
+	(((type)(x) ^ (type)(y)) > (type)(align) - 1)
+#define	P2SAMEHIGHBIT_TYPED(x, y, type) \
+	(((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))
 
 #if defined(_KERNEL) && !defined(_KMEMUSER) && !defined(offsetof)
 
 /* avoid any possibility of clashing with <stddef.h> version */
 
-#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
+#define	offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
 #endif
 
 #endif  /* _SPL_SYSMACROS_H */
diff --git a/spl/include/sys/systeminfo.h b/spl/include/sys/systeminfo.h
index 5c0cc46..e80b9d4 100644
--- a/spl/include/sys/systeminfo.h
+++ b/spl/include/sys/systeminfo.h
@@ -23,14 +23,14 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SYSTEMINFO_H
-#define _SPL_SYSTEMINFO_H
+#define	_SPL_SYSTEMINFO_H
 
-#define HW_HOSTID_LEN		11		/* minimum buffer size needed */
+#define	HW_HOSTID_LEN		11		/* minimum buffer size needed */
 						/* to hold a decimal or hex */
 						/* hostid string */
 
 /* Supplemental definitions for Linux. */
-#define HW_HOSTID_PATH		"/etc/hostid"   /* binary configuration file */
-#define HW_HOSTID_MASK		0xFFFFFFFF 	/* significant hostid bits */
+#define	HW_HOSTID_PATH		"/etc/hostid"   /* binary configuration file */
+#define	HW_HOSTID_MASK		0xFFFFFFFF 	/* significant hostid bits */
 
 #endif /* SPL_SYSTEMINFO_H */
diff --git a/spl/include/sys/systm.h b/spl/include/sys/systm.h
index 3336fb3..358cc6f 100644
--- a/spl/include/sys/systm.h
+++ b/spl/include/sys/systm.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SYSTM_H
-#define _SPL_SYSTM_H
+#define	_SPL_SYSTM_H
 
 #include <sys/sunddi.h>
 
diff --git a/spl/include/sys/t_lock.h b/spl/include/sys/t_lock.h
index 6c159f9..6cb8513 100644
--- a/spl/include/sys/t_lock.h
+++ b/spl/include/sys/t_lock.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_T_LOCK_H
-#define _SPL_T_LOCK_H
+#define	_SPL_T_LOCK_H
 
 #include <sys/param.h>
 #include <sys/mutex.h>
diff --git a/spl/include/sys/taskq.h b/spl/include/sys/taskq.h
index c5ccec7..4d90a35 100644
--- a/spl/include/sys/taskq.h
+++ b/spl/include/sys/taskq.h
@@ -94,7 +94,7 @@  typedef struct taskq {
 	taskqid_t		tq_lowest_id;	/* lowest pend/work id */
 	struct list_head	tq_free_list;	/* free taskq_ent_t's */
 	struct list_head	tq_pend_list;	/* pending taskq_ent_t's */
-	struct list_head	tq_prio_list;	/* priority pending taskq_ent_t's */
+	struct list_head	tq_prio_list;	/* priority taskq_ent_t's */
 	struct list_head	tq_delay_list;	/* delayed taskq_ent_t's */
 	struct list_head	tq_taskqs;	/* all taskq_t's */
 	spl_wait_queue_head_t	tq_work_waitq;	/* new work waitq */
diff --git a/spl/include/sys/thread.h b/spl/include/sys/thread.h
index 433a076..5894db7 100644
--- a/spl/include/sys/thread.h
+++ b/spl/include/sys/thread.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_THREAD_H
-#define _SPL_THREAD_H
+#define	_SPL_THREAD_H
 
 #include <linux/module.h>
 #include <linux/mm.h>
@@ -36,28 +36,30 @@ 
 /*
  * Thread interfaces
  */
-#define TP_MAGIC			0x53535353
+#define	TP_MAGIC			0x53535353
 
-#define TS_SLEEP			TASK_INTERRUPTIBLE
-#define TS_RUN				TASK_RUNNING
-#define TS_ZOMB				EXIT_ZOMBIE
-#define TS_STOPPED			TASK_STOPPED
+#define	TS_SLEEP			TASK_INTERRUPTIBLE
+#define	TS_RUN				TASK_RUNNING
+#define	TS_ZOMB				EXIT_ZOMBIE
+#define	TS_STOPPED			TASK_STOPPED
 
 typedef void (*thread_func_t)(void *);
 
-#define thread_create(stk, stksize, func, arg, len, pp, state, pri)      \
-	__thread_create(stk, stksize, (thread_func_t)func,               \
-	                #func, arg, len, pp, state, pri)
-#define thread_exit()			__thread_exit()
-#define thread_join(t)			VERIFY(0)
-#define curthread			current
-#define getcomm()			current->comm
-#define getpid()			current->pid
+/* BEGIN CSTYLED */
+#define	thread_create(stk, stksize, func, arg, len, pp, state, pri)	\
+	__thread_create(stk, stksize, (thread_func_t)func,		\
+	#func, arg, len, pp, state, pri)
+/* END CSTYLED */
+
+#define	thread_exit()			__thread_exit()
+#define	thread_join(t)			VERIFY(0)
+#define	curthread			current
+#define	getcomm()			current->comm
+#define	getpid()			current->pid
 
 extern kthread_t *__thread_create(caddr_t stk, size_t  stksize,
-                                  thread_func_t func, const char *name,
-                                  void *args, size_t len, proc_t *pp,
-                                  int state, pri_t pri);
+    thread_func_t func, const char *name, void *args, size_t len, proc_t *pp,
+    int state, pri_t pri);
 extern void __thread_exit(void);
 extern struct task_struct *spl_kthread_create(int (*func)(void *),
 			void *data, const char namefmt[], ...);
diff --git a/spl/include/sys/timer.h b/spl/include/sys/timer.h
index 33d577e..0d1f362 100644
--- a/spl/include/sys/timer.h
+++ b/spl/include/sys/timer.h
@@ -23,38 +23,37 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_TIMER_H
-#define _SPL_TIMER_H
+#define	_SPL_TIMER_H
 
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
 
-#define lbolt				((clock_t)jiffies)
-#define lbolt64				((int64_t)get_jiffies_64())
+#define	lbolt				((clock_t)jiffies)
+#define	lbolt64				((int64_t)get_jiffies_64())
 
-#define ddi_get_lbolt()			((clock_t)jiffies)
-#define ddi_get_lbolt64()		((int64_t)get_jiffies_64())
+#define	ddi_get_lbolt()			((clock_t)jiffies)
+#define	ddi_get_lbolt64()		((int64_t)get_jiffies_64())
 
-#define ddi_time_before(a, b)		(typecheck(clock_t, a) && \
+#define	ddi_time_before(a, b)		(typecheck(clock_t, a) && \
 					typecheck(clock_t, b) && \
 					((a) - (b) < 0))
-#define ddi_time_after(a, b)		ddi_time_before(b, a)
-#define ddi_time_before_eq(a, b)	(!ddi_time_after(a, b))
-#define ddi_time_after_eq(a, b)		ddi_time_before_eq(b, a)
+#define	ddi_time_after(a, b)		ddi_time_before(b, a)
+#define	ddi_time_before_eq(a, b)	(!ddi_time_after(a, b))
+#define	ddi_time_after_eq(a, b)		ddi_time_before_eq(b, a)
 
-#define ddi_time_before64(a, b)		(typecheck(int64_t, a) && \
+#define	ddi_time_before64(a, b)		(typecheck(int64_t, a) && \
 					typecheck(int64_t, b) && \
 					((a) - (b) < 0))
-#define ddi_time_after64(a, b)		ddi_time_before64(b, a)
-#define ddi_time_before_eq64(a, b)	(!ddi_time_after64(a, b))
-#define ddi_time_after_eq64(a, b)	ddi_time_before_eq64(b, a)
+#define	ddi_time_after64(a, b)		ddi_time_before64(b, a)
+#define	ddi_time_before_eq64(a, b)	(!ddi_time_after64(a, b))
+#define	ddi_time_after_eq64(a, b)	ddi_time_before_eq64(b, a)
 
-#define delay(ticks)			schedule_timeout_uninterruptible(ticks)
+#define	delay(ticks)			schedule_timeout_uninterruptible(ticks)
 
-#define SEC_TO_TICK(sec)		((sec) * HZ)
-#define MSEC_TO_TICK(ms)		msecs_to_jiffies(ms)
-#define USEC_TO_TICK(us)		usecs_to_jiffies(us)
-#define NSEC_TO_TICK(ns)		usecs_to_jiffies(ns / NSEC_PER_USEC)
+#define	SEC_TO_TICK(sec)		((sec) * HZ)
+#define	MSEC_TO_TICK(ms)		msecs_to_jiffies(ms)
+#define	USEC_TO_TICK(us)		usecs_to_jiffies(us)
+#define	NSEC_TO_TICK(ns)		usecs_to_jiffies(ns / NSEC_PER_USEC)
 
 #endif  /* _SPL_TIMER_H */
-
diff --git a/spl/include/sys/tsd.h b/spl/include/sys/tsd.h
index 1894a82..48eaa80 100644
--- a/spl/include/sys/tsd.h
+++ b/spl/include/sys/tsd.h
@@ -22,14 +22,14 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_TSD_H
-#define _SPL_TSD_H
+#define	_SPL_TSD_H
 
 #include <sys/types.h>
 
-#define TSD_HASH_TABLE_BITS_DEFAULT	9
-#define TSD_KEYS_MAX			32768
-#define DTOR_PID			(PID_MAX_LIMIT+1)
-#define PID_KEY				(TSD_KEYS_MAX+1)
+#define	TSD_HASH_TABLE_BITS_DEFAULT	9
+#define	TSD_KEYS_MAX			32768
+#define	DTOR_PID			(PID_MAX_LIMIT+1)
+#define	PID_KEY				(TSD_KEYS_MAX+1)
 
 typedef void (*dtor_func_t)(void *);
 
diff --git a/spl/include/sys/types.h b/spl/include/sys/types.h
index d718ca0fa..2fe63b7 100644
--- a/spl/include/sys/types.h
+++ b/spl/include/sys/types.h
@@ -29,14 +29,14 @@ 
 #include <sys/sysmacros.h>
 
 #ifndef ULLONG_MAX
-#define ULLONG_MAX			(~0ULL)
+#define	ULLONG_MAX			(~0ULL)
 #endif
 
 #ifndef LLONG_MAX
-#define LLONG_MAX			((long long)(~0ULL>>1))
+#define	LLONG_MAX			((long long)(~0ULL>>1))
 #endif
 
-typedef enum { B_FALSE=0, B_TRUE=1 }	boolean_t;
+typedef enum { B_FALSE = 0, B_TRUE = 1 }	boolean_t;
 typedef unsigned long			intptr_t;
 typedef unsigned long			ulong_t;
 typedef unsigned int			uint_t;
diff --git a/spl/include/sys/u8_textprep.h b/spl/include/sys/u8_textprep.h
index 0a21c70..e10cb19 100644
--- a/spl/include/sys/u8_textprep.h
+++ b/spl/include/sys/u8_textprep.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_U8_TEXTPREP_H
-#define _SPL_U8_TEXTPREP_H
+#define	_SPL_U8_TEXTPREP_H
 
 #endif /* SPL_U8_TEXTPREP_H */
diff --git a/spl/include/sys/uio.h b/spl/include/sys/uio.h
index 404c037..764beb9 100644
--- a/spl/include/sys/uio.h
+++ b/spl/include/sys/uio.h
@@ -24,7 +24,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_UIO_H
-#define _SPL_UIO_H
+#define	_SPL_UIO_H
 
 #include <linux/uio.h>
 #include <linux/blkdev.h>
@@ -34,15 +34,15 @@ 
 typedef struct iovec iovec_t;
 
 typedef enum uio_rw {
-	UIO_READ =	0,
-	UIO_WRITE =	1,
+	UIO_READ =		0,
+	UIO_WRITE =		1,
 } uio_rw_t;
 
 typedef enum uio_seg {
-	UIO_USERSPACE =	0,
-	UIO_SYSSPACE =	1,
-	UIO_USERISPACE=	2,
-	UIO_BVEC =	3,
+	UIO_USERSPACE =		0,
+	UIO_SYSSPACE =		1,
+	UIO_USERISPACE =	2,
+	UIO_BVEC =		3,
 } uio_seg_t;
 
 typedef struct uio {
@@ -71,7 +71,7 @@  typedef enum xuio_type {
 } xuio_type_t;
 
 
-#define UIOA_IOV_MAX    16
+#define	UIOA_IOV_MAX    16
 
 typedef struct uioa_page_s {
 	int	uioa_pfncnt;
@@ -100,7 +100,7 @@  typedef struct xuio {
 	} xu_ext;
 } xuio_t;
 
-#define XUIO_XUZC_PRIV(xuio)	xuio->xu_ext.xu_zc.xu_zc_priv
-#define XUIO_XUZC_RW(xuio)	xuio->xu_ext.xu_zc.xu_zc_rw
+#define	XUIO_XUZC_PRIV(xuio)	xuio->xu_ext.xu_zc.xu_zc_priv
+#define	XUIO_XUZC_RW(xuio)	xuio->xu_ext.xu_zc.xu_zc_rw
 
 #endif /* SPL_UIO_H */
diff --git a/spl/include/sys/unistd.h b/spl/include/sys/unistd.h
index e1d93c6..9391d1a 100644
--- a/spl/include/sys/unistd.h
+++ b/spl/include/sys/unistd.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_UNISTD_H
-#define _SPL_UNISTD_H
+#define	_SPL_UNISTD_H
 
 #endif /* SPL_UNISTD_H */
diff --git a/spl/include/sys/user.h b/spl/include/sys/user.h
index 2b25dd3..3321407 100644
--- a/spl/include/sys/user.h
+++ b/spl/include/sys/user.h
@@ -21,7 +21,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_USER_H
-#define _SPL_USER_H
+#define	_SPL_USER_H
 
 /*
  * We have uf_info_t for areleasef(). We implement areleasef() using a global
@@ -37,6 +37,6 @@ 
 struct uf_info;
 typedef struct uf_info uf_info_t;
 
-#define P_FINFO(x) ((uf_info_t *)x)
+#define	P_FINFO(x) ((uf_info_t *)x)
 
 #endif /* SPL_USER_H */
diff --git a/spl/include/sys/va_list.h b/spl/include/sys/va_list.h
index 9fa173b..388b4c9 100644
--- a/spl/include/sys/va_list.h
+++ b/spl/include/sys/va_list.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VA_LIST_H
-#define _SPL_VA_LIST_H
+#define	_SPL_VA_LIST_H
 
 #endif /* SPL_VA_LIST_H */
diff --git a/spl/include/sys/varargs.h b/spl/include/sys/varargs.h
index bf360ff..82185bc 100644
--- a/spl/include/sys/varargs.h
+++ b/spl/include/sys/varargs.h
@@ -23,8 +23,8 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VARARGS_H
-#define _SPL_VARARGS_H
+#define	_SPL_VARARGS_H
 
-#define __va_list                       va_list
+#define	__va_list	va_list
 
 #endif /* SPL_VARARGS_H */
diff --git a/spl/include/sys/vfs.h b/spl/include/sys/vfs.h
index f01dc11..d6fc1c3 100644
--- a/spl/include/sys/vfs.h
+++ b/spl/include/sys/vfs.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ZFS_H
-#define _SPL_ZFS_H
+#define	_SPL_ZFS_H
 
 #include <linux/mount.h>
 #include <linux/fs.h>
@@ -40,7 +40,7 @@  typedef struct spl_fid {
 		long fid_pad;
 		struct {
 			ushort_t len;		/* length of data in bytes */
-			char     data[MAXFIDSZ];/* data (variable len) */
+			char data[MAXFIDSZ];	/* data (variable len) */
 		} _fid;
 	} un;
 } fid_t;
diff --git a/spl/include/sys/vfs_opreg.h b/spl/include/sys/vfs_opreg.h
index d3540c5..5909504 100644
--- a/spl/include/sys/vfs_opreg.h
+++ b/spl/include/sys/vfs_opreg.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_OPREG_H
-#define _SPL_OPREG_H
+#define	_SPL_OPREG_H
 
 #endif /* SPL_OPREG_H */
diff --git a/spl/include/sys/vmsystm.h b/spl/include/sys/vmsystm.h
index 9d334fe..059512b 100644
--- a/spl/include/sys/vmsystm.h
+++ b/spl/include/sys/vmsystm.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VMSYSTM_H
-#define _SPL_VMSYSTM_H
+#define	_SPL_VMSYSTM_H
 
 #include <linux/mmzone.h>
 #include <linux/mm.h>
@@ -48,9 +48,9 @@  copyin(const void *from, void *to, size_t len)
 {
 	/* On error copyin routine returns -1 */
 	if (xcopyin(from, to, len))
-		return -1;
+		return (-1);
 
-	return 0;
+	return (0);
 }
 
 static __inline__ int
@@ -58,9 +58,9 @@  copyout(const void *from, void *to, size_t len)
 {
 	/* On error copyout routine returns -1 */
 	if (xcopyout(from, to, len))
-		return -1;
+		return (-1);
 
-	return 0;
+	return (0);
 }
 
 static __inline__ int
@@ -69,7 +69,7 @@  copyinstr(const void *from, void *to, size_t len, size_t *done)
 	size_t rc;
 
 	if (len == 0)
-		return -ENAMETOOLONG;
+		return (-ENAMETOOLONG);
 
 	/* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */
 
@@ -78,7 +78,7 @@  copyinstr(const void *from, void *to, size_t len, size_t *done)
 	if (done != NULL)
 		*done = rc;
 
-	return 0;
+	return (0);
 }
 
 #endif /* SPL_VMSYSTM_H */
diff --git a/spl/include/sys/vnode.h b/spl/include/sys/vnode.h
index 0b857d3..0ed4794 100644
--- a/spl/include/sys/vnode.h
+++ b/spl/include/sys/vnode.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VNODE_H
-#define _SPL_VNODE_H
+#define	_SPL_VNODE_H
 
 #include <linux/module.h>
 #include <linux/syscalls.h>
@@ -49,25 +49,25 @@ 
  * was properly split in to O_SYNC and O_DSYNC respectively.
  */
 #ifndef O_DSYNC
-#define O_DSYNC		O_SYNC
+#define	O_DSYNC		O_SYNC
 #endif
 
-#define FREAD		1
-#define FWRITE		2
-#define FCREAT		O_CREAT
-#define FTRUNC		O_TRUNC
-#define FOFFMAX		O_LARGEFILE
-#define FSYNC		O_SYNC
-#define FDSYNC		O_DSYNC
-#define FRSYNC		O_SYNC
-#define FEXCL		O_EXCL
-#define FDIRECT		O_DIRECT
-#define FAPPEND		O_APPEND
+#define	FREAD		1
+#define	FWRITE		2
+#define	FCREAT		O_CREAT
+#define	FTRUNC		O_TRUNC
+#define	FOFFMAX		O_LARGEFILE
+#define	FSYNC		O_SYNC
+#define	FDSYNC		O_DSYNC
+#define	FRSYNC		O_SYNC
+#define	FEXCL		O_EXCL
+#define	FDIRECT		O_DIRECT
+#define	FAPPEND		O_APPEND
 
-#define FNODSYNC	0x10000 /* fsync pseudo flag */
-#define FNOFOLLOW	0x20000 /* don't follow symlinks */
+#define	FNODSYNC	0x10000 /* fsync pseudo flag */
+#define	FNOFOLLOW	0x20000 /* don't follow symlinks */
 
-#define F_FREESP	11 	/* Free file space */
+#define	F_FREESP	11 	/* Free file space */
 
 
 /*
@@ -79,30 +79,30 @@ 
 #undef AT_UID
 #undef AT_GID
 
-#define AT_MODE		ATTR_MODE
-#define AT_UID		ATTR_UID
-#define AT_GID		ATTR_GID
-#define AT_SIZE		ATTR_SIZE
-#define AT_ATIME	ATTR_ATIME
-#define AT_MTIME	ATTR_MTIME
-#define AT_CTIME	ATTR_CTIME
+#define	AT_MODE		ATTR_MODE
+#define	AT_UID		ATTR_UID
+#define	AT_GID		ATTR_GID
+#define	AT_SIZE		ATTR_SIZE
+#define	AT_ATIME	ATTR_ATIME
+#define	AT_MTIME	ATTR_MTIME
+#define	AT_CTIME	ATTR_CTIME
 
-#define ATTR_XVATTR	(1 << 31)
-#define AT_XVATTR	ATTR_XVATTR
+#define	ATTR_XVATTR	(1 << 31)
+#define	AT_XVATTR	ATTR_XVATTR
 
-#define ATTR_IATTR_MASK	(ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
+#define	ATTR_IATTR_MASK	(ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
 			ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_FILE)
 
-#define CRCREAT		0x01
-#define RMFILE		0x02
+#define	CRCREAT		0x01
+#define	RMFILE		0x02
 
-#define B_INVAL		0x01
-#define B_TRUNC		0x02
+#define	B_INVAL		0x01
+#define	B_TRUNC		0x02
 
-#define LOOKUP_DIR		0x01
-#define LOOKUP_XATTR		0x02
-#define CREATE_XATTR_DIR	0x04
-#define ATTR_NOACLCHECK		0x20
+#define	LOOKUP_DIR		0x01
+#define	LOOKUP_XATTR		0x02
+#define	CREATE_XATTR_DIR	0x04
+#define	ATTR_NOACLCHECK		0x20
 
 typedef enum vtype {
 	VNON		= 0,
@@ -121,8 +121,8 @@  typedef enum vtype {
 
 typedef struct vattr {
 	enum vtype	va_type;	/* vnode type */
-	u_int		va_mask;	/* attribute bit-mask */
-	u_short		va_mode;	/* acc mode */
+	uint_t		va_mask;	/* attribute bit-mask */
+	ushort_t	va_mode;	/* acc mode */
 	uid_t		va_uid;		/* owner uid */
 	gid_t		va_gid;		/* owner gid */
 	long		va_fsid;	/* fs id */
@@ -168,17 +168,15 @@  void vn_free(vnode_t *vp);
 extern vtype_t vn_mode_to_vtype(mode_t);
 extern mode_t vn_vtype_to_mode(vtype_t);
 extern int vn_open(const char *path, uio_seg_t seg, int flags, int mode,
-		   vnode_t **vpp, int x1, void *x2);
+    vnode_t **vpp, int x1, void *x2);
 extern int vn_openat(const char *path, uio_seg_t seg, int flags, int mode,
-		     vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd);
+    vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd);
 extern int vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len,
-		   offset_t off, uio_seg_t seg, int x1, rlim64_t x2,
-		   void *x3, ssize_t *residp);
+    offset_t off, uio_seg_t seg, int x1, rlim64_t x2,
+    void *x3, ssize_t *residp);
 extern int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4);
 extern int vn_seek(vnode_t *vp, offset_t o, offset_t *op, void *ct);
 
-extern int vn_remove(const char *path, uio_seg_t seg, int flags);
-extern int vn_rename(const char *path1, const char *path2, int x1);
 extern int vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4);
 extern int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4);
 extern int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag,
@@ -191,16 +189,16 @@  extern int vn_set_pwd(const char *filename);
 int spl_vn_init(void);
 void spl_vn_fini(void);
 
-#define VOP_CLOSE				vn_close
-#define VOP_SEEK				vn_seek
-#define VOP_GETATTR				vn_getattr
-#define VOP_FSYNC				vn_fsync
-#define VOP_SPACE				vn_space
-#define VOP_PUTPAGE(vp, o, s, f, x1, x2)	((void)0)
-#define vn_is_readonly(vp)			0
-#define getf					vn_getf
-#define releasef				vn_releasef
-#define areleasef				vn_areleasef
+#define	VOP_CLOSE				vn_close
+#define	VOP_SEEK				vn_seek
+#define	VOP_GETATTR				vn_getattr
+#define	VOP_FSYNC				vn_fsync
+#define	VOP_SPACE				vn_space
+#define	VOP_PUTPAGE(vp, o, s, f, x1, x2)	((void)0)
+#define	vn_is_readonly(vp)			0
+#define	getf					vn_getf
+#define	releasef				vn_releasef
+#define	areleasef				vn_areleasef
 
 extern vnode_t *rootdir;
 
diff --git a/spl/include/sys/zmod.h b/spl/include/sys/zmod.h
index 15b0bc8..c1d2524 100644
--- a/spl/include/sys/zmod.h
+++ b/spl/include/sys/zmod.h
@@ -20,7 +20,8 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
+ *
  *  z_compress_level/z_uncompress are nearly identical copies of the
  *  compress2/uncompress functions provided by the official zlib package
  *  available at http://zlib.net/.  The only changes made we to slightly
@@ -53,7 +54,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ZMOD_H
-#define _SPL_ZMOD_H
+#define	_SPL_ZMOD_H
 
 #include <sys/types.h>
 #include <linux/zlib.h>
diff --git a/spl/include/sys/zone.h b/spl/include/sys/zone.h
index 5a3c086..47e83ba 100644
--- a/spl/include/sys/zone.h
+++ b/spl/include/sys/zone.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_ZONE_H
-#define _SPL_ZONE_H
+#define	_SPL_ZONE_H
 
 #include <sys/byteorder.h>
 
diff --git a/spl/include/unistd.h b/spl/include/unistd.h
index e1d93c6..9391d1a 100644
--- a/spl/include/unistd.h
+++ b/spl/include/unistd.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_UNISTD_H
-#define _SPL_UNISTD_H
+#define	_SPL_UNISTD_H
 
 #endif /* SPL_UNISTD_H */
diff --git a/spl/include/util/Makefile.in b/spl/include/util/Makefile.in
index 86b7884..7f79e07 100644
--- a/spl/include/util/Makefile.in
+++ b/spl/include/util/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/util
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/util/qsort.h b/spl/include/util/qsort.h
index e55c4f8..de0d350 100644
--- a/spl/include/util/qsort.h
+++ b/spl/include/util/qsort.h
@@ -23,10 +23,10 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_QSORT_H
-#define _SPL_QSORT_H
+#define	_SPL_QSORT_H
 
 #include <linux/sort.h>
 
-#define qsort(base, num, size, cmp)	sort(base, num, size, cmp, NULL)
+#define	qsort(base, num, size, cmp)	sort(base, num, size, cmp, NULL)
 
 #endif /* SPL_QSORT_H */
diff --git a/spl/include/util/sscanf.h b/spl/include/util/sscanf.h
index 23f0b5d..10e669d 100644
--- a/spl/include/util/sscanf.h
+++ b/spl/include/util/sscanf.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_UTIL_SSCANF_H
-#define _SPL_UTIL_SSCANF_H
+#define	_SPL_UTIL_SSCANF_H
 
 #endif /* SPL_UTIL_SSCAN_H */
diff --git a/spl/include/vm/Makefile.in b/spl/include/vm/Makefile.in
index f3c78c1..d757da6 100644
--- a/spl/include/vm/Makefile.in
+++ b/spl/include/vm/Makefile.in
@@ -91,7 +91,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = include/vm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/include/vm/anon.h b/spl/include/vm/anon.h
index 9c9c239..049a326 100644
--- a/spl/include/vm/anon.h
+++ b/spl/include/vm/anon.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VM_ANON_H
-#define _SPL_VM_ANON_H
+#define	_SPL_VM_ANON_H
 
 #endif /* SPL_VM_ANON_H */
diff --git a/spl/include/vm/pvn.h b/spl/include/vm/pvn.h
index f3b3081..e56caf4 100644
--- a/spl/include/vm/pvn.h
+++ b/spl/include/vm/pvn.h
@@ -23,6 +23,6 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_VM_PVN_H
-#define _SPL_VM_PVN_H
+#define	_SPL_VM_PVN_H
 
 #endif /* SPL_VM_PVN_H */
diff --git a/spl/include/vm/seg_kmem.h b/spl/include/vm/seg_kmem.h
index 17df7b9..3ef2474 100644
--- a/spl/include/vm/seg_kmem.h
+++ b/spl/include/vm/seg_kmem.h
@@ -23,7 +23,7 @@ 
 \*****************************************************************************/
 
 #ifndef _SPL_SEG_KMEM_H
-#define _SPL_SEG_KMEM_H
+#define	_SPL_SEG_KMEM_H
 
 #include <sys/vmsystm.h>
 
diff --git a/spl/lib/Makefile.in b/spl/lib/Makefile.in
index 80ccfb4..c4ec3ea 100644
--- a/spl/lib/Makefile.in
+++ b/spl/lib/Makefile.in
@@ -99,7 +99,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = lib
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/man/Makefile.in b/spl/man/Makefile.in
index 42679a0..82f3cb2 100644
--- a/spl/man/Makefile.in
+++ b/spl/man/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = man
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/man/man1/Makefile.in b/spl/man/man1/Makefile.in
index c1a5913..100b20d 100644
--- a/spl/man/man1/Makefile.in
+++ b/spl/man/man1/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = man/man1
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/man/man5/Makefile.in b/spl/man/man5/Makefile.in
index d856b96..e15da91 100644
--- a/spl/man/man5/Makefile.in
+++ b/spl/man/man5/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = man/man5
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/module/spl/spl-atomic.c b/spl/module/spl/spl-atomic.c
index c46252c..4e1e42c 100644
--- a/spl/module/spl/spl-atomic.c
+++ b/spl/module/spl/spl-atomic.c
@@ -20,18 +20,12 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Atomic Implementation.
 \*****************************************************************************/
 
 #include <sys/atomic.h>
 
-#ifdef DEBUG_SUBSYSTEM
-#undef DEBUG_SUBSYSTEM
-#endif
-
-#define DEBUG_SUBSYSTEM S_ATOMIC
-
 #ifdef ATOMIC_SPINLOCK
 /* Global atomic lock declarations */
 DEFINE_SPINLOCK(atomic32_lock);
diff --git a/spl/module/spl/spl-condvar.c b/spl/module/spl/spl-condvar.c
index 80c2ef0..f0060bb 100644
--- a/spl/module/spl/spl-condvar.c
+++ b/spl/module/spl/spl-condvar.c
@@ -137,18 +137,47 @@  __cv_wait(kcondvar_t *cvp, kmutex_t *mp)
 EXPORT_SYMBOL(__cv_wait);
 
 void
+__cv_wait_io(kcondvar_t *cvp, kmutex_t *mp)
+{
+	cv_wait_common(cvp, mp, TASK_UNINTERRUPTIBLE, 1);
+}
+EXPORT_SYMBOL(__cv_wait_io);
+
+void
 __cv_wait_sig(kcondvar_t *cvp, kmutex_t *mp)
 {
 	cv_wait_common(cvp, mp, TASK_INTERRUPTIBLE, 0);
 }
 EXPORT_SYMBOL(__cv_wait_sig);
 
-void
-__cv_wait_io(kcondvar_t *cvp, kmutex_t *mp)
+#if defined(HAVE_IO_SCHEDULE_TIMEOUT)
+#define	spl_io_schedule_timeout(t)	io_schedule_timeout(t)
+#else
+static void
+__cv_wakeup(unsigned long data)
 {
-	cv_wait_common(cvp, mp, TASK_UNINTERRUPTIBLE, 1);
+	wake_up_process((struct task_struct *)data);
 }
-EXPORT_SYMBOL(__cv_wait_io);
+
+static long
+spl_io_schedule_timeout(long time_left)
+{
+	long expire_time = jiffies + time_left;
+	struct timer_list timer;
+
+	init_timer(&timer);
+	setup_timer(&timer, __cv_wakeup, (unsigned long)current);
+	timer.expires = expire_time;
+	add_timer(&timer);
+
+	io_schedule();
+
+	del_timer_sync(&timer);
+	time_left = expire_time - jiffies;
+
+	return (time_left < 0 ? 0 : time_left);
+}
+#endif
 
 /*
  * 'expire_time' argument is an absolute wall clock time in jiffies.
@@ -156,7 +185,7 @@  EXPORT_SYMBOL(__cv_wait_io);
  */
 static clock_t
 __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
-    int state)
+    int state, int io)
 {
 	DEFINE_WAIT(wait);
 	kmutex_t *m;
@@ -188,7 +217,10 @@  __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
 	 * race where 'cvp->cv_waiters > 0' but the list is empty.
 	 */
 	mutex_exit(mp);
-	time_left = schedule_timeout(time_left);
+	if (io)
+		time_left = spl_io_schedule_timeout(time_left);
+	else
+		time_left = schedule_timeout(time_left);
 
 	/* No more waiters a different mutex could be used */
 	if (atomic_dec_and_test(&cvp->cv_waiters)) {
@@ -214,14 +246,24 @@  __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
 clock_t
 __cv_timedwait(kcondvar_t *cvp, kmutex_t *mp, clock_t exp_time)
 {
-	return (__cv_timedwait_common(cvp, mp, exp_time, TASK_UNINTERRUPTIBLE));
+	return (__cv_timedwait_common(cvp, mp, exp_time,
+	    TASK_UNINTERRUPTIBLE, 0));
 }
 EXPORT_SYMBOL(__cv_timedwait);
 
 clock_t
+__cv_timedwait_io(kcondvar_t *cvp, kmutex_t *mp, clock_t exp_time)
+{
+	return (__cv_timedwait_common(cvp, mp, exp_time,
+	    TASK_UNINTERRUPTIBLE, 1));
+}
+EXPORT_SYMBOL(__cv_timedwait_io);
+
+clock_t
 __cv_timedwait_sig(kcondvar_t *cvp, kmutex_t *mp, clock_t exp_time)
 {
-	return (__cv_timedwait_common(cvp, mp, exp_time, TASK_INTERRUPTIBLE));
+	return (__cv_timedwait_common(cvp, mp, exp_time,
+	    TASK_INTERRUPTIBLE, 0));
 }
 EXPORT_SYMBOL(__cv_timedwait_sig);
 
@@ -293,8 +335,8 @@  __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time,
  * Compatibility wrapper for the cv_timedwait_hires() Illumos interface.
  */
 static clock_t
-cv_timedwait_hires_common(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
-    int flag, int state)
+cv_timedwait_hires_common(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
+    hrtime_t res, int flag, int state)
 {
 	if (res > 1) {
 		/*
@@ -321,8 +363,8 @@  cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
 EXPORT_SYMBOL(cv_timedwait_hires);
 
 clock_t
-cv_timedwait_sig_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
-    int flag)
+cv_timedwait_sig_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
+    hrtime_t res, int flag)
 {
 	return (cv_timedwait_hires_common(cvp, mp, tim, res, flag,
 	    TASK_INTERRUPTIBLE));
diff --git a/spl/module/spl/spl-cred.c b/spl/module/spl/spl-cred.c
index 1d486c1..f7f7d87 100644
--- a/spl/module/spl/spl-cred.c
+++ b/spl/module/spl/spl-cred.c
@@ -20,18 +20,12 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Credential Implementation.
 \*****************************************************************************/
 
 #include <sys/cred.h>
 
-#ifdef DEBUG_SUBSYSTEM
-#undef DEBUG_SUBSYSTEM
-#endif
-
-#define DEBUG_SUBSYSTEM S_CRED
-
 static int
 #ifdef HAVE_KUIDGID_T
 cr_groups_search(const struct group_info *group_info, kgid_t grp)
@@ -43,7 +37,7 @@  cr_groups_search(const struct group_info *group_info, gid_t grp)
 	int cmp;
 
 	if (!group_info)
-		return 0;
+		return (0);
 
 	left = 0;
 	right = group_info->ngroups;
@@ -57,16 +51,16 @@  cr_groups_search(const struct group_info *group_info, gid_t grp)
 		else if (cmp < 0)
 			right = mid;
 		else
-			return 1;
+			return (1);
 	}
-	return 0;
+	return (0);
 }
 
 /* Hold a reference on the credential */
 void
 crhold(cred_t *cr)
 {
-	(void)get_cred((const cred_t *)cr);
+	(void) get_cred((const cred_t *)cr);
 }
 
 /* Free a reference on the credential */
@@ -96,7 +90,7 @@  crgetngroups(const cred_t *cr)
 		rc = NGROUPS_PER_BLOCK;
 	}
 #endif
-	return rc;
+	return (rc);
 }
 
 /*
@@ -119,7 +113,7 @@  crgetgroups(const cred_t *cr)
 	if (gi->nblocks > 0)
 		gids = KGIDP_TO_SGIDP(gi->blocks[0]);
 #endif
-	return gids;
+	return (gids);
 }
 
 /* Check if the passed gid is available in supplied credential. */
@@ -132,63 +126,63 @@  groupmember(gid_t gid, const cred_t *cr)
 	gi = cr->group_info;
 	rc = cr_groups_search(gi, SGID_TO_KGID(gid));
 
-	return rc;
+	return (rc);
 }
 
 /* Return the effective user id */
 uid_t
 crgetuid(const cred_t *cr)
 {
-	return KUID_TO_SUID(cr->euid);
+	return (KUID_TO_SUID(cr->euid));
 }
 
 /* Return the real user id */
 uid_t
 crgetruid(const cred_t *cr)
 {
-	return KUID_TO_SUID(cr->uid);
+	return (KUID_TO_SUID(cr->uid));
 }
 
 /* Return the saved user id */
 uid_t
 crgetsuid(const cred_t *cr)
 {
-	return KUID_TO_SUID(cr->suid);
+	return (KUID_TO_SUID(cr->suid));
 }
 
 /* Return the filesystem user id */
 uid_t
 crgetfsuid(const cred_t *cr)
 {
-	return KUID_TO_SUID(cr->fsuid);
+	return (KUID_TO_SUID(cr->fsuid));
 }
 
 /* Return the effective group id */
 gid_t
 crgetgid(const cred_t *cr)
 {
-	return KGID_TO_SGID(cr->egid);
+	return (KGID_TO_SGID(cr->egid));
 }
 
 /* Return the real group id */
 gid_t
 crgetrgid(const cred_t *cr)
 {
-	return KGID_TO_SGID(cr->gid);
+	return (KGID_TO_SGID(cr->gid));
 }
 
 /* Return the saved group id */
 gid_t
 crgetsgid(const cred_t *cr)
 {
-	return KGID_TO_SGID(cr->sgid);
+	return (KGID_TO_SGID(cr->sgid));
 }
 
 /* Return the filesystem group id */
 gid_t
 crgetfsgid(const cred_t *cr)
 {
-	return KGID_TO_SGID(cr->fsgid);
+	return (KGID_TO_SGID(cr->fsgid));
 }
 
 EXPORT_SYMBOL(crhold);
diff --git a/spl/module/spl/spl-err.c b/spl/module/spl/spl-err.c
index 2f66b6e..adfa555 100644
--- a/spl/module/spl/spl-err.c
+++ b/spl/module/spl/spl-err.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Error Implementation.
 \*****************************************************************************/
 
@@ -34,10 +34,11 @@ 
  * analysis and other such goodies.
  * But we would still default to the current default of not to do that.
  */
+/* BEGIN CSTYLED */
 unsigned int spl_panic_halt;
 module_param(spl_panic_halt, uint, 0644);
-MODULE_PARM_DESC(spl_panic_halt,
-		 "Cause kernel panic on assertion failures");
+MODULE_PARM_DESC(spl_panic_halt, "Cause kernel panic on assertion failures");
+/* END CSTYLED */
 
 /*
  * Limit the number of stack traces dumped to not more than 5 every
@@ -56,7 +57,8 @@  spl_dumpstack(void)
 EXPORT_SYMBOL(spl_dumpstack);
 
 int
-spl_panic(const char *file, const char *func, int line, const char *fmt, ...) {
+spl_panic(const char *file, const char *func, int line, const char *fmt, ...)
+{
 	const char *newfile;
 	char msg[MAXMSGLEN];
 	va_list ap;
diff --git a/spl/module/spl/spl-generic.c b/spl/module/spl/spl-generic.c
index f6782da..1098d9a 100644
--- a/spl/module/spl/spl-generic.c
+++ b/spl/module/spl/spl-generic.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Generic Implementation.
 \*****************************************************************************/
 
@@ -50,10 +50,12 @@ 
 char spl_version[32] = "SPL v" SPL_META_VERSION "-" SPL_META_RELEASE;
 EXPORT_SYMBOL(spl_version);
 
+/* BEGIN CSTYLED */
 unsigned long spl_hostid = 0;
 EXPORT_SYMBOL(spl_hostid);
 module_param(spl_hostid, ulong, 0644);
 MODULE_PARM_DESC(spl_hostid, "The system hostid.");
+/* END CSTYLED */
 
 proc_t p0;
 EXPORT_SYMBOL(p0);
@@ -98,7 +100,8 @@  static DEFINE_PER_CPU(uint64_t[2], spl_pseudo_entropy);
  */
 
 static inline uint64_t
-spl_rand_next(uint64_t *s) {
+spl_rand_next(uint64_t *s)
+{
 	uint64_t s1 = s[0];
 	const uint64_t s0 = s[1];
 	s[0] = s0;
@@ -108,14 +111,16 @@  spl_rand_next(uint64_t *s) {
 }
 
 static inline void
-spl_rand_jump(uint64_t *s) {
-	static const uint64_t JUMP[] = { 0x8a5cd789635d2dff, 0x121fd2155c472f96 };
+spl_rand_jump(uint64_t *s)
+{
+	static const uint64_t JUMP[] =
+	    { 0x8a5cd789635d2dff, 0x121fd2155c472f96 };
 
 	uint64_t s0 = 0;
 	uint64_t s1 = 0;
 	int i, b;
-	for(i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
-		for(b = 0; b < 64; b++) {
+	for (i = 0; i < sizeof (JUMP) / sizeof (*JUMP); i++)
+		for (b = 0; b < 64; b++) {
 			if (JUMP[i] & 1ULL << b) {
 				s0 ^= s[0];
 				s1 ^= s[1];
@@ -183,20 +188,21 @@  EXPORT_SYMBOL(random_get_pseudo_bytes);
  * Calculate number of leading of zeros for a 64-bit value.
  */
 static int
-nlz64(uint64_t x) {
+nlz64(uint64_t x)
+{
 	register int n = 0;
 
 	if (x == 0)
-		return 64;
+		return (64);
 
-	if (x <= 0x00000000FFFFFFFFULL) {n = n + 32; x = x << 32;}
-	if (x <= 0x0000FFFFFFFFFFFFULL) {n = n + 16; x = x << 16;}
-	if (x <= 0x00FFFFFFFFFFFFFFULL) {n = n +  8; x = x <<  8;}
-	if (x <= 0x0FFFFFFFFFFFFFFFULL) {n = n +  4; x = x <<  4;}
-	if (x <= 0x3FFFFFFFFFFFFFFFULL) {n = n +  2; x = x <<  2;}
-	if (x <= 0x7FFFFFFFFFFFFFFFULL) {n = n +  1;}
+	if (x <= 0x00000000FFFFFFFFULL) { n = n + 32; x = x << 32; }
+	if (x <= 0x0000FFFFFFFFFFFFULL) { n = n + 16; x = x << 16; }
+	if (x <= 0x00FFFFFFFFFFFFFFULL) { n = n +  8; x = x <<  8; }
+	if (x <= 0x0FFFFFFFFFFFFFFFULL) { n = n +  4; x = x <<  4; }
+	if (x <= 0x3FFFFFFFFFFFFFFFULL) { n = n +  2; x = x <<  2; }
+	if (x <= 0x7FFFFFFFFFFFFFFFULL) { n = n +  1; }
 
-	return n;
+	return (n);
 }
 
 /*
@@ -207,7 +213,7 @@  static inline uint64_t
 __div_u64(uint64_t u, uint32_t v)
 {
 	(void) do_div(u, v);
-	return u;
+	return (u);
 }
 
 /*
@@ -227,7 +233,7 @@  __udivdi3(uint64_t u, uint64_t v)
 
 	if (v >> 32 == 0) {			// If v < 2**32:
 		if (u >> 32 < v) {		// If u/v cannot overflow,
-			return __div_u64(u, v);	// just do one division.
+			return (__div_u64(u, v)); // just do one division.
 		} else {			// If u/v would overflow:
 			u1 = u >> 32;		// Break u into two halves.
 			u0 = u & 0xFFFFFFFF;
@@ -235,7 +241,7 @@  __udivdi3(uint64_t u, uint64_t v)
 			k  = u1 - q1 * v;	// First remainder, < v.
 			u0 += (k << 32);
 			q0 = __div_u64(u0, v);	// Seconds quotient digit.
-			return (q1 << 32) + q0;
+			return ((q1 << 32) + q0);
 		}
 	} else {				// If v >= 2**32:
 		n = nlz64(v);			// 0 <= n <= 31.
@@ -249,7 +255,7 @@  __udivdi3(uint64_t u, uint64_t v)
 		if ((u - q0 * v) >= v)
 			q0 = q0 + 1;		// Now q0 is correct.
 
-		return q0;
+		return (q0);
 	}
 }
 EXPORT_SYMBOL(__udivdi3);
@@ -263,7 +269,7 @@  __divdi3(int64_t u, int64_t v)
 	int64_t q, t;
 	q = __udivdi3(abs64(u), abs64(v));
 	t = (u ^ v) >> 63;	// If u, v have different
-	return (q ^ t) - t;	// signs, negate q.
+	return ((q ^ t) - t);	// signs, negate q.
 }
 EXPORT_SYMBOL(__divdi3);
 
@@ -344,9 +350,11 @@  __aeabi_uldivmod(uint64_t u, uint64_t v)
 		register uint32_t r2 asm("r2") = (mod & 0xFFFFFFFF);
 		register uint32_t r3 asm("r3") = (mod >> 32);
 
+		/* BEGIN CSTYLED */
 		asm volatile(""
 		    : "+r"(r0), "+r"(r1), "+r"(r2),"+r"(r3)  /* output */
 		    : "r"(r0), "r"(r1), "r"(r2), "r"(r3));   /* input */
+		/* END CSTYLED */
 
 		return; /* r0; */
 	}
@@ -367,9 +375,11 @@  __aeabi_ldivmod(int64_t u, int64_t v)
 		register uint32_t r2 asm("r2") = (mod & 0xFFFFFFFF);
 		register uint32_t r3 asm("r3") = (mod >> 32);
 
+		/* BEGIN CSTYLED */
 		asm volatile(""
 		    : "+r"(r0), "+r"(r1), "+r"(r2),"+r"(r3)  /* output */
 		    : "r"(r0), "r"(r1), "r"(r2), "r"(r3));   /* input */
+		/* END CSTYLED */
 
 		return; /* r0; */
 	}
@@ -378,7 +388,8 @@  EXPORT_SYMBOL(__aeabi_ldivmod);
 #endif /* __arm || __arm__ */
 #endif /* BITS_PER_LONG */
 
-/* NOTE: The strtoxx behavior is solely based on my reading of the Solaris
+/*
+ * NOTE: The strtoxx behavior is solely based on my reading of the Solaris
  * ddi_strtol(9F) man page.  I have not verified the behavior of these
  * functions against their Solaris counterparts.  It is possible that I
  * may have misinterpreted the man page or the man page is incorrect.
@@ -388,28 +399,28 @@  int ddi_strtol(const char *, char **, int, long *);
 int ddi_strtoull(const char *, char **, int, unsigned long long *);
 int ddi_strtoll(const char *, char **, int, long long *);
 
-#define define_ddi_strtoux(type, valtype)				\
+#define	define_ddi_strtoux(type, valtype)				\
 int ddi_strtou##type(const char *str, char **endptr,			\
-		     int base, valtype *result)				\
+    int base, valtype *result)						\
 {									\
 	valtype last_value, value = 0;					\
 	char *ptr = (char *)str;					\
 	int flag = 1, digit;						\
 									\
 	if (strlen(ptr) == 0)						\
-		return EINVAL;						\
+		return (EINVAL);					\
 									\
 	/* Auto-detect base based on prefix */				\
 	if (!base) {							\
 		if (str[0] == '0') {					\
-			if (tolower(str[1])=='x' && isxdigit(str[2])) {	\
+			if (tolower(str[1]) == 'x' && isxdigit(str[2])) { \
 				base = 16; /* hex */			\
 				ptr += 2;				\
 			} else if (str[1] >= '0' && str[1] < 8) {	\
 				base = 8; /* octal */			\
 				ptr += 1;				\
 			} else {					\
-				return EINVAL;				\
+				return (EINVAL);			\
 			}						\
 		} else {						\
 			base = 10; /* decimal */			\
@@ -430,7 +441,7 @@  int ddi_strtou##type(const char *str, char **endptr,			\
 		last_value = value;					\
 		value = value * base + digit;				\
 		if (last_value > value) /* Overflow */			\
-			return ERANGE;					\
+			return (ERANGE);				\
 									\
 		flag = 1;						\
 		ptr++;							\
@@ -442,12 +453,12 @@  int ddi_strtou##type(const char *str, char **endptr,			\
 	if (endptr)							\
 		*endptr = (char *)(flag ? ptr : str);			\
 									\
-	return 0;							\
+	return (0);							\
 }									\
 
-#define define_ddi_strtox(type, valtype)				\
+#define	define_ddi_strtox(type, valtype)				\
 int ddi_strto##type(const char *str, char **endptr,			\
-		       int base, valtype *result)			\
+    int base, valtype *result)						\
 {									\
 	int rc;								\
 									\
@@ -463,7 +474,7 @@  int ddi_strto##type(const char *str, char **endptr,			\
 		rc = ddi_strtou##type(str, endptr, base, result);	\
 	}								\
 									\
-	return rc;							\
+	return (rc);							\
 }
 
 define_ddi_strtoux(l, unsigned long)
@@ -482,10 +493,10 @@  ddi_copyin(const void *from, void *to, size_t len, int flags)
 	/* Fake ioctl() issued by kernel, 'from' is a kernel address */
 	if (flags & FKIOCTL) {
 		memcpy(to, from, len);
-		return 0;
+		return (0);
 	}
 
-	return copyin(from, to, len);
+	return (copyin(from, to, len));
 }
 EXPORT_SYMBOL(ddi_copyin);
 
@@ -495,10 +506,10 @@  ddi_copyout(const void *from, void *to, size_t len, int flags)
 	/* Fake ioctl() issued by kernel, 'from' is a kernel address */
 	if (flags & FKIOCTL) {
 		memcpy(to, from, len);
-		return 0;
+		return (0);
 	}
 
-	return copyout(from, to, len);
+	return (copyout(from, to, len));
 }
 EXPORT_SYMBOL(ddi_copyout);
 
@@ -559,7 +570,7 @@  hostid_read(uint32_t *hostid)
 		return (error);
 	}
 
-	if (size < sizeof(HW_HOSTID_MASK)) {
+	if (size < sizeof (HW_HOSTID_MASK)) {
 		kobj_close_file(file);
 		return (EINVAL);
 	}
@@ -568,7 +579,7 @@  hostid_read(uint32_t *hostid)
 	 * Read directly into the variable like eglibc does.
 	 * Short reads are okay; native behavior is preserved.
 	 */
-	error = kobj_read_file(file, (char *)&value, sizeof(value), 0);
+	error = kobj_read_file(file, (char *)&value, sizeof (value), 0);
 	if (error < 0) {
 		kobj_close_file(file);
 		return (EIO);
@@ -578,7 +589,7 @@  hostid_read(uint32_t *hostid)
 	*hostid = (value & HW_HOSTID_MASK);
 	kobj_close_file(file);
 
-	return 0;
+	return (0);
 }
 
 /*
@@ -704,7 +715,7 @@  spl_init(void)
 		goto out10;
 
 	printk(KERN_NOTICE "SPL: Loaded module v%s-%s%s\n", SPL_META_VERSION,
-	       SPL_META_RELEASE, SPL_DEBUG_STR);
+	    SPL_META_RELEASE, SPL_DEBUG_STR);
 	return (rc);
 
 out10:
@@ -727,8 +738,8 @@  spl_init(void)
 	spl_kvmem_fini();
 out1:
 	printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer "
-	       "v%s-%s%s, rc = %d\n", SPL_META_VERSION, SPL_META_RELEASE,
-	       SPL_DEBUG_STR, rc);
+	    "v%s-%s%s, rc = %d\n", SPL_META_VERSION, SPL_META_RELEASE,
+	    SPL_DEBUG_STR, rc);
 
 	return (rc);
 }
@@ -737,7 +748,7 @@  static void __exit
 spl_fini(void)
 {
 	printk(KERN_NOTICE "SPL: Unloaded module v%s-%s%s\n",
-	       SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR);
+	    SPL_META_VERSION, SPL_META_RELEASE, SPL_DEBUG_STR);
 	spl_zlib_fini();
 	spl_kstat_fini();
 	spl_proc_fini();
diff --git a/spl/module/spl/spl-kmem-cache.c b/spl/module/spl/spl-kmem-cache.c
index 45576b9..c73a2fd 100644
--- a/spl/module/spl/spl-kmem-cache.c
+++ b/spl/module/spl/spl-kmem-cache.c
@@ -66,6 +66,7 @@ 
  * because it has been shown to improve responsiveness on low memory systems.
  * This policy may be changed by setting KMC_EXPIRE_AGE or KMC_EXPIRE_MEM.
  */
+/* BEGIN CSTYLED */
 unsigned int spl_kmem_cache_expire = KMC_EXPIRE_MEM;
 EXPORT_SYMBOL(spl_kmem_cache_expire);
 module_param(spl_kmem_cache_expire, uint, 0644);
@@ -134,8 +135,8 @@  MODULE_PARM_DESC(spl_kmem_cache_slab_limit,
  * have been deemed costly by the kernel.
  */
 unsigned int spl_kmem_cache_kmem_limit =
-    ((1 << (PAGE_ALLOC_COSTLY_ORDER - 1)) * PAGE_SIZE) /
-    SPL_KMEM_CACHE_OBJ_PER_SLAB;
+	((1 << (PAGE_ALLOC_COSTLY_ORDER - 1)) * PAGE_SIZE) /
+	SPL_KMEM_CACHE_OBJ_PER_SLAB;
 module_param(spl_kmem_cache_kmem_limit, uint, 0644);
 MODULE_PARM_DESC(spl_kmem_cache_kmem_limit,
 	"Objects less than N bytes use the kmalloc");
@@ -148,6 +149,7 @@  unsigned int spl_kmem_cache_kmem_threads = 4;
 module_param(spl_kmem_cache_kmem_threads, uint, 0444);
 MODULE_PARM_DESC(spl_kmem_cache_kmem_threads,
 	"Number of spl_kmem_cache threads");
+/* END CSTYLED */
 
 /*
  * Slab allocation interfaces
@@ -356,8 +358,9 @@  spl_slab_alloc(spl_kmem_cache_t *skc, int flags)
 	if (rc) {
 		if (skc->skc_flags & KMC_OFFSLAB)
 			list_for_each_entry_safe(sko,
-			    n, &sks->sks_free_list, sko_list)
+			    n, &sks->sks_free_list, sko_list) {
 				kv_free(skc, sko->sko_addr, offslab_size);
+			}
 
 		kv_free(skc, base, skc->skc_slab_size);
 		sks = NULL;
@@ -382,7 +385,6 @@  spl_slab_free(spl_kmem_slab_t *sks,
 
 	skc = sks->sks_cache;
 	ASSERT(skc->skc_magic == SKC_MAGIC);
-	ASSERT(spin_is_locked(&skc->skc_lock));
 
 	/*
 	 * Update slab/objects counters in the cache, then remove the
@@ -583,7 +585,6 @@  __spl_cache_flush(spl_kmem_cache_t *skc, spl_kmem_magazine_t *skm, int flush)
 
 	ASSERT(skc->skc_magic == SKC_MAGIC);
 	ASSERT(skm->skm_magic == SKM_MAGIC);
-	ASSERT(spin_is_locked(&skc->skc_lock));
 
 	for (i = 0; i < count; i++)
 		spl_cache_shrink(skc, skm->skm_objs[i]);
@@ -1002,15 +1003,15 @@  spl_kmem_cache_create(char *name, size_t size, size_t align,
 #endif
 
 #if defined(HAVE_KMEM_CACHE_CREATE_USERCOPY)
-        /*
-         * Newer grsec patchset uses kmem_cache_create_usercopy()
-         * instead of SLAB_USERCOPY flag
-         */
-        skc->skc_linux_cache = kmem_cache_create_usercopy(
-            skc->skc_name, size, align, slabflags, 0, size, NULL);
+	/*
+	 * Newer grsec patchset uses kmem_cache_create_usercopy()
+	 * instead of SLAB_USERCOPY flag
+	 */
+	skc->skc_linux_cache = kmem_cache_create_usercopy(
+	    skc->skc_name, size, align, slabflags, 0, size, NULL);
 #else
-        skc->skc_linux_cache = kmem_cache_create(
-            skc->skc_name, size, align, slabflags, NULL);
+	skc->skc_linux_cache = kmem_cache_create(
+	    skc->skc_name, size, align, slabflags, NULL);
 #endif
 		if (skc->skc_linux_cache == NULL) {
 			rc = ENOMEM;
@@ -1125,7 +1126,6 @@  spl_cache_obj(spl_kmem_cache_t *skc, spl_kmem_slab_t *sks)
 
 	ASSERT(skc->skc_magic == SKC_MAGIC);
 	ASSERT(sks->sks_magic == SKS_MAGIC);
-	ASSERT(spin_is_locked(&skc->skc_lock));
 
 	sko = list_entry(sks->sks_free_list.next, spl_kmem_obj_t, sko_list);
 	ASSERT(sko->sko_magic == SKO_MAGIC);
@@ -1189,7 +1189,7 @@  spl_cache_grow_work(void *data)
 	spl_kmem_alloc_t *ska = (spl_kmem_alloc_t *)data;
 	spl_kmem_cache_t *skc = ska->ska_cache;
 
-	(void)__spl_cache_grow(skc, ska->ska_flags);
+	(void) __spl_cache_grow(skc, ska->ska_flags);
 
 	atomic_dec(&skc->skc_ref);
 	smp_mb__before_atomic();
@@ -1396,7 +1396,6 @@  spl_cache_shrink(spl_kmem_cache_t *skc, void *obj)
 	spl_kmem_obj_t *sko = NULL;
 
 	ASSERT(skc->skc_magic == SKC_MAGIC);
-	ASSERT(spin_is_locked(&skc->skc_lock));
 
 	sko = spl_sko_from_obj(skc, obj);
 	ASSERT(sko->sko_magic == SKO_MAGIC);
diff --git a/spl/module/spl/spl-kmem.c b/spl/module/spl/spl-kmem.c
index 41bec75..e0d5510 100755
--- a/spl/module/spl/spl-kmem.c
+++ b/spl/module/spl/spl-kmem.c
@@ -44,6 +44,7 @@ 
  * allocations are quickly caught.  These warnings may be disabled by setting
  * the threshold to zero.
  */
+/* BEGIN CSTYLED */
 unsigned int spl_kmem_alloc_warn = MIN(16 * PAGE_SIZE, 64 * 1024);
 module_param(spl_kmem_alloc_warn, uint, 0644);
 MODULE_PARM_DESC(spl_kmem_alloc_warn,
@@ -64,6 +65,7 @@  module_param(spl_kmem_alloc_max, uint, 0644);
 MODULE_PARM_DESC(spl_kmem_alloc_max,
 	"Maximum size in bytes for a kmem_alloc()");
 EXPORT_SYMBOL(spl_kmem_alloc_max);
+/* END CSTYLED */
 
 int
 kmem_debugging(void)
@@ -383,7 +385,7 @@  spl_kmem_free_track(const void *ptr, size_t size)
 {
 	kmem_debug_t *dptr;
 
-	/* Ignore NULL pointer since we haven't tracked it at all*/
+	/* Ignore NULL pointer since we haven't tracked it at all */
 	if (ptr == NULL)
 		return;
 
@@ -520,10 +522,11 @@  spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock)
 		printk(KERN_WARNING "%-16s %-5s %-16s %s:%s\n", "address",
 		    "size", "data", "func", "line");
 
-	list_for_each_entry(kd, list, kd_list)
+	list_for_each_entry(kd, list, kd_list) {
 		printk(KERN_WARNING "%p %-5d %-16s %s:%d\n", kd->kd_addr,
 		    (int)kd->kd_size, spl_sprintf_addr(kd, str, 17, 8),
 		    kd->kd_func, kd->kd_line);
+	}
 
 	spin_unlock_irqrestore(lock, flags);
 }
diff --git a/spl/module/spl/spl-kobj.c b/spl/module/spl/spl-kobj.c
index b79fcb8..500f246 100644
--- a/spl/module/spl/spl-kobj.c
+++ b/spl/module/spl/spl-kobj.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Kobj Implementation.
 \*****************************************************************************/
 
@@ -33,7 +33,7 @@  kobj_open_file(const char *name)
 	vnode_t *vp;
 	int rc;
 
-	file = kmalloc(sizeof(_buf_t), kmem_flags_convert(KM_SLEEP));
+	file = kmalloc(sizeof (_buf_t), kmem_flags_convert(KM_SLEEP));
 	if (file == NULL)
 		return ((_buf_t *)-1UL);
 
@@ -52,7 +52,7 @@  void
 kobj_close_file(struct _buf *file)
 {
 	VOP_CLOSE(file->vp, 0, 0, 0, 0, 0);
-        kfree(file);
+	kfree(file);
 } /* kobj_close_file() */
 EXPORT_SYMBOL(kobj_close_file);
 
@@ -72,15 +72,15 @@  EXPORT_SYMBOL(kobj_read_file);
 int
 kobj_get_filesize(struct _buf *file, uint64_t *size)
 {
-        vattr_t vap;
+	vattr_t vap;
 	int rc;
 
 	rc = VOP_GETATTR(file->vp, &vap, 0, 0, NULL);
 	if (rc)
 		return (rc);
 
-        *size = vap.va_size;
+	*size = vap.va_size;
 
-        return (rc);
+	return (rc);
 } /* kobj_get_filesize() */
 EXPORT_SYMBOL(kobj_get_filesize);
diff --git a/spl/module/spl/spl-kstat.c b/spl/module/spl/spl-kstat.c
index e306915..6970fcc 100644
--- a/spl/module/spl/spl-kstat.c
+++ b/spl/module/spl/spl-kstat.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Kstat Implementation.
 \*****************************************************************************/
 
@@ -30,7 +30,7 @@ 
 #include <sys/cmn_err.h>
 
 #ifndef HAVE_PDE_DATA
-#define PDE_DATA(x) (PDE(x)->data)
+#define	PDE_DATA(x) (PDE(x)->data)
 #endif
 
 static kmutex_t kstat_module_lock;
@@ -41,13 +41,13 @@  static int
 kstat_resize_raw(kstat_t *ksp)
 {
 	if (ksp->ks_raw_bufsize == KSTAT_RAW_MAX)
-		return ENOMEM;
+		return (ENOMEM);
 
 	vmem_free(ksp->ks_raw_buf, ksp->ks_raw_bufsize);
 	ksp->ks_raw_bufsize = MIN(ksp->ks_raw_bufsize * 2, KSTAT_RAW_MAX);
 	ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP);
 
-	return 0;
+	return (0);
 }
 
 void
@@ -119,213 +119,215 @@  EXPORT_SYMBOL(kstat_runq_exit);
 static int
 kstat_seq_show_headers(struct seq_file *f)
 {
-        kstat_t *ksp = (kstat_t *)f->private;
+	kstat_t *ksp = (kstat_t *)f->private;
 	int rc = 0;
 
-        ASSERT(ksp->ks_magic == KS_MAGIC);
+	ASSERT(ksp->ks_magic == KS_MAGIC);
 
-        seq_printf(f, "%d %d 0x%02x %d %d %lld %lld\n",
-		   ksp->ks_kid, ksp->ks_type, ksp->ks_flags,
-		   ksp->ks_ndata, (int)ksp->ks_data_size,
-		   ksp->ks_crtime, ksp->ks_snaptime);
+	seq_printf(f, "%d %d 0x%02x %d %d %lld %lld\n",
+	    ksp->ks_kid, ksp->ks_type, ksp->ks_flags,
+	    ksp->ks_ndata, (int)ksp->ks_data_size,
+	    ksp->ks_crtime, ksp->ks_snaptime);
 
 	switch (ksp->ks_type) {
-                case KSTAT_TYPE_RAW:
+		case KSTAT_TYPE_RAW:
 restart:
-                        if (ksp->ks_raw_ops.headers) {
-                                rc = ksp->ks_raw_ops.headers(
-                                    ksp->ks_raw_buf, ksp->ks_raw_bufsize);
+			if (ksp->ks_raw_ops.headers) {
+				rc = ksp->ks_raw_ops.headers(
+				    ksp->ks_raw_buf, ksp->ks_raw_bufsize);
 				if (rc == ENOMEM && !kstat_resize_raw(ksp))
 					goto restart;
 				if (!rc)
-	                                seq_puts(f, ksp->ks_raw_buf);
-                        } else {
-                                seq_printf(f, "raw data\n");
-                        }
-                        break;
-                case KSTAT_TYPE_NAMED:
-                        seq_printf(f, "%-31s %-4s %s\n",
-                                   "name", "type", "data");
-                        break;
-                case KSTAT_TYPE_INTR:
-                        seq_printf(f, "%-8s %-8s %-8s %-8s %-8s\n",
-                                   "hard", "soft", "watchdog",
-                                   "spurious", "multsvc");
-                        break;
-                case KSTAT_TYPE_IO:
-                        seq_printf(f,
-                                   "%-8s %-8s %-8s %-8s %-8s %-8s "
-                                   "%-8s %-8s %-8s %-8s %-8s %-8s\n",
-                                   "nread", "nwritten", "reads", "writes",
-                                   "wtime", "wlentime", "wupdate",
-                                   "rtime", "rlentime", "rupdate",
-                                   "wcnt", "rcnt");
-                        break;
-                case KSTAT_TYPE_TIMER:
-                        seq_printf(f,
-                                   "%-31s %-8s "
-                                   "%-8s %-8s %-8s %-8s %-8s\n",
-                                   "name", "events", "elapsed",
-                                   "min", "max", "start", "stop");
-                        break;
-                default:
-                        PANIC("Undefined kstat type %d\n", ksp->ks_type);
-        }
-
-	return -rc;
+					seq_puts(f, ksp->ks_raw_buf);
+			} else {
+				seq_printf(f, "raw data\n");
+			}
+			break;
+		case KSTAT_TYPE_NAMED:
+			seq_printf(f, "%-31s %-4s %s\n",
+			    "name", "type", "data");
+			break;
+		case KSTAT_TYPE_INTR:
+			seq_printf(f, "%-8s %-8s %-8s %-8s %-8s\n",
+			    "hard", "soft", "watchdog",
+			    "spurious", "multsvc");
+			break;
+		case KSTAT_TYPE_IO:
+			seq_printf(f,
+			    "%-8s %-8s %-8s %-8s %-8s %-8s "
+			    "%-8s %-8s %-8s %-8s %-8s %-8s\n",
+			    "nread", "nwritten", "reads", "writes",
+			    "wtime", "wlentime", "wupdate",
+			    "rtime", "rlentime", "rupdate",
+			    "wcnt", "rcnt");
+			break;
+		case KSTAT_TYPE_TIMER:
+			seq_printf(f,
+			    "%-31s %-8s "
+			    "%-8s %-8s %-8s %-8s %-8s\n",
+			    "name", "events", "elapsed",
+			    "min", "max", "start", "stop");
+			break;
+		default:
+			PANIC("Undefined kstat type %d\n", ksp->ks_type);
+	}
+
+	return (-rc);
 }
 
 static int
 kstat_seq_show_raw(struct seq_file *f, unsigned char *p, int l)
 {
-        int i, j;
+	int i, j;
 
-        for (i = 0; ; i++) {
-                seq_printf(f, "%03x:", i);
+	for (i = 0; ; i++) {
+		seq_printf(f, "%03x:", i);
 
-                for (j = 0; j < 16; j++) {
-                        if (i * 16 + j >= l) {
-                                seq_printf(f, "\n");
-                                goto out;
-                        }
+		for (j = 0; j < 16; j++) {
+			if (i * 16 + j >= l) {
+				seq_printf(f, "\n");
+				goto out;
+			}
 
-                        seq_printf(f, " %02x", (unsigned char)p[i * 16 + j]);
-                }
-                seq_printf(f, "\n");
-        }
+			seq_printf(f, " %02x", (unsigned char)p[i * 16 + j]);
+		}
+		seq_printf(f, "\n");
+	}
 out:
-        return 0;
+	return (0);
 }
 
 static int
 kstat_seq_show_named(struct seq_file *f, kstat_named_t *knp)
 {
-        seq_printf(f, "%-31s %-4d ", knp->name, knp->data_type);
-
-        switch (knp->data_type) {
-                case KSTAT_DATA_CHAR:
-                        knp->value.c[15] = '\0'; /* NULL terminate */
-                        seq_printf(f, "%-16s", knp->value.c);
-                        break;
-                /* XXX - We need to be more careful able what tokens are
-                 * used for each arch, for now this is correct for x86_64.
-                 */
-                case KSTAT_DATA_INT32:
-                        seq_printf(f, "%d", knp->value.i32);
-                        break;
-                case KSTAT_DATA_UINT32:
-                        seq_printf(f, "%u", knp->value.ui32);
-                        break;
-                case KSTAT_DATA_INT64:
-                        seq_printf(f, "%lld", (signed long long)knp->value.i64);
-                        break;
-                case KSTAT_DATA_UINT64:
-                        seq_printf(f, "%llu", (unsigned long long)knp->value.ui64);
-                        break;
-                case KSTAT_DATA_LONG:
-                        seq_printf(f, "%ld", knp->value.l);
-                        break;
-                case KSTAT_DATA_ULONG:
-                        seq_printf(f, "%lu", knp->value.ul);
-                        break;
-                case KSTAT_DATA_STRING:
-                        KSTAT_NAMED_STR_PTR(knp)
-                                [KSTAT_NAMED_STR_BUFLEN(knp)-1] = '\0';
-                        seq_printf(f, "%s", KSTAT_NAMED_STR_PTR(knp));
-                        break;
-                default:
-                        PANIC("Undefined kstat data type %d\n", knp->data_type);
-        }
-
-        seq_printf(f, "\n");
-
-        return 0;
+	seq_printf(f, "%-31s %-4d ", knp->name, knp->data_type);
+
+	switch (knp->data_type) {
+		case KSTAT_DATA_CHAR:
+			knp->value.c[15] = '\0'; /* NULL terminate */
+			seq_printf(f, "%-16s", knp->value.c);
+			break;
+		/*
+		 * NOTE - We need to be more careful able what tokens are
+		 * used for each arch, for now this is correct for x86_64.
+		 */
+		case KSTAT_DATA_INT32:
+			seq_printf(f, "%d", knp->value.i32);
+			break;
+		case KSTAT_DATA_UINT32:
+			seq_printf(f, "%u", knp->value.ui32);
+			break;
+		case KSTAT_DATA_INT64:
+			seq_printf(f, "%lld", (signed long long)knp->value.i64);
+			break;
+		case KSTAT_DATA_UINT64:
+			seq_printf(f, "%llu",
+			    (unsigned long long)knp->value.ui64);
+			break;
+		case KSTAT_DATA_LONG:
+			seq_printf(f, "%ld", knp->value.l);
+			break;
+		case KSTAT_DATA_ULONG:
+			seq_printf(f, "%lu", knp->value.ul);
+			break;
+		case KSTAT_DATA_STRING:
+			KSTAT_NAMED_STR_PTR(knp)
+				[KSTAT_NAMED_STR_BUFLEN(knp)-1] = '\0';
+			seq_printf(f, "%s", KSTAT_NAMED_STR_PTR(knp));
+			break;
+		default:
+			PANIC("Undefined kstat data type %d\n", knp->data_type);
+	}
+
+	seq_printf(f, "\n");
+
+	return (0);
 }
 
 static int
 kstat_seq_show_intr(struct seq_file *f, kstat_intr_t *kip)
 {
-        seq_printf(f, "%-8u %-8u %-8u %-8u %-8u\n",
-                   kip->intrs[KSTAT_INTR_HARD],
-                   kip->intrs[KSTAT_INTR_SOFT],
-                   kip->intrs[KSTAT_INTR_WATCHDOG],
-                   kip->intrs[KSTAT_INTR_SPURIOUS],
-                   kip->intrs[KSTAT_INTR_MULTSVC]);
-
-        return 0;
+	seq_printf(f, "%-8u %-8u %-8u %-8u %-8u\n",
+	    kip->intrs[KSTAT_INTR_HARD],
+	    kip->intrs[KSTAT_INTR_SOFT],
+	    kip->intrs[KSTAT_INTR_WATCHDOG],
+	    kip->intrs[KSTAT_INTR_SPURIOUS],
+	    kip->intrs[KSTAT_INTR_MULTSVC]);
+
+	return (0);
 }
 
 static int
 kstat_seq_show_io(struct seq_file *f, kstat_io_t *kip)
 {
-        seq_printf(f,
-                   "%-8llu %-8llu %-8u %-8u %-8lld %-8lld "
-                   "%-8lld %-8lld %-8lld %-8lld %-8u %-8u\n",
-                   kip->nread, kip->nwritten,
-                   kip->reads, kip->writes,
-                   kip->wtime, kip->wlentime, kip->wlastupdate,
-                   kip->rtime, kip->rlentime, kip->rlastupdate,
-                   kip->wcnt,  kip->rcnt);
-
-        return 0;
+	seq_printf(f,
+	    "%-8llu %-8llu %-8u %-8u %-8lld %-8lld "
+	    "%-8lld %-8lld %-8lld %-8lld %-8u %-8u\n",
+	    kip->nread, kip->nwritten,
+	    kip->reads, kip->writes,
+	    kip->wtime, kip->wlentime, kip->wlastupdate,
+	    kip->rtime, kip->rlentime, kip->rlastupdate,
+	    kip->wcnt,  kip->rcnt);
+
+	return (0);
 }
 
 static int
 kstat_seq_show_timer(struct seq_file *f, kstat_timer_t *ktp)
 {
-        seq_printf(f,
-                   "%-31s %-8llu %-8lld %-8lld %-8lld %-8lld %-8lld\n",
-                   ktp->name, ktp->num_events, ktp->elapsed_time,
-                   ktp->min_time, ktp->max_time,
-                   ktp->start_time, ktp->stop_time);
+	seq_printf(f,
+	    "%-31s %-8llu %-8lld %-8lld %-8lld %-8lld %-8lld\n",
+	    ktp->name, ktp->num_events, ktp->elapsed_time,
+	    ktp->min_time, ktp->max_time,
+	    ktp->start_time, ktp->stop_time);
 
-        return 0;
+	return (0);
 }
 
 static int
 kstat_seq_show(struct seq_file *f, void *p)
 {
-        kstat_t *ksp = (kstat_t *)f->private;
-        int rc = 0;
+	kstat_t *ksp = (kstat_t *)f->private;
+	int rc = 0;
 
-        ASSERT(ksp->ks_magic == KS_MAGIC);
+	ASSERT(ksp->ks_magic == KS_MAGIC);
 
 	switch (ksp->ks_type) {
-                case KSTAT_TYPE_RAW:
+		case KSTAT_TYPE_RAW:
 restart:
-                        if (ksp->ks_raw_ops.data) {
-                                rc = ksp->ks_raw_ops.data(
+			if (ksp->ks_raw_ops.data) {
+				rc = ksp->ks_raw_ops.data(
 				    ksp->ks_raw_buf, ksp->ks_raw_bufsize, p);
 				if (rc == ENOMEM && !kstat_resize_raw(ksp))
 					goto restart;
 				if (!rc)
-	                                seq_puts(f, ksp->ks_raw_buf);
-                        } else {
-                                ASSERT(ksp->ks_ndata == 1);
-                                rc = kstat_seq_show_raw(f, ksp->ks_data,
-                                                        ksp->ks_data_size);
-                        }
-                        break;
-                case KSTAT_TYPE_NAMED:
-                        rc = kstat_seq_show_named(f, (kstat_named_t *)p);
-                        break;
-                case KSTAT_TYPE_INTR:
-                        rc = kstat_seq_show_intr(f, (kstat_intr_t *)p);
-                        break;
-                case KSTAT_TYPE_IO:
-                        rc = kstat_seq_show_io(f, (kstat_io_t *)p);
-                        break;
-                case KSTAT_TYPE_TIMER:
-                        rc = kstat_seq_show_timer(f, (kstat_timer_t *)p);
-                        break;
-                default:
-                        PANIC("Undefined kstat type %d\n", ksp->ks_type);
-        }
-
-        return -rc;
+					seq_puts(f, ksp->ks_raw_buf);
+			} else {
+				ASSERT(ksp->ks_ndata == 1);
+				rc = kstat_seq_show_raw(f, ksp->ks_data,
+				    ksp->ks_data_size);
+			}
+			break;
+		case KSTAT_TYPE_NAMED:
+			rc = kstat_seq_show_named(f, (kstat_named_t *)p);
+			break;
+		case KSTAT_TYPE_INTR:
+			rc = kstat_seq_show_intr(f, (kstat_intr_t *)p);
+			break;
+		case KSTAT_TYPE_IO:
+			rc = kstat_seq_show_io(f, (kstat_io_t *)p);
+			break;
+		case KSTAT_TYPE_TIMER:
+			rc = kstat_seq_show_timer(f, (kstat_timer_t *)p);
+			break;
+		default:
+			PANIC("Undefined kstat type %d\n", ksp->ks_type);
+	}
+
+	return (-rc);
 }
 
-int
+static int
 kstat_default_update(kstat_t *ksp, int rw)
 {
 	ASSERT(ksp != NULL);
@@ -333,79 +335,79 @@  kstat_default_update(kstat_t *ksp, int rw)
 	if (rw == KSTAT_WRITE)
 		return (EACCES);
 
-	return 0;
+	return (0);
 }
 
 static void *
 kstat_seq_data_addr(kstat_t *ksp, loff_t n)
 {
-        void *rc = NULL;
+	void *rc = NULL;
 
 	switch (ksp->ks_type) {
-                case KSTAT_TYPE_RAW:
-                        if (ksp->ks_raw_ops.addr)
-                                rc = ksp->ks_raw_ops.addr(ksp, n);
-                        else
-                                rc = ksp->ks_data;
-                        break;
-                case KSTAT_TYPE_NAMED:
-                        rc = ksp->ks_data + n * sizeof(kstat_named_t);
-                        break;
-                case KSTAT_TYPE_INTR:
-                        rc = ksp->ks_data + n * sizeof(kstat_intr_t);
-                        break;
-                case KSTAT_TYPE_IO:
-                        rc = ksp->ks_data + n * sizeof(kstat_io_t);
-                        break;
-                case KSTAT_TYPE_TIMER:
-                        rc = ksp->ks_data + n * sizeof(kstat_timer_t);
-                        break;
-                default:
-                        PANIC("Undefined kstat type %d\n", ksp->ks_type);
-        }
-
-        return (rc);
+		case KSTAT_TYPE_RAW:
+			if (ksp->ks_raw_ops.addr)
+				rc = ksp->ks_raw_ops.addr(ksp, n);
+			else
+				rc = ksp->ks_data;
+			break;
+		case KSTAT_TYPE_NAMED:
+			rc = ksp->ks_data + n * sizeof (kstat_named_t);
+			break;
+		case KSTAT_TYPE_INTR:
+			rc = ksp->ks_data + n * sizeof (kstat_intr_t);
+			break;
+		case KSTAT_TYPE_IO:
+			rc = ksp->ks_data + n * sizeof (kstat_io_t);
+			break;
+		case KSTAT_TYPE_TIMER:
+			rc = ksp->ks_data + n * sizeof (kstat_timer_t);
+			break;
+		default:
+			PANIC("Undefined kstat type %d\n", ksp->ks_type);
+	}
+
+	return (rc);
 }
 
 static void *
 kstat_seq_start(struct seq_file *f, loff_t *pos)
 {
-        loff_t n = *pos;
-        kstat_t *ksp = (kstat_t *)f->private;
-        ASSERT(ksp->ks_magic == KS_MAGIC);
+	loff_t n = *pos;
+	kstat_t *ksp = (kstat_t *)f->private;
+	ASSERT(ksp->ks_magic == KS_MAGIC);
 
 	mutex_enter(ksp->ks_lock);
 
-        if (ksp->ks_type == KSTAT_TYPE_RAW) {
-                ksp->ks_raw_bufsize = PAGE_SIZE;
-                ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP);
-        }
+	if (ksp->ks_type == KSTAT_TYPE_RAW) {
+		ksp->ks_raw_bufsize = PAGE_SIZE;
+		ksp->ks_raw_buf = vmem_alloc(ksp->ks_raw_bufsize, KM_SLEEP);
+	}
 
-        /* Dynamically update kstat, on error existing kstats are used */
-        (void) ksp->ks_update(ksp, KSTAT_READ);
+	/* Dynamically update kstat, on error existing kstats are used */
+	(void) ksp->ks_update(ksp, KSTAT_READ);
 
 	ksp->ks_snaptime = gethrtime();
 
-        if (!n && kstat_seq_show_headers(f))
+	if (!n && kstat_seq_show_headers(f))
 		return (NULL);
 
-        if (n >= ksp->ks_ndata)
-                return (NULL);
+	if (n >= ksp->ks_ndata)
+		return (NULL);
 
-        return (kstat_seq_data_addr(ksp, n));
+	return (kstat_seq_data_addr(ksp, n));
 }
 
 static void *
 kstat_seq_next(struct seq_file *f, void *p, loff_t *pos)
 {
-        kstat_t *ksp = (kstat_t *)f->private;
-        ASSERT(ksp->ks_magic == KS_MAGIC);
+	kstat_t *ksp = (kstat_t *)f->private;
+	ASSERT(ksp->ks_magic == KS_MAGIC);
 
-        ++*pos;
-        if (*pos >= ksp->ks_ndata)
-                return (NULL);
+	++*pos;
+	if (*pos >= ksp->ks_ndata)
+		return (NULL);
 
-        return (kstat_seq_data_addr(ksp, *pos));
+	return (kstat_seq_data_addr(ksp, *pos));
 }
 
 static void
@@ -421,10 +423,10 @@  kstat_seq_stop(struct seq_file *f, void *v)
 }
 
 static struct seq_operations kstat_seq_ops = {
-        .show  = kstat_seq_show,
-        .start = kstat_seq_start,
-        .next  = kstat_seq_next,
-        .stop  = kstat_seq_stop,
+	.show  = kstat_seq_show,
+	.start = kstat_seq_start,
+	.next  = kstat_seq_next,
+	.stop  = kstat_seq_stop,
 };
 
 static kstat_module_t *
@@ -432,9 +434,10 @@  kstat_find_module(char *name)
 {
 	kstat_module_t *module;
 
-	list_for_each_entry(module, &kstat_module_list, ksm_module_list)
+	list_for_each_entry(module, &kstat_module_list, ksm_module_list) {
 		if (strncmp(name, module->ksm_name, KSTAT_STRLEN) == 0)
 			return (module);
+	}
 
 	return (NULL);
 }
@@ -465,28 +468,28 @@  kstat_delete_module(kstat_module_t *module)
 	ASSERT(list_empty(&module->ksm_kstat_list));
 	remove_proc_entry(module->ksm_name, proc_spl_kstat);
 	list_del(&module->ksm_module_list);
-	kmem_free(module, sizeof(kstat_module_t));
+	kmem_free(module, sizeof (kstat_module_t));
 }
 
 static int
 proc_kstat_open(struct inode *inode, struct file *filp)
 {
-        struct seq_file *f;
-        int rc;
+	struct seq_file *f;
+	int rc;
 
-        rc = seq_open(filp, &kstat_seq_ops);
-        if (rc)
-                return rc;
+	rc = seq_open(filp, &kstat_seq_ops);
+	if (rc)
+		return (rc);
 
-        f = filp->private_data;
-        f->private = PDE_DATA(inode);
+	f = filp->private_data;
+	f->private = PDE_DATA(inode);
 
-        return rc;
+	return (rc);
 }
 
 static ssize_t
-proc_kstat_write(struct file *filp, const char __user *buf,
-		 size_t len, loff_t *ppos)
+proc_kstat_write(struct file *filp, const char __user *buf, size_t len,
+    loff_t *ppos)
 {
 	struct seq_file *f = filp->private_data;
 	kstat_t *ksp = f->private;
@@ -515,9 +518,9 @@  static struct file_operations proc_kstat_operations = {
 
 void
 __kstat_set_raw_ops(kstat_t *ksp,
-		    int (*headers)(char *buf, size_t size),
-		    int (*data)(char *buf, size_t size, void *data),
-		    void *(*addr)(kstat_t *ksp, loff_t index))
+    int (*headers)(char *buf, size_t size),
+    int (*data)(char *buf, size_t size, void *data),
+    void *(*addr)(kstat_t *ksp, loff_t index))
 {
 	ksp->ks_raw_ops.headers = headers;
 	ksp->ks_raw_ops.data    = data;
@@ -527,8 +530,8 @@  EXPORT_SYMBOL(__kstat_set_raw_ops);
 
 kstat_t *
 __kstat_create(const char *ks_module, int ks_instance, const char *ks_name,
-             const char *ks_class, uchar_t ks_type, uint_t ks_ndata,
-             uchar_t ks_flags)
+    const char *ks_class, uchar_t ks_type, uint_t ks_ndata,
+    uchar_t ks_flags)
 {
 	kstat_t *ksp;
 
@@ -538,24 +541,24 @@  __kstat_create(const char *ks_module, int ks_instance, const char *ks_name,
 	ASSERT(!(ks_flags & KSTAT_FLAG_UNSUPPORTED));
 
 	if ((ks_type == KSTAT_TYPE_INTR) || (ks_type == KSTAT_TYPE_IO))
-                ASSERT(ks_ndata == 1);
+		ASSERT(ks_ndata == 1);
 
-	ksp = kmem_zalloc(sizeof(*ksp), KM_SLEEP);
+	ksp = kmem_zalloc(sizeof (*ksp), KM_SLEEP);
 	if (ksp == NULL)
-		return ksp;
+		return (ksp);
 
 	mutex_enter(&kstat_module_lock);
 	ksp->ks_kid = kstat_id;
-        kstat_id++;
+	kstat_id++;
 	mutex_exit(&kstat_module_lock);
 
-        ksp->ks_magic = KS_MAGIC;
+	ksp->ks_magic = KS_MAGIC;
 	mutex_init(&ksp->ks_private_lock, NULL, MUTEX_DEFAULT, NULL);
 	ksp->ks_lock = &ksp->ks_private_lock;
 	INIT_LIST_HEAD(&ksp->ks_list);
 
 	ksp->ks_crtime = gethrtime();
-        ksp->ks_snaptime = ksp->ks_crtime;
+	ksp->ks_snaptime = ksp->ks_crtime;
 	strncpy(ksp->ks_module, ks_module, KSTAT_STRLEN);
 	ksp->ks_instance = ks_instance;
 	strncpy(ksp->ks_name, ks_name, KSTAT_STRLEN);
@@ -571,41 +574,41 @@  __kstat_create(const char *ks_module, int ks_instance, const char *ks_name,
 	ksp->ks_raw_bufsize = 0;
 
 	switch (ksp->ks_type) {
-                case KSTAT_TYPE_RAW:
-	                ksp->ks_ndata = 1;
-                        ksp->ks_data_size = ks_ndata;
-                        break;
-                case KSTAT_TYPE_NAMED:
-	                ksp->ks_ndata = ks_ndata;
-                        ksp->ks_data_size = ks_ndata * sizeof(kstat_named_t);
-                        break;
-                case KSTAT_TYPE_INTR:
-	                ksp->ks_ndata = ks_ndata;
-                        ksp->ks_data_size = ks_ndata * sizeof(kstat_intr_t);
-                        break;
-                case KSTAT_TYPE_IO:
-	                ksp->ks_ndata = ks_ndata;
-                        ksp->ks_data_size = ks_ndata * sizeof(kstat_io_t);
-                        break;
-                case KSTAT_TYPE_TIMER:
-	                ksp->ks_ndata = ks_ndata;
-                        ksp->ks_data_size = ks_ndata * sizeof(kstat_timer_t);
-                        break;
-                default:
-                        PANIC("Undefined kstat type %d\n", ksp->ks_type);
-        }
+		case KSTAT_TYPE_RAW:
+			ksp->ks_ndata = 1;
+			ksp->ks_data_size = ks_ndata;
+			break;
+		case KSTAT_TYPE_NAMED:
+			ksp->ks_ndata = ks_ndata;
+			ksp->ks_data_size = ks_ndata * sizeof (kstat_named_t);
+			break;
+		case KSTAT_TYPE_INTR:
+			ksp->ks_ndata = ks_ndata;
+			ksp->ks_data_size = ks_ndata * sizeof (kstat_intr_t);
+			break;
+		case KSTAT_TYPE_IO:
+			ksp->ks_ndata = ks_ndata;
+			ksp->ks_data_size = ks_ndata * sizeof (kstat_io_t);
+			break;
+		case KSTAT_TYPE_TIMER:
+			ksp->ks_ndata = ks_ndata;
+			ksp->ks_data_size = ks_ndata * sizeof (kstat_timer_t);
+			break;
+		default:
+			PANIC("Undefined kstat type %d\n", ksp->ks_type);
+	}
 
 	if (ksp->ks_flags & KSTAT_FLAG_VIRTUAL) {
-                ksp->ks_data = NULL;
-        } else {
-                ksp->ks_data = kmem_zalloc(ksp->ks_data_size, KM_SLEEP);
-                if (ksp->ks_data == NULL) {
-                        kmem_free(ksp, sizeof(*ksp));
-                        ksp = NULL;
-                }
-        }
-
-	return ksp;
+		ksp->ks_data = NULL;
+	} else {
+		ksp->ks_data = kmem_zalloc(ksp->ks_data_size, KM_SLEEP);
+		if (ksp->ks_data == NULL) {
+			kmem_free(ksp, sizeof (*ksp));
+			ksp = NULL;
+		}
+	}
+
+	return (ksp);
 }
 EXPORT_SYMBOL(__kstat_create);
 
@@ -614,21 +617,27 @@  kstat_detect_collision(kstat_t *ksp)
 {
 	kstat_module_t *module;
 	kstat_t *tmp;
-	char parent[KSTAT_STRLEN+1];
+	char *parent;
 	char *cp;
 
-	(void) strlcpy(parent, ksp->ks_module, sizeof(parent));
+	parent = kmem_asprintf("%s", ksp->ks_module);
 
-	if ((cp = strrchr(parent, '/')) == NULL)
+	if ((cp = strrchr(parent, '/')) == NULL) {
+		strfree(parent);
 		return (0);
+	}
 
 	cp[0] = '\0';
 	if ((module = kstat_find_module(parent)) != NULL) {
-		list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list)
-			if (strncmp(tmp->ks_name, cp+1, KSTAT_STRLEN) == 0)
+		list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) {
+			if (strncmp(tmp->ks_name, cp+1, KSTAT_STRLEN) == 0) {
+				strfree(parent);
 				return (EEXIST);
+			}
+		}
 	}
 
+	strfree(parent);
 	return (0);
 }
 
@@ -658,9 +667,10 @@  __kstat_install(kstat_t *ksp)
 	 * Only one entry by this name per-module, on failure the module
 	 * shouldn't be deleted because we know it has at least one entry.
 	 */
-	list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list)
+	list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) {
 		if (strncmp(tmp->ks_name, ksp->ks_name, KSTAT_STRLEN) == 0)
 			goto out;
+	}
 
 	list_add_tail(&ksp->ks_list, &module->ksm_kstat_list);
 
@@ -701,9 +711,7 @@  __kstat_delete(kstat_t *ksp)
 
 	ksp->ks_lock = NULL;
 	mutex_destroy(&ksp->ks_private_lock);
-	kmem_free(ksp, sizeof(*ksp));
-
-	return;
+	kmem_free(ksp, sizeof (*ksp));
 }
 EXPORT_SYMBOL(__kstat_delete);
 
@@ -712,7 +720,7 @@  spl_kstat_init(void)
 {
 	mutex_init(&kstat_module_lock, NULL, MUTEX_DEFAULT, NULL);
 	INIT_LIST_HEAD(&kstat_module_list);
-        kstat_id = 0;
+	kstat_id = 0;
 	return (0);
 }
 
@@ -722,4 +730,3 @@  spl_kstat_fini(void)
 	ASSERT(list_empty(&kstat_module_list));
 	mutex_destroy(&kstat_module_lock);
 }
-
diff --git a/spl/module/spl/spl-mutex.c b/spl/module/spl/spl-mutex.c
index a29d488..dfb26bf 100644
--- a/spl/module/spl/spl-mutex.c
+++ b/spl/module/spl/spl-mutex.c
@@ -20,17 +20,11 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Mutex Implementation.
 \*****************************************************************************/
 
 #include <sys/mutex.h>
 
-#ifdef DEBUG_SUBSYSTEM
-#undef DEBUG_SUBSYSTEM
-#endif
-
-#define DEBUG_SUBSYSTEM S_MUTEX
-
 int spl_mutex_init(void) { return 0; }
 void spl_mutex_fini(void) { }
diff --git a/spl/module/spl/spl-proc.c b/spl/module/spl/spl-proc.c
index 05c1a5d..8ce5bbe 100644
--- a/spl/module/spl/spl-proc.c
+++ b/spl/module/spl/spl-proc.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Proc Implementation.
 \*****************************************************************************/
 
@@ -37,7 +37,7 @@ 
 #include <linux/uaccess.h>
 #include <linux/version.h>
 
-#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
 typedef struct ctl_table __no_const spl_ctl_table;
 #else
 typedef struct ctl_table spl_ctl_table;
@@ -55,56 +55,57 @@  static struct proc_dir_entry *proc_spl_taskq = NULL;
 struct proc_dir_entry *proc_spl_kstat = NULL;
 
 static int
-proc_copyin_string(char *kbuffer, int kbuffer_size,
-                   const char *ubuffer, int ubuffer_size)
+proc_copyin_string(char *kbuffer, int kbuffer_size, const char *ubuffer,
+    int ubuffer_size)
 {
-        int size;
+	int size;
 
-        if (ubuffer_size > kbuffer_size)
-                return -EOVERFLOW;
+	if (ubuffer_size > kbuffer_size)
+		return (-EOVERFLOW);
 
-        if (copy_from_user((void *)kbuffer, (void *)ubuffer, ubuffer_size))
-                return -EFAULT;
+	if (copy_from_user((void *)kbuffer, (void *)ubuffer, ubuffer_size))
+		return (-EFAULT);
 
-        /* strip trailing whitespace */
-        size = strnlen(kbuffer, ubuffer_size);
-        while (size-- >= 0)
-                if (!isspace(kbuffer[size]))
-                        break;
+	/* strip trailing whitespace */
+	size = strnlen(kbuffer, ubuffer_size);
+	while (size-- >= 0)
+		if (!isspace(kbuffer[size]))
+			break;
 
-        /* empty string */
-        if (size < 0)
-                return -EINVAL;
+	/* empty string */
+	if (size < 0)
+		return (-EINVAL);
 
-        /* no space to terminate */
-        if (size == kbuffer_size)
-                return -EOVERFLOW;
+	/* no space to terminate */
+	if (size == kbuffer_size)
+		return (-EOVERFLOW);
 
-        kbuffer[size + 1] = 0;
-        return 0;
+	kbuffer[size + 1] = 0;
+	return (0);
 }
 
 static int
-proc_copyout_string(char *ubuffer, int ubuffer_size,
-                    const char *kbuffer, char *append)
+proc_copyout_string(char *ubuffer, int ubuffer_size, const char *kbuffer,
+    char *append)
 {
-        /* NB if 'append' != NULL, it's a single character to append to the
-         * copied out string - usually "\n", for /proc entries and
-         * (i.e. a terminating zero byte) for sysctl entries
-         */
-        int size = MIN(strlen(kbuffer), ubuffer_size);
+	/*
+	 * NB if 'append' != NULL, it's a single character to append to the
+	 * copied out string - usually "\n", for /proc entries and
+	 * (i.e. a terminating zero byte) for sysctl entries
+	 */
+	int size = MIN(strlen(kbuffer), ubuffer_size);
 
-        if (copy_to_user(ubuffer, kbuffer, size))
-                return -EFAULT;
+	if (copy_to_user(ubuffer, kbuffer, size))
+		return (-EFAULT);
 
-        if (append != NULL && size < ubuffer_size) {
-                if (copy_to_user(ubuffer + size, append, 1))
-                        return -EFAULT;
+	if (append != NULL && size < ubuffer_size) {
+		if (copy_to_user(ubuffer + size, append, 1))
+			return (-EFAULT);
 
-                size++;
-        }
+		size++;
+	}
 
-        return size;
+	return (size);
 }
 
 #ifdef DEBUG_KMEM
@@ -112,27 +113,27 @@  static int
 proc_domemused(struct ctl_table *table, int write,
     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-        int rc = 0;
-        unsigned long min = 0, max = ~0, val;
-        spl_ctl_table dummy = *table;
-
-        dummy.data = &val;
-        dummy.proc_handler = &proc_dointvec;
-        dummy.extra1 = &min;
-        dummy.extra2 = &max;
-
-        if (write) {
-                *ppos += *lenp;
-        } else {
-# ifdef HAVE_ATOMIC64_T
-                val = atomic64_read((atomic64_t *)table->data);
-# else
-                val = atomic_read((atomic_t *)table->data);
-# endif /* HAVE_ATOMIC64_T */
-                rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos);
-        }
-
-        return (rc);
+	int rc = 0;
+	unsigned long min = 0, max = ~0, val;
+	spl_ctl_table dummy = *table;
+
+	dummy.data = &val;
+	dummy.proc_handler = &proc_dointvec;
+	dummy.extra1 = &min;
+	dummy.extra2 = &max;
+
+	if (write) {
+		*ppos += *lenp;
+	} else {
+#ifdef HAVE_ATOMIC64_T
+		val = atomic64_read((atomic64_t *)table->data);
+#else
+		val = atomic_read((atomic_t *)table->data);
+#endif /* HAVE_ATOMIC64_T */
+		rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos);
+	}
+
+	return (rc);
 }
 #endif /* DEBUG_KMEM */
 
@@ -140,23 +141,23 @@  static int
 proc_doslab(struct ctl_table *table, int write,
     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-        int rc = 0;
-        unsigned long min = 0, max = ~0, val = 0, mask;
-        spl_ctl_table dummy = *table;
-        spl_kmem_cache_t *skc;
+	int rc = 0;
+	unsigned long min = 0, max = ~0, val = 0, mask;
+	spl_ctl_table dummy = *table;
+	spl_kmem_cache_t *skc;
 
-        dummy.data = &val;
-        dummy.proc_handler = &proc_dointvec;
-        dummy.extra1 = &min;
-        dummy.extra2 = &max;
+	dummy.data = &val;
+	dummy.proc_handler = &proc_dointvec;
+	dummy.extra1 = &min;
+	dummy.extra2 = &max;
 
-        if (write) {
-                *ppos += *lenp;
-        } else {
-                down_read(&spl_kmem_cache_sem);
-                mask = (unsigned long)table->data;
+	if (write) {
+		*ppos += *lenp;
+	} else {
+		down_read(&spl_kmem_cache_sem);
+		mask = (unsigned long)table->data;
 
-                list_for_each_entry(skc, &spl_kmem_cache_list, skc_list) {
+		list_for_each_entry(skc, &spl_kmem_cache_list, skc_list) {
 
 			/* Only use slabs of the correct kmem/vmem type */
 			if (!(skc->skc_flags & mask))
@@ -165,58 +166,61 @@  proc_doslab(struct ctl_table *table, int write,
 			/* Sum the specified field for selected slabs */
 			switch (mask & (KMC_TOTAL | KMC_ALLOC | KMC_MAX)) {
 			case KMC_TOTAL:
-	                        val += skc->skc_slab_size * skc->skc_slab_total;
+				val += skc->skc_slab_size * skc->skc_slab_total;
 				break;
 			case KMC_ALLOC:
-	                        val += skc->skc_obj_size * skc->skc_obj_alloc;
+				val += skc->skc_obj_size * skc->skc_obj_alloc;
 				break;
 			case KMC_MAX:
-	                        val += skc->skc_obj_size * skc->skc_obj_max;
+				val += skc->skc_obj_size * skc->skc_obj_max;
 				break;
 			}
-                }
+		}
 
-                up_read(&spl_kmem_cache_sem);
-                rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos);
-        }
+		up_read(&spl_kmem_cache_sem);
+		rc = proc_doulongvec_minmax(&dummy, write, buffer, lenp, ppos);
+	}
 
-        return (rc);
+	return (rc);
 }
 
 static int
 proc_dohostid(struct ctl_table *table, int write,
     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-        int len, rc = 0;
-        char *end, str[32];
-
-        if (write) {
-                /* We can't use proc_doulongvec_minmax() in the write
-                 * case here because hostid while a hex value has no
-                 * leading 0x which confuses the helper function. */
-                rc = proc_copyin_string(str, sizeof(str), buffer, *lenp);
-                if (rc < 0)
-                        return (rc);
-
-                spl_hostid = simple_strtoul(str, &end, 16);
-                if (str == end)
-                        return (-EINVAL);
-
-        } else {
-                len = snprintf(str, sizeof(str), "%lx",
+	int len, rc = 0;
+	char *end, str[32];
+
+	if (write) {
+		/*
+		 * We can't use proc_doulongvec_minmax() in the write
+		 * case here because hostid while a hex value has no
+		 * leading 0x which confuses the helper function.
+		 */
+		rc = proc_copyin_string(str, sizeof (str), buffer, *lenp);
+		if (rc < 0)
+			return (rc);
+
+		spl_hostid = simple_strtoul(str, &end, 16);
+		if (str == end)
+			return (-EINVAL);
+
+	} else {
+		len = snprintf(str, sizeof (str), "%lx",
 		    (unsigned long) zone_get_hostid(NULL));
-                if (*ppos >= len)
-                        rc = 0;
-                else
-                        rc = proc_copyout_string(buffer,*lenp,str+*ppos,"\n");
-
-                if (rc >= 0) {
-                        *lenp = rc;
-                        *ppos += rc;
-                }
-        }
-
-        return (rc);
+		if (*ppos >= len)
+			rc = 0;
+		else
+			rc = proc_copyout_string(buffer,
+			    *lenp, str + *ppos, "\n");
+
+		if (rc >= 0) {
+			*lenp = rc;
+			*ppos += rc;
+		}
+	}
+
+	return (rc);
 }
 
 static void
@@ -229,15 +233,17 @@  taskq_seq_show_headers(struct seq_file *f)
 
 /* indices into the lheads array below */
 #define	LHEAD_PEND	0
-#define LHEAD_PRIO	1
-#define LHEAD_DELAY	2
-#define LHEAD_WAIT	3
-#define LHEAD_ACTIVE	4
-#define LHEAD_SIZE	5
+#define	LHEAD_PRIO	1
+#define	LHEAD_DELAY	2
+#define	LHEAD_WAIT	3
+#define	LHEAD_ACTIVE	4
+#define	LHEAD_SIZE	5
 
+/* BEGIN CSTYLED */
 static unsigned int spl_max_show_tasks = 512;
 module_param(spl_max_show_tasks, uint, 0644);
 MODULE_PARM_DESC(spl_max_show_tasks, "Max number of tasks shown in taskq proc");
+/* END CSTYLED */
 
 static int
 taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag)
@@ -287,7 +293,7 @@  taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag)
 		spin_unlock_irqrestore(&tq->tq_wait_waitq.lock, wflags);
 
 	/* show the base taskq contents */
-	snprintf(name, sizeof(name), "%s/%d", tq->tq_name, tq->tq_instance);
+	snprintf(name, sizeof (name), "%s/%d", tq->tq_name, tq->tq_instance);
 	seq_printf(f, "%-25s ", name);
 	seq_printf(f, "%5d %5d %5d %5d %5d %5d %12d %5d %10x\n",
 	    tq->tq_nactive, tq->tq_nthreads, tq->tq_nspawn,
@@ -299,7 +305,8 @@  taskq_seq_show_impl(struct seq_file *f, void *p, boolean_t allflag)
 		j = 0;
 		list_for_each_entry(tqt, &tq->tq_active_list, tqt_active_list) {
 			if (j == 0)
-				seq_printf(f, "\t%s:", list_names[LHEAD_ACTIVE]);
+				seq_printf(f, "\t%s:",
+				    list_names[LHEAD_ACTIVE]);
 			else if (j == 2) {
 				seq_printf(f, "\n\t       ");
 				j = 0;
@@ -403,32 +410,32 @@  taskq_seq_next(struct seq_file *f, void *p, loff_t *pos)
 
 	++*pos;
 	return ((tq->tq_taskqs.next == &tq_list) ?
-	       NULL : list_entry(tq->tq_taskqs.next, taskq_t, tq_taskqs));
+	    NULL : list_entry(tq->tq_taskqs.next, taskq_t, tq_taskqs));
 }
 
 static void
 slab_seq_show_headers(struct seq_file *f)
 {
-        seq_printf(f,
-            "--------------------- cache ----------"
-            "---------------------------------------------  "
-            "----- slab ------  "
-            "---- object -----  "
-            "--- emergency ---\n");
-        seq_printf(f,
-            "name                                  "
-            "  flags      size     alloc slabsize  objsize  "
-            "total alloc   max  "
-            "total alloc   max  "
-            "dlock alloc   max\n");
+	seq_printf(f,
+	    "--------------------- cache ----------"
+	    "---------------------------------------------  "
+	    "----- slab ------  "
+	    "---- object -----  "
+	    "--- emergency ---\n");
+	seq_printf(f,
+	    "name                                  "
+	    "  flags      size     alloc slabsize  objsize  "
+	    "total alloc   max  "
+	    "total alloc   max  "
+	    "dlock alloc   max\n");
 }
 
 static int
 slab_seq_show(struct seq_file *f, void *p)
 {
-        spl_kmem_cache_t *skc = p;
+	spl_kmem_cache_t *skc = p;
 
-        ASSERT(skc->skc_magic == SKC_MAGIC);
+	ASSERT(skc->skc_magic == SKC_MAGIC);
 
 	/*
 	 * Backed by Linux slab see /proc/slabinfo.
@@ -436,48 +443,48 @@  slab_seq_show(struct seq_file *f, void *p)
 	if (skc->skc_flags & KMC_SLAB)
 		return (0);
 
-        spin_lock(&skc->skc_lock);
-        seq_printf(f, "%-36s  ", skc->skc_name);
-        seq_printf(f, "0x%05lx %9lu %9lu %8u %8u  "
-            "%5lu %5lu %5lu  %5lu %5lu %5lu  %5lu %5lu %5lu\n",
-            (long unsigned)skc->skc_flags,
-            (long unsigned)(skc->skc_slab_size * skc->skc_slab_total),
-            (long unsigned)(skc->skc_obj_size * skc->skc_obj_alloc),
-            (unsigned)skc->skc_slab_size,
-            (unsigned)skc->skc_obj_size,
-            (long unsigned)skc->skc_slab_total,
-            (long unsigned)skc->skc_slab_alloc,
-            (long unsigned)skc->skc_slab_max,
-            (long unsigned)skc->skc_obj_total,
-            (long unsigned)skc->skc_obj_alloc,
-            (long unsigned)skc->skc_obj_max,
-            (long unsigned)skc->skc_obj_deadlock,
-            (long unsigned)skc->skc_obj_emergency,
-            (long unsigned)skc->skc_obj_emergency_max);
-
-        spin_unlock(&skc->skc_lock);
-
-        return 0;
+	spin_lock(&skc->skc_lock);
+	seq_printf(f, "%-36s  ", skc->skc_name);
+	seq_printf(f, "0x%05lx %9lu %9lu %8u %8u  "
+	    "%5lu %5lu %5lu  %5lu %5lu %5lu  %5lu %5lu %5lu\n",
+	    (long unsigned)skc->skc_flags,
+	    (long unsigned)(skc->skc_slab_size * skc->skc_slab_total),
+	    (long unsigned)(skc->skc_obj_size * skc->skc_obj_alloc),
+	    (unsigned)skc->skc_slab_size,
+	    (unsigned)skc->skc_obj_size,
+	    (long unsigned)skc->skc_slab_total,
+	    (long unsigned)skc->skc_slab_alloc,
+	    (long unsigned)skc->skc_slab_max,
+	    (long unsigned)skc->skc_obj_total,
+	    (long unsigned)skc->skc_obj_alloc,
+	    (long unsigned)skc->skc_obj_max,
+	    (long unsigned)skc->skc_obj_deadlock,
+	    (long unsigned)skc->skc_obj_emergency,
+	    (long unsigned)skc->skc_obj_emergency_max);
+
+	spin_unlock(&skc->skc_lock);
+
+	return (0);
 }
 
 static void *
 slab_seq_start(struct seq_file *f, loff_t *pos)
 {
-        struct list_head *p;
-        loff_t n = *pos;
+	struct list_head *p;
+	loff_t n = *pos;
 
 	down_read(&spl_kmem_cache_sem);
-        if (!n)
-                slab_seq_show_headers(f);
+	if (!n)
+		slab_seq_show_headers(f);
 
-        p = spl_kmem_cache_list.next;
-        while (n--) {
-                p = p->next;
-                if (p == &spl_kmem_cache_list)
-                        return (NULL);
-        }
+	p = spl_kmem_cache_list.next;
+	while (n--) {
+		p = p->next;
+		if (p == &spl_kmem_cache_list)
+			return (NULL);
+	}
 
-        return (list_entry(p, spl_kmem_cache_t, skc_list));
+	return (list_entry(p, spl_kmem_cache_t, skc_list));
 }
 
 static void *
@@ -485,9 +492,9 @@  slab_seq_next(struct seq_file *f, void *p, loff_t *pos)
 {
 	spl_kmem_cache_t *skc = p;
 
-        ++*pos;
-        return ((skc->skc_list.next == &spl_kmem_cache_list) ?
-	       NULL : list_entry(skc->skc_list.next,spl_kmem_cache_t,skc_list));
+	++*pos;
+	return ((skc->skc_list.next == &spl_kmem_cache_list) ?
+	    NULL : list_entry(skc->skc_list.next, spl_kmem_cache_t, skc_list));
 }
 
 static void
@@ -497,23 +504,23 @@  slab_seq_stop(struct seq_file *f, void *v)
 }
 
 static struct seq_operations slab_seq_ops = {
-        .show  = slab_seq_show,
-        .start = slab_seq_start,
-        .next  = slab_seq_next,
-        .stop  = slab_seq_stop,
+	.show  = slab_seq_show,
+	.start = slab_seq_start,
+	.next  = slab_seq_next,
+	.stop  = slab_seq_stop,
 };
 
 static int
 proc_slab_open(struct inode *inode, struct file *filp)
 {
-        return seq_open(filp, &slab_seq_ops);
+	return (seq_open(filp, &slab_seq_ops));
 }
 
 static struct file_operations proc_slab_operations = {
-        .open           = proc_slab_open,
-        .read           = seq_read,
-        .llseek         = seq_lseek,
-        .release        = seq_release,
+	.open	   = proc_slab_open,
+	.read	   = seq_read,
+	.llseek	 = seq_lseek,
+	.release	= seq_release,
 };
 
 static void
@@ -523,122 +530,122 @@  taskq_seq_stop(struct seq_file *f, void *v)
 }
 
 static struct seq_operations taskq_all_seq_ops = {
-	.show  = taskq_all_seq_show,
-	.start = taskq_seq_start,
-	.next  = taskq_seq_next,
-	.stop  = taskq_seq_stop,
+	.show	= taskq_all_seq_show,
+	.start	= taskq_seq_start,
+	.next	= taskq_seq_next,
+	.stop	= taskq_seq_stop,
 };
 
 static struct seq_operations taskq_seq_ops = {
-	.show  = taskq_seq_show,
-	.start = taskq_seq_start,
-	.next  = taskq_seq_next,
-	.stop  = taskq_seq_stop,
+	.show	= taskq_seq_show,
+	.start	= taskq_seq_start,
+	.next	= taskq_seq_next,
+	.stop	= taskq_seq_stop,
 };
 
 static int
 proc_taskq_all_open(struct inode *inode, struct file *filp)
 {
-	return seq_open(filp, &taskq_all_seq_ops);
+	return (seq_open(filp, &taskq_all_seq_ops));
 }
 
 static int
 proc_taskq_open(struct inode *inode, struct file *filp)
 {
-	return seq_open(filp, &taskq_seq_ops);
+	return (seq_open(filp, &taskq_seq_ops));
 }
 
 static struct file_operations proc_taskq_all_operations = {
-	.open           = proc_taskq_all_open,
-	.read           = seq_read,
-	.llseek         = seq_lseek,
-	.release        = seq_release,
+	.open		= proc_taskq_all_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
 };
 
 static struct file_operations proc_taskq_operations = {
-	.open           = proc_taskq_open,
-	.read           = seq_read,
-	.llseek         = seq_lseek,
-	.release        = seq_release,
+	.open		= proc_taskq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
 };
 
 static struct ctl_table spl_kmem_table[] = {
 #ifdef DEBUG_KMEM
-        {
-                .procname = "kmem_used",
-                .data     = &kmem_alloc_used,
-# ifdef HAVE_ATOMIC64_T
-                .maxlen   = sizeof(atomic64_t),
-# else
-                .maxlen   = sizeof(atomic_t),
-# endif /* HAVE_ATOMIC64_T */
-                .mode     = 0444,
-                .proc_handler = &proc_domemused,
-        },
-        {
-                .procname = "kmem_max",
-                .data     = &kmem_alloc_max,
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doulongvec_minmax,
-        },
+	{
+		.procname	= "kmem_used",
+		.data		= &kmem_alloc_used,
+#ifdef HAVE_ATOMIC64_T
+		.maxlen		= sizeof (atomic64_t),
+#else
+		.maxlen		= sizeof (atomic_t),
+#endif /* HAVE_ATOMIC64_T */
+		.mode		= 0444,
+		.proc_handler	= &proc_domemused,
+	},
+	{
+		.procname	= "kmem_max",
+		.data		= &kmem_alloc_max,
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doulongvec_minmax,
+	},
 #endif /* DEBUG_KMEM */
-        {
-                .procname = "slab_kmem_total",
-		.data     = (void *)(KMC_KMEM | KMC_TOTAL),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
-        {
-                .procname = "slab_kmem_alloc",
-		.data     = (void *)(KMC_KMEM | KMC_ALLOC),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
-        {
-                .procname = "slab_kmem_max",
-		.data     = (void *)(KMC_KMEM | KMC_MAX),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
-        {
-                .procname = "slab_vmem_total",
-		.data     = (void *)(KMC_VMEM | KMC_TOTAL),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
-        {
-                .procname = "slab_vmem_alloc",
-		.data     = (void *)(KMC_VMEM | KMC_ALLOC),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
-        {
-                .procname = "slab_vmem_max",
-		.data     = (void *)(KMC_VMEM | KMC_MAX),
-                .maxlen   = sizeof(unsigned long),
-                .extra1   = &table_min,
-                .extra2   = &table_max,
-                .mode     = 0444,
-                .proc_handler = &proc_doslab,
-        },
+	{
+		.procname	= "slab_kmem_total",
+		.data		= (void *)(KMC_KMEM | KMC_TOTAL),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler = &proc_doslab,
+	},
+	{
+		.procname	= "slab_kmem_alloc",
+		.data		= (void *)(KMC_KMEM | KMC_ALLOC),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doslab,
+	},
+	{
+		.procname	= "slab_kmem_max",
+		.data		= (void *)(KMC_KMEM | KMC_MAX),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doslab,
+	},
+	{
+		.procname	= "slab_vmem_total",
+		.data		= (void *)(KMC_VMEM | KMC_TOTAL),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doslab,
+	},
+	{
+		.procname	= "slab_vmem_alloc",
+		.data		= (void *)(KMC_VMEM | KMC_ALLOC),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doslab,
+	},
+	{
+		.procname	= "slab_vmem_max",
+		.data		= (void *)(KMC_VMEM | KMC_MAX),
+		.maxlen		= sizeof (unsigned long),
+		.extra1		= &table_min,
+		.extra2		= &table_max,
+		.mode		= 0444,
+		.proc_handler	= &proc_doslab,
+	},
 	{},
 };
 
@@ -647,43 +654,44 @@  static struct ctl_table spl_kstat_table[] = {
 };
 
 static struct ctl_table spl_table[] = {
-        /* NB No .strategy entries have been provided since
-         * sysctl(8) prefers to go via /proc for portability.
-         */
-        {
-                .procname = "version",
-                .data     = spl_version,
-                .maxlen   = sizeof(spl_version),
-                .mode     = 0444,
-                .proc_handler = &proc_dostring,
-        },
-        {
-                .procname = "hostid",
-                .data     = &spl_hostid,
-                .maxlen   = sizeof(unsigned long),
-                .mode     = 0644,
-                .proc_handler = &proc_dohostid,
-        },
+	/*
+	 * NB No .strategy entries have been provided since
+	 * sysctl(8) prefers to go via /proc for portability.
+	 */
+	{
+		.procname	= "version",
+		.data		= spl_version,
+		.maxlen		= sizeof (spl_version),
+		.mode		= 0444,
+		.proc_handler	= &proc_dostring,
+	},
+	{
+		.procname	= "hostid",
+		.data		= &spl_hostid,
+		.maxlen		= sizeof (unsigned long),
+		.mode		= 0644,
+		.proc_handler	= &proc_dohostid,
+	},
 	{
-		.procname = "kmem",
-		.mode     = 0555,
-		.child    = spl_kmem_table,
+		.procname	= "kmem",
+		.mode		= 0555,
+		.child		= spl_kmem_table,
 	},
 	{
-		.procname = "kstat",
-		.mode     = 0555,
-		.child    = spl_kstat_table,
+		.procname	= "kstat",
+		.mode		= 0555,
+		.child		= spl_kstat_table,
 	},
-        {},
+	{},
 };
 
 static struct ctl_table spl_dir[] = {
-        {
-                .procname = "spl",
-                .mode     = 0555,
-                .child    = spl_table,
-        },
-        {}
+	{
+		.procname	= "spl",
+		.mode		= 0555,
+		.child		= spl_table,
+	},
+	{}
 };
 
 static struct ctl_table spl_root[] = {
@@ -703,7 +711,7 @@  spl_proc_init(void)
 {
 	int rc = 0;
 
-        spl_header = register_sysctl_table(spl_root);
+	spl_header = register_sysctl_table(spl_root);
 	if (spl_header == NULL)
 		return (-EUNATCH);
 
@@ -713,62 +721,62 @@  spl_proc_init(void)
 		goto out;
 	}
 
-	proc_spl_taskq_all = proc_create_data("taskq-all", 0444,
-		proc_spl, &proc_taskq_all_operations, NULL);
+	proc_spl_taskq_all = proc_create_data("taskq-all", 0444, proc_spl,
+	    &proc_taskq_all_operations, NULL);
 	if (proc_spl_taskq_all == NULL) {
 		rc = -EUNATCH;
 		goto out;
 	}
 
-	proc_spl_taskq = proc_create_data("taskq", 0444,
-		proc_spl, &proc_taskq_operations, NULL);
+	proc_spl_taskq = proc_create_data("taskq", 0444, proc_spl,
+	    &proc_taskq_operations, NULL);
 	if (proc_spl_taskq == NULL) {
 		rc = -EUNATCH;
 		goto out;
 	}
 
-        proc_spl_kmem = proc_mkdir("kmem", proc_spl);
-        if (proc_spl_kmem == NULL) {
-                rc = -EUNATCH;
+	proc_spl_kmem = proc_mkdir("kmem", proc_spl);
+	if (proc_spl_kmem == NULL) {
+		rc = -EUNATCH;
 		goto out;
 	}
 
-	proc_spl_kmem_slab = proc_create_data("slab", 0444,
-		proc_spl_kmem, &proc_slab_operations, NULL);
-        if (proc_spl_kmem_slab == NULL) {
+	proc_spl_kmem_slab = proc_create_data("slab", 0444, proc_spl_kmem,
+	    &proc_slab_operations, NULL);
+	if (proc_spl_kmem_slab == NULL) {
 		rc = -EUNATCH;
 		goto out;
 	}
 
-        proc_spl_kstat = proc_mkdir("kstat", proc_spl);
-        if (proc_spl_kstat == NULL) {
-                rc = -EUNATCH;
+	proc_spl_kstat = proc_mkdir("kstat", proc_spl);
+	if (proc_spl_kstat == NULL) {
+		rc = -EUNATCH;
 		goto out;
 	}
 out:
 	if (rc) {
 		remove_proc_entry("kstat", proc_spl);
-	        remove_proc_entry("slab", proc_spl_kmem);
+		remove_proc_entry("slab", proc_spl_kmem);
 		remove_proc_entry("kmem", proc_spl);
 		remove_proc_entry("taskq-all", proc_spl);
 		remove_proc_entry("taskq", proc_spl);
 		remove_proc_entry("spl", NULL);
-	        unregister_sysctl_table(spl_header);
+		unregister_sysctl_table(spl_header);
 	}
 
-        return (rc);
+	return (rc);
 }
 
 void
 spl_proc_fini(void)
 {
 	remove_proc_entry("kstat", proc_spl);
-        remove_proc_entry("slab", proc_spl_kmem);
+	remove_proc_entry("slab", proc_spl_kmem);
 	remove_proc_entry("kmem", proc_spl);
 	remove_proc_entry("taskq-all", proc_spl);
 	remove_proc_entry("taskq", proc_spl);
 	remove_proc_entry("spl", NULL);
 
-        ASSERT(spl_header != NULL);
-        unregister_sysctl_table(spl_header);
+	ASSERT(spl_header != NULL);
+	unregister_sysctl_table(spl_header);
 }
diff --git a/spl/module/spl/spl-rwlock.c b/spl/module/spl/spl-rwlock.c
index d99ef4f..bf7ee2f 100644
--- a/spl/module/spl/spl-rwlock.c
+++ b/spl/module/spl/spl-rwlock.c
@@ -20,18 +20,12 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Reader/Writer Lock Implementation.
 \*****************************************************************************/
 
 #include <sys/rwlock.h>
 
-#ifdef DEBUG_SUBSYSTEM
-#undef DEBUG_SUBSYSTEM
-#endif
-
-#define DEBUG_SUBSYSTEM S_RWLOCK
-
 #if defined(CONFIG_PREEMPT_RT_FULL)
 
 #include <linux/rtmutex.h>
@@ -94,7 +88,7 @@  __rwsem_tryupgrade(struct rw_semaphore *rwsem)
 static int
 __rwsem_tryupgrade(struct rw_semaphore *rwsem)
 {
-	typeof (rwsem->count) val;
+	typeof(rwsem->count) val;
 	val = cmpxchg(&rwsem->count, SPL_RWSEM_SINGLE_READER_VALUE,
 	    SPL_RWSEM_SINGLE_WRITER_VALUE);
 	return (val == SPL_RWSEM_SINGLE_READER_VALUE);
diff --git a/spl/module/spl/spl-taskq.c b/spl/module/spl/spl-taskq.c
index a6bb9d9..2919a94 100644
--- a/spl/module/spl/spl-taskq.c
+++ b/spl/module/spl/spl-taskq.c
@@ -87,7 +87,7 @@  taskq_find_by_name(const char *name)
 	list_for_each_prev(tql, &tq_list) {
 		tq = list_entry(tql, taskq_t, tq_taskqs);
 		if (strcmp(name, tq->tq_name) == 0)
-			return tq->tq_instance;
+			return (tq->tq_instance);
 	}
 	return (-1);
 }
@@ -103,7 +103,6 @@  task_alloc(taskq_t *tq, uint_t flags, unsigned long *irqflags)
 	int count = 0;
 
 	ASSERT(tq);
-	ASSERT(spin_is_locked(&tq->tq_lock));
 retry:
 	/* Acquire taskq_ent_t's from free list if available */
 	if (!list_empty(&tq->tq_free_list) && !(flags & TQ_NEW)) {
@@ -168,7 +167,6 @@  task_free(taskq_t *tq, taskq_ent_t *t)
 {
 	ASSERT(tq);
 	ASSERT(t);
-	ASSERT(spin_is_locked(&tq->tq_lock));
 	ASSERT(list_empty(&t->tqent_list));
 	ASSERT(!timer_pending(&t->tqent_timer));
 
@@ -185,7 +183,6 @@  task_done(taskq_t *tq, taskq_ent_t *t)
 {
 	ASSERT(tq);
 	ASSERT(t);
-	ASSERT(spin_is_locked(&tq->tq_lock));
 
 	/* Wake tasks blocked in taskq_wait_id() */
 	wake_up_all(&t->tqent_waitq);
@@ -209,17 +206,9 @@  task_done(taskq_t *tq, taskq_ent_t *t)
  * add it to the priority list in order for immediate processing.
  */
 static void
-#ifdef HAVE_KERNEL_TIMER_SETUP
-task_expire(struct timer_list *tl)
-#else
-task_expire(unsigned long data)
-#endif
+task_expire_impl(taskq_ent_t *t)
 {
-#ifdef HAVE_KERNEL_TIMER_SETUP
-	taskq_ent_t *w, *t = (taskq_ent_t *)from_timer(t, tl, tqent_timer);
-#else
-	taskq_ent_t *w, *t = (taskq_ent_t *)data;
-#endif
+	taskq_ent_t *w;
 	taskq_t *tq = t->tqent_taskq;
 	struct list_head *l;
 	unsigned long flags;
@@ -253,6 +242,21 @@  task_expire(unsigned long data)
 	wake_up(&tq->tq_work_waitq);
 }
 
+#ifdef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
+static void
+task_expire(struct timer_list *tl)
+{
+	taskq_ent_t *t = from_timer(t, tl, tqent_timer);
+	task_expire_impl(t);
+}
+#else
+static void
+task_expire(unsigned long data)
+{
+	task_expire_impl((taskq_ent_t *)data);
+}
+#endif
+
 /*
  * Returns the lowest incomplete taskqid_t.  The taskqid_t may
  * be queued on the pending list, on the priority list, on the
@@ -267,7 +271,6 @@  taskq_lowest_id(taskq_t *tq)
 	taskq_thread_t *tqt;
 
 	ASSERT(tq);
-	ASSERT(spin_is_locked(&tq->tq_lock));
 
 	if (!list_empty(&tq->tq_pend_list)) {
 		t = list_entry(tq->tq_pend_list.next, taskq_ent_t, tqent_list);
@@ -305,7 +308,6 @@  taskq_insert_in_order(taskq_t *tq, taskq_thread_t *tqt)
 
 	ASSERT(tq);
 	ASSERT(tqt);
-	ASSERT(spin_is_locked(&tq->tq_lock));
 
 	list_for_each_prev(l, &tq->tq_active_list) {
 		w = list_entry(l, taskq_thread_t, tqt_active_list);
@@ -328,8 +330,6 @@  taskq_find_list(taskq_t *tq, struct list_head *lh, taskqid_t id)
 	struct list_head *l;
 	taskq_ent_t *t;
 
-	ASSERT(spin_is_locked(&tq->tq_lock));
-
 	list_for_each(l, lh) {
 		t = list_entry(l, taskq_ent_t, tqent_list);
 
@@ -356,8 +356,6 @@  taskq_find(taskq_t *tq, taskqid_t id)
 	struct list_head *l;
 	taskq_ent_t *t;
 
-	ASSERT(spin_is_locked(&tq->tq_lock));
-
 	t = taskq_find_list(tq, &tq->tq_delay_list, id);
 	if (t)
 		return (t);
@@ -575,7 +573,8 @@  taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags)
 	ASSERT(tq->tq_nactive <= tq->tq_nthreads);
 	if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) {
 		/* Dynamic taskq may be able to spawn another thread */
-		if (!(tq->tq_flags & TASKQ_DYNAMIC) || taskq_thread_spawn(tq) == 0)
+		if (!(tq->tq_flags & TASKQ_DYNAMIC) ||
+		    taskq_thread_spawn(tq) == 0)
 			goto out;
 	}
 
@@ -598,12 +597,10 @@  taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags)
 	t->tqent_func = func;
 	t->tqent_arg = arg;
 	t->tqent_taskq = tq;
-#ifdef HAVE_KERNEL_TIMER_SETUP
-	timer_setup(&t->tqent_timer, NULL, 0);
-#else
+#ifndef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
 	t->tqent_timer.data = 0;
-	t->tqent_timer.function = NULL;
 #endif
+	t->tqent_timer.function = NULL;
 	t->tqent_timer.expires = 0;
 	t->tqent_birth = jiffies;
 
@@ -652,12 +649,10 @@  taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg,
 	t->tqent_func = func;
 	t->tqent_arg = arg;
 	t->tqent_taskq = tq;
-#ifdef HAVE_KERNEL_TIMER_SETUP
-	timer_setup(&t->tqent_timer, task_expire, 0);
-#else
+#ifndef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
 	t->tqent_timer.data = (unsigned long)t;
-	t->tqent_timer.function = task_expire;
 #endif
+	t->tqent_timer.function = task_expire;
 	t->tqent_timer.expires = (unsigned long)expire_time;
 	add_timer(&t->tqent_timer);
 
@@ -692,7 +687,8 @@  taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
 
 	if ((flags & TQ_NOQUEUE) && (tq->tq_nactive == tq->tq_nthreads)) {
 		/* Dynamic taskq may be able to spawn another thread */
-		if (!(tq->tq_flags & TASKQ_DYNAMIC) || taskq_thread_spawn(tq) == 0)
+		if (!(tq->tq_flags & TASKQ_DYNAMIC) ||
+		    taskq_thread_spawn(tq) == 0)
 			goto out2;
 		flags |= TQ_FRONT;
 	}
@@ -748,7 +744,7 @@  taskq_init_ent(taskq_ent_t *t)
 {
 	spin_lock_init(&t->tqent_lock);
 	init_waitqueue_head(&t->tqent_waitq);
-#ifdef HAVE_KERNEL_TIMER_SETUP
+#ifdef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
 	timer_setup(&t->tqent_timer, NULL, 0);
 #else
 	init_timer(&t->tqent_timer);
@@ -771,8 +767,6 @@  taskq_next_ent(taskq_t *tq)
 {
 	struct list_head *list;
 
-	ASSERT(spin_is_locked(&tq->tq_lock));
-
 	if (!list_empty(&tq->tq_prio_list))
 		list = &tq->tq_prio_list;
 	else if (!list_empty(&tq->tq_pend_list))
@@ -794,7 +788,8 @@  taskq_thread_spawn_task(void *arg)
 
 	if (taskq_thread_create(tq) == NULL) {
 		/* restore spawning count if failed */
-		spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class);
+		spin_lock_irqsave_nested(&tq->tq_lock, flags,
+		    tq->tq_lock_class);
 		tq->tq_nspawn--;
 		spin_unlock_irqrestore(&tq->tq_lock, flags);
 	}
@@ -837,8 +832,6 @@  taskq_thread_spawn(taskq_t *tq)
 static int
 taskq_thread_should_stop(taskq_t *tq, taskq_thread_t *tqt)
 {
-	ASSERT(spin_is_locked(&tq->tq_lock));
-
 	if (!(tq->tq_flags & TASKQ_DYNAMIC))
 		return (0);
 
@@ -1156,7 +1149,8 @@  taskq_destroy(taskq_t *tq)
 	while (tq->tq_nspawn) {
 		spin_unlock_irqrestore(&tq->tq_lock, flags);
 		schedule_timeout_interruptible(1);
-		spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class);
+		spin_lock_irqsave_nested(&tq->tq_lock, flags,
+		    tq->tq_lock_class);
 	}
 
 	/*
@@ -1249,16 +1243,16 @@  param_set_taskq_kick(const char *val, struct kernel_param *kp)
 
 #ifdef module_param_cb
 static const struct kernel_param_ops param_ops_taskq_kick = {
-        .set = param_set_taskq_kick,
-        .get = param_get_uint,
+	.set = param_set_taskq_kick,
+	.get = param_get_uint,
 };
 module_param_cb(spl_taskq_kick, &param_ops_taskq_kick, &spl_taskq_kick, 0644);
 #else
 module_param_call(spl_taskq_kick, param_set_taskq_kick, param_get_uint,
-    &spl_taskq_kick, 0644);
+	&spl_taskq_kick, 0644);
 #endif
 MODULE_PARM_DESC(spl_taskq_kick,
-    "Write nonzero to kick stuck taskqs to spawn more threads");
+	"Write nonzero to kick stuck taskqs to spawn more threads");
 
 int
 spl_taskq_init(void)
diff --git a/spl/module/spl/spl-thread.c b/spl/module/spl/spl-thread.c
index b0f4d57..6f640fd 100644
--- a/spl/module/spl/spl-thread.c
+++ b/spl/module/spl/spl-thread.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Thread Implementation.
 \*****************************************************************************/
 
@@ -33,8 +33,8 @@ 
  */
 typedef struct thread_priv_s {
 	unsigned long tp_magic;		/* Magic */
-        int tp_name_size;		/* Name size */
-        char *tp_name;			/* Name (without _thread suffix) */
+	int tp_name_size;		/* Name size */
+	char *tp_name;			/* Name (without _thread suffix) */
 	void (*tp_func)(void *);	/* Registered function */
 	void *tp_args;			/* Args to be passed to function */
 	size_t tp_len;			/* Len to be passed to function */
@@ -55,12 +55,12 @@  thread_generic_wrapper(void *arg)
 	set_current_state(tp->tp_state);
 	set_user_nice((kthread_t *)current, PRIO_TO_NICE(tp->tp_pri));
 	kmem_free(tp->tp_name, tp->tp_name_size);
-	kmem_free(tp, sizeof(thread_priv_t));
+	kmem_free(tp, sizeof (thread_priv_t));
 
 	if (func)
 		func(args);
 
-	return 0;
+	return (0);
 }
 
 void
@@ -72,13 +72,14 @@  __thread_exit(void)
 }
 EXPORT_SYMBOL(__thread_exit);
 
-/* thread_create() may block forever if it cannot create a thread or
+/*
+ * thread_create() may block forever if it cannot create a thread or
  * allocate memory.  This is preferable to returning a NULL which Solaris
- * style callers likely never check for... since it can't fail. */
+ * style callers likely never check for... since it can't fail.
+ */
 kthread_t *
 __thread_create(caddr_t stk, size_t  stksize, thread_func_t func,
-		const char *name, void *args, size_t len, proc_t *pp,
-		int state, pri_t pri)
+    const char *name, void *args, size_t len, proc_t *pp, int state, pri_t pri)
 {
 	thread_priv_t *tp;
 	struct task_struct *tsk;
@@ -88,7 +89,7 @@  __thread_create(caddr_t stk, size_t  stksize, thread_func_t func,
 	/* Variable stack size unsupported */
 	ASSERT(stk == NULL);
 
-	tp = kmem_alloc(sizeof(thread_priv_t), KM_PUSHPAGE);
+	tp = kmem_alloc(sizeof (thread_priv_t), KM_PUSHPAGE);
 	if (tp == NULL)
 		return (NULL);
 
@@ -96,14 +97,15 @@  __thread_create(caddr_t stk, size_t  stksize, thread_func_t func,
 	tp->tp_name_size = strlen(name) + 1;
 
 	tp->tp_name = kmem_alloc(tp->tp_name_size, KM_PUSHPAGE);
-        if (tp->tp_name == NULL) {
-		kmem_free(tp, sizeof(thread_priv_t));
+	if (tp->tp_name == NULL) {
+		kmem_free(tp, sizeof (thread_priv_t));
 		return (NULL);
 	}
 
 	strncpy(tp->tp_name, name, tp->tp_name_size);
 
-	/* Strip trailing "_thread" from passed name which will be the func
+	/*
+	 * Strip trailing "_thread" from passed name which will be the func
 	 * name since the exposed API has no parameter for passing a name.
 	 */
 	p = strstr(tp->tp_name, "_thread");
@@ -117,7 +119,7 @@  __thread_create(caddr_t stk, size_t  stksize, thread_func_t func,
 	tp->tp_pri   = pri;
 
 	tsk = spl_kthread_create(thread_generic_wrapper, (void *)tp,
-			     "%s", tp->tp_name);
+	    "%s", tp->tp_name);
 	if (IS_ERR(tsk))
 		return (NULL);
 
@@ -139,7 +141,7 @@  spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
 	char name[TASK_COMM_LEN];
 
 	va_start(args, namefmt);
-	vsnprintf(name, sizeof(name), namefmt, args);
+	vsnprintf(name, sizeof (name), namefmt, args);
 	va_end(args);
 	do {
 		tsk = kthread_create(func, data, "%s", name);
diff --git a/spl/module/spl/spl-tsd.c b/spl/module/spl/spl-tsd.c
index bf82350..4c80029 100644
--- a/spl/module/spl/spl-tsd.c
+++ b/spl/module/spl/spl-tsd.c
@@ -315,7 +315,6 @@  tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid)
 static void
 tsd_hash_del(tsd_hash_table_t *table, tsd_hash_entry_t *entry)
 {
-	ASSERT(spin_is_locked(&table->ht_lock));
 	hlist_del(&entry->he_list);
 	list_del_init(&entry->he_key_list);
 	list_del_init(&entry->he_pid_list);
diff --git a/spl/module/spl/spl-vnode.c b/spl/module/spl/spl-vnode.c
index ca19d73..74ae8fe 100644
--- a/spl/module/spl/spl-vnode.c
+++ b/spl/module/spl/spl-vnode.c
@@ -20,7 +20,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) Vnode Implementation.
 \*****************************************************************************/
 
@@ -43,27 +43,27 @@  vtype_t
 vn_mode_to_vtype(mode_t mode)
 {
 	if (S_ISREG(mode))
-		return VREG;
+		return (VREG);
 
 	if (S_ISDIR(mode))
-		return VDIR;
+		return (VDIR);
 
 	if (S_ISCHR(mode))
-		return VCHR;
+		return (VCHR);
 
 	if (S_ISBLK(mode))
-		return VBLK;
+		return (VBLK);
 
 	if (S_ISFIFO(mode))
-		return VFIFO;
+		return (VFIFO);
 
 	if (S_ISLNK(mode))
-		return VLNK;
+		return (VLNK);
 
 	if (S_ISSOCK(mode))
-		return VSOCK;
+		return (VSOCK);
 
-	return VNON;
+	return (VNON);
 } /* vn_mode_to_vtype() */
 EXPORT_SYMBOL(vn_mode_to_vtype);
 
@@ -71,27 +71,27 @@  mode_t
 vn_vtype_to_mode(vtype_t vtype)
 {
 	if (vtype == VREG)
-		return S_IFREG;
+		return (S_IFREG);
 
 	if (vtype == VDIR)
-		return S_IFDIR;
+		return (S_IFDIR);
 
 	if (vtype == VCHR)
-		return S_IFCHR;
+		return (S_IFCHR);
 
 	if (vtype == VBLK)
-		return S_IFBLK;
+		return (S_IFBLK);
 
 	if (vtype == VFIFO)
-		return S_IFIFO;
+		return (S_IFIFO);
 
 	if (vtype == VLNK)
-		return S_IFLNK;
+		return (S_IFLNK);
 
 	if (vtype == VSOCK)
-		return S_IFSOCK;
+		return (S_IFSOCK);
 
-	return VNON;
+	return (VNON);
 } /* vn_vtype_to_mode() */
 EXPORT_SYMBOL(vn_vtype_to_mode);
 
@@ -118,8 +118,8 @@  vn_free(vnode_t *vp)
 EXPORT_SYMBOL(vn_free);
 
 int
-vn_open(const char *path, uio_seg_t seg, int flags, int mode,
-	vnode_t **vpp, int x1, void *x2)
+vn_open(const char *path, uio_seg_t seg, int flags, int mode, vnode_t **vpp,
+    int x1, void *x2)
 {
 	struct file *fp;
 	struct kstat stat;
@@ -135,7 +135,8 @@  vn_open(const char *path, uio_seg_t seg, int flags, int mode,
 	if (!(flags & FCREAT) && (flags & FWRITE))
 		flags |= FEXCL;
 
-	/* Note for filp_open() the two low bits must be remapped to mean:
+	/*
+	 * Note for filp_open() the two low bits must be remapped to mean:
 	 * 01 - read-only  -> 00 read-only
 	 * 10 - write-only -> 01 write-only
 	 * 11 - read-write -> 10 read-write
@@ -148,7 +149,7 @@  vn_open(const char *path, uio_seg_t seg, int flags, int mode,
 	fp = filp_open(path, flags, mode);
 
 	if (flags & FCREAT)
-		(void)xchg(&current->fs->umask, saved_umask);
+		(void) xchg(&current->fs->umask, saved_umask);
 
 	if (IS_ERR(fp))
 		return (-PTR_ERR(fp));
@@ -187,7 +188,7 @@  EXPORT_SYMBOL(vn_open);
 
 int
 vn_openat(const char *path, uio_seg_t seg, int flags, int mode,
-	  vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd)
+    vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd)
 {
 	char *realpath;
 	int len, rc;
@@ -199,7 +200,7 @@  vn_openat(const char *path, uio_seg_t seg, int flags, int mode,
 	if (!realpath)
 		return (ENOMEM);
 
-	(void)snprintf(realpath, len, "/%s", path);
+	(void) snprintf(realpath, len, "/%s", path);
 	rc = vn_open(realpath, seg, flags, mode, vpp, x1, x2);
 	kfree(realpath);
 
@@ -209,7 +210,7 @@  EXPORT_SYMBOL(vn_openat);
 
 int
 vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off,
-	uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp)
+    uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp)
 {
 	struct file *fp = vp->v_file;
 	loff_t offset = off;
@@ -259,9 +260,11 @@  vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4)
 } /* vn_close() */
 EXPORT_SYMBOL(vn_close);
 
-/* vn_seek() does not actually seek it only performs bounds checking on the
+/*
+ * vn_seek() does not actually seek it only performs bounds checking on the
  * proposed seek.  We perform minimal checking and allow vn_rdwr() to catch
- * anything more serious. */
+ * anything more serious.
+ */
 int
 vn_seek(vnode_t *vp, offset_t ooff, offset_t *noffp, void *ct)
 {
@@ -269,223 +272,6 @@  vn_seek(vnode_t *vp, offset_t ooff, offset_t *noffp, void *ct)
 }
 EXPORT_SYMBOL(vn_seek);
 
-/*
- * spl_basename() takes a NULL-terminated string s as input containing a path.
- * It returns a char pointer to a string and a length that describe the
- * basename of the path. If the basename is not "." or "/", it will be an index
- * into the string. While the string should be NULL terminated, the section
- * referring to the basename is not. spl_basename is dual-licensed GPLv2+ and
- * CC0. Anyone wishing to reuse it in another codebase may pick either license.
- */
-static void
-spl_basename(const char *s, const char **str, int *len)
-{
-	size_t i, end;
-
-	ASSERT(str);
-	ASSERT(len);
-
-	if (!s || !*s) {
-		*str = ".";
-		*len = 1;
-		return;
-	}
-
-	i = strlen(s) - 1;
-
-	while (i && s[i--] == '/');
-
-	if (i == 0) {
-		*str = "/";
-		*len = 1;
-		return;
-	}
-
-	end = i;
-
-	for (end = i; i; i--) {
-		if (s[i] == '/') {
-			*str = &s[i+1];
-			*len = end - i + 1;
-			return;
-		}
-	}
-
-	*str = s;
-	*len = end + 1;
-}
-
-static struct dentry *
-spl_kern_path_locked(const char *name, struct path *path)
-{
-	struct path parent;
-	struct dentry *dentry;
-	const char *basename;
-	int len;
-	int rc;
-
-	ASSERT(name);
-	ASSERT(path);
-
-	spl_basename(name, &basename, &len);
-
-	/* We do not accept "." or ".." */
-	if (len <= 2 && basename[0] == '.')
-		if (len == 1 || basename[1] == '.')
-			return (ERR_PTR(-EACCES));
-
-	rc = kern_path(name, LOOKUP_PARENT, &parent);
-	if (rc)
-		return (ERR_PTR(rc));
-
-	/* use I_MUTEX_PARENT because vfs_unlink needs it */
-	spl_inode_lock_nested(parent.dentry->d_inode, I_MUTEX_PARENT);
-
-	dentry = lookup_one_len(basename, parent.dentry, len);
-	if (IS_ERR(dentry)) {
-		spl_inode_unlock(parent.dentry->d_inode);
-		path_put(&parent);
-	} else {
-		*path = parent;
-	}
-
-	return (dentry);
-}
-
-/* Based on do_unlinkat() from linux/fs/namei.c */
-int
-vn_remove(const char *path, uio_seg_t seg, int flags)
-{
-	struct dentry *dentry;
-	struct path parent;
-	struct inode *inode = NULL;
-	int rc = 0;
-
-	ASSERT(seg == UIO_SYSSPACE);
-	ASSERT(flags == RMFILE);
-
-	dentry = spl_kern_path_locked(path, &parent);
-	rc = PTR_ERR(dentry);
-	if (!IS_ERR(dentry)) {
-		if (parent.dentry->d_name.name[parent.dentry->d_name.len]) {
-			rc = 0;
-			goto slashes;
-		}
-
-		inode = dentry->d_inode;
-		if (inode) {
-			atomic_inc(&inode->i_count);
-		} else {
-			rc = 0;
-			goto slashes;
-		}
-
-#ifdef HAVE_2ARGS_VFS_UNLINK
-		rc = vfs_unlink(parent.dentry->d_inode, dentry);
-#else
-		rc = vfs_unlink(parent.dentry->d_inode, dentry, NULL);
-#endif /* HAVE_2ARGS_VFS_UNLINK */
-exit1:
-		dput(dentry);
-	} else {
-		return (-rc);
-	}
-
-	spl_inode_unlock(parent.dentry->d_inode);
-	if (inode)
-		iput(inode);    /* truncate the inode here */
-
-	path_put(&parent);
-	return (-rc);
-
-slashes:
-	rc = !dentry->d_inode ? -ENOENT :
-	    S_ISDIR(dentry->d_inode->i_mode) ? -EISDIR : -ENOTDIR;
-	goto exit1;
-} /* vn_remove() */
-EXPORT_SYMBOL(vn_remove);
-
-/* Based on do_rename() from linux/fs/namei.c */
-int
-vn_rename(const char *oldname, const char *newname, int x1)
-{
-	struct dentry *old_dir, *new_dir;
-	struct dentry *old_dentry, *new_dentry;
-	struct dentry *trap;
-	struct path old_parent, new_parent;
-	int rc = 0;
-
-	old_dentry = spl_kern_path_locked(oldname, &old_parent);
-	if (IS_ERR(old_dentry)) {
-		rc = PTR_ERR(old_dentry);
-		goto exit;
-	}
-
-	spl_inode_unlock(old_parent.dentry->d_inode);
-
-	new_dentry = spl_kern_path_locked(newname, &new_parent);
-	if (IS_ERR(new_dentry)) {
-		rc = PTR_ERR(new_dentry);
-		goto exit2;
-	}
-
-	spl_inode_unlock(new_parent.dentry->d_inode);
-
-	rc = -EXDEV;
-	if (old_parent.mnt != new_parent.mnt)
-		goto exit3;
-
-	old_dir = old_parent.dentry;
-	new_dir = new_parent.dentry;
-	trap = lock_rename(new_dir, old_dir);
-
-	/* source should not be ancestor of target */
-	rc = -EINVAL;
-	if (old_dentry == trap)
-		goto exit4;
-
-	/* target should not be an ancestor of source */
-	rc = -ENOTEMPTY;
-	if (new_dentry == trap)
-		goto exit4;
-
-	/* source must exist */
-	rc = -ENOENT;
-	if (!old_dentry->d_inode)
-		goto exit4;
-
-	/* unless the source is a directory trailing slashes give -ENOTDIR */
-	if (!S_ISDIR(old_dentry->d_inode->i_mode)) {
-		rc = -ENOTDIR;
-		if (old_dentry->d_name.name[old_dentry->d_name.len])
-			goto exit4;
-		if (new_dentry->d_name.name[new_dentry->d_name.len])
-			goto exit4;
-	}
-
-#if defined(HAVE_4ARGS_VFS_RENAME)
-	rc = vfs_rename(old_dir->d_inode, old_dentry,
-	    new_dir->d_inode, new_dentry);
-#elif defined(HAVE_5ARGS_VFS_RENAME)
-	rc = vfs_rename(old_dir->d_inode, old_dentry,
-	    new_dir->d_inode, new_dentry, NULL);
-#else
-	rc = vfs_rename(old_dir->d_inode, old_dentry,
-	    new_dir->d_inode, new_dentry, NULL, 0);
-#endif
-exit4:
-	unlock_rename(new_dir, old_dir);
-exit3:
-	dput(new_dentry);
-	path_put(&new_parent);
-exit2:
-	dput(old_dentry);
-	path_put(&old_parent);
-exit:
-	return (-rc);
-}
-EXPORT_SYMBOL(vn_rename);
-
 int
 vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4)
 {
@@ -510,26 +296,27 @@  vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4)
 	if (rc)
 		return (-rc);
 
-	vap->va_type          = vn_mode_to_vtype(stat.mode);
-	vap->va_mode          = stat.mode;
-	vap->va_uid           = KUID_TO_SUID(stat.uid);
-	vap->va_gid           = KGID_TO_SGID(stat.gid);
-	vap->va_fsid          = 0;
-	vap->va_nodeid        = stat.ino;
-	vap->va_nlink         = stat.nlink;
-        vap->va_size          = stat.size;
-	vap->va_blksize       = stat.blksize;
-	vap->va_atime         = stat.atime;
-	vap->va_mtime         = stat.mtime;
-	vap->va_ctime         = stat.ctime;
-	vap->va_rdev          = stat.rdev;
-	vap->va_nblocks       = stat.blocks;
+	vap->va_type	= vn_mode_to_vtype(stat.mode);
+	vap->va_mode	= stat.mode;
+	vap->va_uid	= KUID_TO_SUID(stat.uid);
+	vap->va_gid	= KGID_TO_SGID(stat.gid);
+	vap->va_fsid	= 0;
+	vap->va_nodeid	= stat.ino;
+	vap->va_nlink	= stat.nlink;
+	vap->va_size	= stat.size;
+	vap->va_blksize	= stat.blksize;
+	vap->va_atime	= stat.atime;
+	vap->va_mtime	= stat.mtime;
+	vap->va_ctime	= stat.ctime;
+	vap->va_rdev	= stat.rdev;
+	vap->va_nblocks	= stat.blocks;
 
 	return (0);
 }
 EXPORT_SYMBOL(vn_getattr);
 
-int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4)
+int
+vn_fsync(vnode_t *vp, int flags, void *x3, void *x4)
 {
 	int datasync = 0;
 	int error;
@@ -614,9 +401,8 @@  int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int flag,
 		--end;
 
 		vp->v_file->f_dentry->d_inode->i_op->truncate_range(
-			vp->v_file->f_dentry->d_inode,
-			bfp->l_start, end
-		);
+		    vp->v_file->f_dentry->d_inode, bfp->l_start, end);
+
 		return (0);
 	}
 #endif
@@ -629,24 +415,22 @@  EXPORT_SYMBOL(vn_space);
 static file_t *
 file_find(int fd, struct task_struct *task)
 {
-        file_t *fp;
-
-	ASSERT(spin_is_locked(&vn_file_lock));
+	file_t *fp;
 
-        list_for_each_entry(fp, &vn_file_list,  f_list) {
+	list_for_each_entry(fp, &vn_file_list,  f_list) {
 		if (fd == fp->f_fd && fp->f_task == task) {
 			ASSERT(atomic_read(&fp->f_ref) != 0);
-                        return fp;
+			return (fp);
 		}
 	}
 
-        return NULL;
+	return (NULL);
 } /* file_find() */
 
 file_t *
 vn_getf(int fd)
 {
-        struct kstat stat;
+	struct kstat stat;
 	struct file *lfp;
 	file_t *fp;
 	vnode_t *vp;
@@ -701,13 +485,14 @@  vn_getf(int fd)
 		goto out_fget;
 
 #if defined(HAVE_4ARGS_VFS_GETATTR)
-	rc = vfs_getattr(&lfp->f_path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
+	rc = vfs_getattr(&lfp->f_path, &stat, STATX_TYPE,
+	    AT_STATX_SYNC_AS_STAT);
 #elif defined(HAVE_2ARGS_VFS_GETATTR)
 	rc = vfs_getattr(&lfp->f_path, &stat);
 #else
 	rc = vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat);
 #endif
-        if (rc)
+	if (rc)
 		goto out_vnode;
 
 	mutex_enter(&vp->v_lock);
@@ -734,7 +519,7 @@  vn_getf(int fd)
 	mutex_exit(&fp->f_lock);
 	kmem_cache_free(vn_file_cache, fp);
 out:
-        return (NULL);
+	return (NULL);
 } /* getf() */
 EXPORT_SYMBOL(getf);
 
@@ -775,12 +560,10 @@  vn_areleasef(int fd, uf_info_t *fip)
 			return;
 		}
 
-	        list_del(&fp->f_list);
+		list_del(&fp->f_list);
 		releasef_locked(fp);
 	}
 	spin_unlock(&vn_file_lock);
-
-	return;
 } /* releasef() */
 EXPORT_SYMBOL(areleasef);
 
@@ -815,34 +598,34 @@  vn_set_fs_pwd(struct fs_struct *fs, struct path *path)
 int
 vn_set_pwd(const char *filename)
 {
-        struct path path;
-        mm_segment_t saved_fs;
-        int rc;
-
-        /*
-         * user_path_dir() and __user_walk() both expect 'filename' to be
-         * a user space address so we must briefly increase the data segment
-         * size to ensure strncpy_from_user() does not fail with -EFAULT.
-         */
-        saved_fs = get_fs();
-        set_fs(get_ds());
-
-        rc = user_path_dir(filename, &path);
-        if (rc)
+	struct path path;
+	mm_segment_t saved_fs;
+	int rc;
+
+	/*
+	 * user_path_dir() and __user_walk() both expect 'filename' to be
+	 * a user space address so we must briefly increase the data segment
+	 * size to ensure strncpy_from_user() does not fail with -EFAULT.
+	 */
+	saved_fs = get_fs();
+	set_fs(get_ds());
+
+	rc = user_path_dir(filename, &path);
+	if (rc)
 		goto out;
 
-        rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS);
-        if (rc)
+	rc = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS);
+	if (rc)
 		goto dput_and_out;
 
-        vn_set_fs_pwd(current->fs, &path);
+	vn_set_fs_pwd(current->fs, &path);
 
 dput_and_out:
-        path_put(&path);
+	path_put(&path);
 out:
 	set_fs(saved_fs);
 
-        return (-rc);
+	return (-rc);
 } /* vn_set_pwd() */
 EXPORT_SYMBOL(vn_set_pwd);
 
@@ -870,11 +653,11 @@  vn_file_cache_constructor(void *buf, void *cdrarg, int kmflags)
 	file_t *fp = buf;
 
 	atomic_set(&fp->f_ref, 0);
-        mutex_init(&fp->f_lock, NULL, MUTEX_DEFAULT, NULL);
+	mutex_init(&fp->f_lock, NULL, MUTEX_DEFAULT, NULL);
 	INIT_LIST_HEAD(&fp->f_list);
 
-        return (0);
-} /* file_cache_constructor() */
+	return (0);
+} /* vn_file_cache_constructor() */
 
 static void
 vn_file_cache_destructor(void *buf, void *cdrarg)
@@ -888,29 +671,26 @@  int
 spl_vn_init(void)
 {
 	vn_cache = kmem_cache_create("spl_vn_cache",
-				     sizeof(struct vnode), 64,
-	                             vn_cache_constructor,
-				     vn_cache_destructor,
-				     NULL, NULL, NULL, 0);
+	    sizeof (struct vnode), 64, vn_cache_constructor,
+	    vn_cache_destructor, NULL, NULL, NULL, 0);
 
 	vn_file_cache = kmem_cache_create("spl_vn_file_cache",
-					  sizeof(file_t), 64,
-				          vn_file_cache_constructor,
-				          vn_file_cache_destructor,
-				          NULL, NULL, NULL, 0);
+	    sizeof (file_t), 64, vn_file_cache_constructor,
+	    vn_file_cache_destructor, NULL, NULL, NULL, 0);
+
 	return (0);
-} /* vn_init() */
+} /* spl_vn_init() */
 
 void
 spl_vn_fini(void)
 {
-        file_t *fp, *next_fp;
+	file_t *fp, *next_fp;
 	int leaked = 0;
 
 	spin_lock(&vn_file_lock);
 
-        list_for_each_entry_safe(fp, next_fp, &vn_file_list,  f_list) {
-	        list_del(&fp->f_list);
+	list_for_each_entry_safe(fp, next_fp, &vn_file_list,  f_list) {
+		list_del(&fp->f_list);
 		releasef_locked(fp);
 		leaked++;
 	}
@@ -922,6 +702,4 @@  spl_vn_fini(void)
 
 	kmem_cache_destroy(vn_file_cache);
 	kmem_cache_destroy(vn_cache);
-
-	return;
-} /* vn_fini() */
+} /* spl_vn_fini() */
diff --git a/spl/module/spl/spl-xdr.c b/spl/module/spl/spl-xdr.c
index 9405dc8..456887e 100644
--- a/spl/module/spl/spl-xdr.c
+++ b/spl/module/spl/spl-xdr.c
@@ -17,7 +17,7 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
  *  Solaris Porting Layer (SPL) XDR Implementation.
 \*****************************************************************************/
 
@@ -160,15 +160,15 @@  EXPORT_SYMBOL(xdrmem_create);
 static bool_t
 xdrmem_control(XDR *xdrs, int req, void *info)
 {
-	struct xdr_bytesrec *rec = (struct xdr_bytesrec *) info;
+	struct xdr_bytesrec *rec = (struct xdr_bytesrec *)info;
 
 	if (req != XDR_GET_BYTES_AVAIL)
-		return FALSE;
+		return (FALSE);
 
 	rec->xc_is_last_record = TRUE; /* always TRUE in xdrmem streams */
 	rec->xc_num_avail = xdrs->x_addr_end - xdrs->x_addr;
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -178,13 +178,13 @@  xdrmem_enc_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt)
 	uint_t pad;
 
 	if (size < cnt)
-		return FALSE; /* Integer overflow */
+		return (FALSE); /* Integer overflow */
 
 	if (xdrs->x_addr > xdrs->x_addr_end)
-		return FALSE;
+		return (FALSE);
 
 	if (xdrs->x_addr_end - xdrs->x_addr < size)
-		return FALSE;
+		return (FALSE);
 
 	memcpy(xdrs->x_addr, cp, cnt);
 
@@ -196,7 +196,7 @@  xdrmem_enc_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt)
 		xdrs->x_addr += pad;
 	}
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -207,13 +207,13 @@  xdrmem_dec_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt)
 	uint_t pad;
 
 	if (size < cnt)
-		return FALSE; /* Integer overflow */
+		return (FALSE); /* Integer overflow */
 
 	if (xdrs->x_addr > xdrs->x_addr_end)
-		return FALSE;
+		return (FALSE);
 
 	if (xdrs->x_addr_end - xdrs->x_addr < size)
-		return FALSE;
+		return (FALSE);
 
 	memcpy(cp, xdrs->x_addr, cnt);
 	xdrs->x_addr += cnt;
@@ -222,38 +222,38 @@  xdrmem_dec_bytes(XDR *xdrs, caddr_t cp, const uint_t cnt)
 	if (pad > 0) {
 		/* An inverted memchr() would be useful here... */
 		if (memcmp(&zero, xdrs->x_addr, pad) != 0)
-			return FALSE;
+			return (FALSE);
 
 		xdrs->x_addr += pad;
 	}
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
 xdrmem_enc_uint32(XDR *xdrs, uint32_t val)
 {
-	if (xdrs->x_addr + sizeof(uint32_t) > xdrs->x_addr_end)
-		return FALSE;
+	if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end)
+		return (FALSE);
 
-	*((uint32_t *) xdrs->x_addr) = cpu_to_be32(val);
+	*((uint32_t *)xdrs->x_addr) = cpu_to_be32(val);
 
-	xdrs->x_addr += sizeof(uint32_t);
+	xdrs->x_addr += sizeof (uint32_t);
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
 xdrmem_dec_uint32(XDR *xdrs, uint32_t *val)
 {
-	if (xdrs->x_addr + sizeof(uint32_t) > xdrs->x_addr_end)
-		return FALSE;
+	if (xdrs->x_addr + sizeof (uint32_t) > xdrs->x_addr_end)
+		return (FALSE);
 
-	*val = be32_to_cpu(*((uint32_t *) xdrs->x_addr));
+	*val = be32_to_cpu(*((uint32_t *)xdrs->x_addr));
 
-	xdrs->x_addr += sizeof(uint32_t);
+	xdrs->x_addr += sizeof (uint32_t);
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -261,10 +261,10 @@  xdrmem_enc_char(XDR *xdrs, char *cp)
 {
 	uint32_t val;
 
-	BUILD_BUG_ON(sizeof(char) != 1);
+	BUILD_BUG_ON(sizeof (char) != 1);
 	val = *((unsigned char *) cp);
 
-	return xdrmem_enc_uint32(xdrs, val);
+	return (xdrmem_enc_uint32(xdrs, val));
 }
 
 static bool_t
@@ -272,10 +272,10 @@  xdrmem_dec_char(XDR *xdrs, char *cp)
 {
 	uint32_t val;
 
-	BUILD_BUG_ON(sizeof(char) != 1);
+	BUILD_BUG_ON(sizeof (char) != 1);
 
 	if (!xdrmem_dec_uint32(xdrs, &val))
-		return FALSE;
+		return (FALSE);
 
 	/*
 	 * If any of the 3 other bytes are non-zero then val will be greater
@@ -283,19 +283,19 @@  xdrmem_dec_char(XDR *xdrs, char *cp)
 	 * not have a char encoded in it.
 	 */
 	if (val > 0xff)
-		return FALSE;
+		return (FALSE);
 
 	*((unsigned char *) cp) = val;
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
 xdrmem_enc_ushort(XDR *xdrs, unsigned short *usp)
 {
-	BUILD_BUG_ON(sizeof(unsigned short) != 2);
+	BUILD_BUG_ON(sizeof (unsigned short) != 2);
 
-	return xdrmem_enc_uint32(xdrs, *usp);
+	return (xdrmem_enc_uint32(xdrs, *usp));
 }
 
 static bool_t
@@ -303,48 +303,48 @@  xdrmem_dec_ushort(XDR *xdrs, unsigned short *usp)
 {
 	uint32_t val;
 
-	BUILD_BUG_ON(sizeof(unsigned short) != 2);
+	BUILD_BUG_ON(sizeof (unsigned short) != 2);
 
 	if (!xdrmem_dec_uint32(xdrs, &val))
-		return FALSE;
+		return (FALSE);
 
 	/*
 	 * Short ints are not in the RFC, but we assume similar logic as in
 	 * xdrmem_dec_char().
 	 */
 	if (val > 0xffff)
-		return FALSE;
+		return (FALSE);
 
 	*usp = val;
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
 xdrmem_enc_uint(XDR *xdrs, unsigned *up)
 {
-	BUILD_BUG_ON(sizeof(unsigned) != 4);
+	BUILD_BUG_ON(sizeof (unsigned) != 4);
 
-	return xdrmem_enc_uint32(xdrs, *up);
+	return (xdrmem_enc_uint32(xdrs, *up));
 }
 
 static bool_t
 xdrmem_dec_uint(XDR *xdrs, unsigned *up)
 {
-	BUILD_BUG_ON(sizeof(unsigned) != 4);
+	BUILD_BUG_ON(sizeof (unsigned) != 4);
 
-	return xdrmem_dec_uint32(xdrs, (uint32_t *) up);
+	return (xdrmem_dec_uint32(xdrs, (uint32_t *)up));
 }
 
 static bool_t
 xdrmem_enc_ulonglong(XDR *xdrs, u_longlong_t *ullp)
 {
-	BUILD_BUG_ON(sizeof(u_longlong_t) != 8);
+	BUILD_BUG_ON(sizeof (u_longlong_t) != 8);
 
 	if (!xdrmem_enc_uint32(xdrs, *ullp >> 32))
-		return FALSE;
+		return (FALSE);
 
-	return xdrmem_enc_uint32(xdrs, *ullp & 0xffffffff);
+	return (xdrmem_enc_uint32(xdrs, *ullp & 0xffffffff));
 }
 
 static bool_t
@@ -352,16 +352,16 @@  xdrmem_dec_ulonglong(XDR *xdrs, u_longlong_t *ullp)
 {
 	uint32_t low, high;
 
-	BUILD_BUG_ON(sizeof(u_longlong_t) != 8);
+	BUILD_BUG_ON(sizeof (u_longlong_t) != 8);
 
 	if (!xdrmem_dec_uint32(xdrs, &high))
-		return FALSE;
+		return (FALSE);
 	if (!xdrmem_dec_uint32(xdrs, &low))
-		return FALSE;
+		return (FALSE);
 
-	*ullp = ((u_longlong_t) high << 32) | low;
+	*ullp = ((u_longlong_t)high << 32) | low;
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -372,18 +372,18 @@  xdr_enc_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize,
 	caddr_t addr = *arrp;
 
 	if (*sizep > maxsize || *sizep > UINT_MAX / elsize)
-		return FALSE;
+		return (FALSE);
 
 	if (!xdrmem_enc_uint(xdrs, sizep))
-		return FALSE;
+		return (FALSE);
 
 	for (i = 0; i < *sizep; i++) {
 		if (!elproc(xdrs, addr))
-			return FALSE;
+			return (FALSE);
 		addr += elsize;
 	}
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -395,23 +395,23 @@  xdr_dec_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize,
 	caddr_t addr;
 
 	if (!xdrmem_dec_uint(xdrs, sizep))
-		return FALSE;
+		return (FALSE);
 
 	size = *sizep;
 
 	if (size > maxsize || size > UINT_MAX / elsize)
-		return FALSE;
+		return (FALSE);
 
 	/*
 	 * The Solaris man page says: "If *arrp is NULL when decoding,
 	 * xdr_array() allocates memory and *arrp points to it".
 	 */
 	if (*arrp == NULL) {
-		BUILD_BUG_ON(sizeof(uint_t) > sizeof(size_t));
+		BUILD_BUG_ON(sizeof (uint_t) > sizeof (size_t));
 
 		*arrp = kmem_alloc(size * elsize, KM_NOSLEEP);
 		if (*arrp == NULL)
-			return FALSE;
+			return (FALSE);
 
 		alloc = TRUE;
 	}
@@ -422,12 +422,12 @@  xdr_dec_array(XDR *xdrs, caddr_t *arrp, uint_t *sizep, const uint_t maxsize,
 		if (!elproc(xdrs, addr)) {
 			if (alloc)
 				kmem_free(*arrp, size * elsize);
-			return FALSE;
+			return (FALSE);
 		}
 		addr += elsize;
 	}
 
-	return TRUE;
+	return (TRUE);
 }
 
 static bool_t
@@ -437,14 +437,14 @@  xdr_enc_string(XDR *xdrs, char **sp, const uint_t maxsize)
 	uint_t len;
 
 	if (slen > maxsize)
-		return FALSE;
+		return (FALSE);
 
 	len = slen;
 
 	if (!xdrmem_enc_uint(xdrs, &len))
-		return FALSE;
+		return (FALSE);
 
-	return xdrmem_enc_bytes(xdrs, *sp, len);
+	return (xdrmem_enc_bytes(xdrs, *sp, len));
 }
 
 static bool_t
@@ -454,21 +454,21 @@  xdr_dec_string(XDR *xdrs, char **sp, const uint_t maxsize)
 	bool_t alloc = FALSE;
 
 	if (!xdrmem_dec_uint(xdrs, &size))
-		return FALSE;
+		return (FALSE);
 
 	if (size > maxsize || size > UINT_MAX - 1)
-		return FALSE;
+		return (FALSE);
 
 	/*
 	 * Solaris man page: "If *sp is NULL when decoding, xdr_string()
 	 * allocates memory and *sp points to it".
 	 */
 	if (*sp == NULL) {
-		BUILD_BUG_ON(sizeof(uint_t) > sizeof(size_t));
+		BUILD_BUG_ON(sizeof (uint_t) > sizeof (size_t));
 
 		*sp = kmem_alloc(size + 1, KM_NOSLEEP);
 		if (*sp == NULL)
-			return FALSE;
+			return (FALSE);
 
 		alloc = TRUE;
 	}
@@ -481,34 +481,33 @@  xdr_dec_string(XDR *xdrs, char **sp, const uint_t maxsize)
 
 	(*sp)[size] = '\0';
 
-	return TRUE;
+	return (TRUE);
 
 fail:
 	if (alloc)
 		kmem_free(*sp, size + 1);
 
-	return FALSE;
+	return (FALSE);
 }
 
 static struct xdr_ops xdrmem_encode_ops = {
-	.xdr_control      = xdrmem_control,
-	.xdr_char         = xdrmem_enc_char,
-	.xdr_u_short      = xdrmem_enc_ushort,
-	.xdr_u_int        = xdrmem_enc_uint,
-	.xdr_u_longlong_t = xdrmem_enc_ulonglong,
-	.xdr_opaque       = xdrmem_enc_bytes,
-	.xdr_string       = xdr_enc_string,
-	.xdr_array        = xdr_enc_array
+	.xdr_control		= xdrmem_control,
+	.xdr_char		= xdrmem_enc_char,
+	.xdr_u_short		= xdrmem_enc_ushort,
+	.xdr_u_int		= xdrmem_enc_uint,
+	.xdr_u_longlong_t	= xdrmem_enc_ulonglong,
+	.xdr_opaque		= xdrmem_enc_bytes,
+	.xdr_string		= xdr_enc_string,
+	.xdr_array		= xdr_enc_array
 };
 
 static struct xdr_ops xdrmem_decode_ops = {
-	.xdr_control      = xdrmem_control,
-	.xdr_char         = xdrmem_dec_char,
-	.xdr_u_short      = xdrmem_dec_ushort,
-	.xdr_u_int        = xdrmem_dec_uint,
-	.xdr_u_longlong_t = xdrmem_dec_ulonglong,
-	.xdr_opaque       = xdrmem_dec_bytes,
-	.xdr_string       = xdr_dec_string,
-	.xdr_array        = xdr_dec_array
+	.xdr_control		= xdrmem_control,
+	.xdr_char		= xdrmem_dec_char,
+	.xdr_u_short		= xdrmem_dec_ushort,
+	.xdr_u_int		= xdrmem_dec_uint,
+	.xdr_u_longlong_t	= xdrmem_dec_ulonglong,
+	.xdr_opaque		= xdrmem_dec_bytes,
+	.xdr_string		= xdr_dec_string,
+	.xdr_array		= xdr_dec_array
 };
-
diff --git a/spl/module/spl/spl-zlib.c b/spl/module/spl/spl-zlib.c
index 77c2a1d..37fedb1 100644
--- a/spl/module/spl/spl-zlib.c
+++ b/spl/module/spl/spl-zlib.c
@@ -20,7 +20,8 @@ 
  *
  *  You should have received a copy of the GNU General Public License along
  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
- *****************************************************************************
+ *
+ *
  *  z_compress_level/z_uncompress are nearly identical copies of the
  *  compress2/uncompress functions provided by the official zlib package
  *  available at http://zlib.net/.  The only changes made we to slightly
@@ -72,7 +73,7 @@  static spl_kmem_cache_t *zlib_workspace_cache;
 static void *
 zlib_workspace_alloc(int flags)
 {
-	return kmem_cache_alloc(zlib_workspace_cache, flags & ~(__GFP_FS));
+	return (kmem_cache_alloc(zlib_workspace_cache, flags & ~(__GFP_FS)));
 }
 
 static void
@@ -94,7 +95,7 @@  zlib_workspace_free(void *workspace)
  */
 int
 z_compress_level(void *dest, size_t *destLen, const void *source,
-                 size_t sourceLen, int level)
+    size_t sourceLen, int level)
 {
 	z_stream stream;
 	int err;
@@ -105,30 +106,30 @@  z_compress_level(void *dest, size_t *destLen, const void *source,
 	stream.avail_out = (uInt)*destLen;
 
 	if ((size_t)stream.avail_out != *destLen)
-		return Z_BUF_ERROR;
+		return (Z_BUF_ERROR);
 
 	stream.workspace = zlib_workspace_alloc(KM_SLEEP);
 	if (!stream.workspace)
-		return Z_MEM_ERROR;
+		return (Z_MEM_ERROR);
 
 	err = zlib_deflateInit(&stream, level);
 	if (err != Z_OK) {
 		zlib_workspace_free(stream.workspace);
-		return err;
+		return (err);
 	}
 
 	err = zlib_deflate(&stream, Z_FINISH);
 	if (err != Z_STREAM_END) {
 		zlib_deflateEnd(&stream);
 		zlib_workspace_free(stream.workspace);
-		return err == Z_OK ? Z_BUF_ERROR : err;
+		return (err == Z_OK ? Z_BUF_ERROR : err);
 	}
 	*destLen = stream.total_out;
 
 	err = zlib_deflateEnd(&stream);
 	zlib_workspace_free(stream.workspace);
 
-	return err;
+	return (err);
 }
 EXPORT_SYMBOL(z_compress_level);
 
@@ -159,16 +160,16 @@  z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen)
 	stream.avail_out = (uInt)*destLen;
 
 	if ((size_t)stream.avail_out != *destLen)
-		return Z_BUF_ERROR;
+		return (Z_BUF_ERROR);
 
 	stream.workspace = zlib_workspace_alloc(KM_SLEEP);
 	if (!stream.workspace)
-		return Z_MEM_ERROR;
+		return (Z_MEM_ERROR);
 
 	err = zlib_inflateInit(&stream);
 	if (err != Z_OK) {
 		zlib_workspace_free(stream.workspace);
-		return err;
+		return (err);
 	}
 
 	err = zlib_inflate(&stream, Z_FINISH);
@@ -177,17 +178,17 @@  z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen)
 		zlib_workspace_free(stream.workspace);
 
 		if (err == Z_NEED_DICT ||
-		   (err == Z_BUF_ERROR && stream.avail_in == 0))
-			return Z_DATA_ERROR;
+		    (err == Z_BUF_ERROR && stream.avail_in == 0))
+			return (Z_DATA_ERROR);
 
-		return err;
+		return (err);
 	}
 	*destLen = stream.total_out;
 
 	err = zlib_inflateEnd(&stream);
 	zlib_workspace_free(stream.workspace);
 
-	return err;
+	return (err);
 }
 EXPORT_SYMBOL(z_uncompress);
 
@@ -203,15 +204,15 @@  spl_zlib_init(void)
 	    "spl_zlib_workspace_cache",
 	    size, 0, NULL, NULL, NULL, NULL, NULL,
 	    KMC_VMEM | KMC_NOEMERGENCY);
-        if (!zlib_workspace_cache)
+	if (!zlib_workspace_cache)
 		return (1);
 
-        return (0);
+	return (0);
 }
 
 void
 spl_zlib_fini(void)
 {
 	kmem_cache_destroy(zlib_workspace_cache);
-        zlib_workspace_cache = NULL;
+	zlib_workspace_cache = NULL;
 }
diff --git a/spl/module/splat/splat-vnode.c b/spl/module/splat/splat-vnode.c
index ad69cf6..9160003 100644
--- a/spl/module/splat/splat-vnode.c
+++ b/spl/module/splat/splat-vnode.c
@@ -42,10 +42,6 @@ 
 #define SPLAT_VNODE_TEST3_NAME		"vn_rdwr"
 #define SPLAT_VNODE_TEST3_DESC		"Vn_rdwrt Test"
 
-#define SPLAT_VNODE_TEST4_ID		0x0904
-#define SPLAT_VNODE_TEST4_NAME		"vn_rename"
-#define SPLAT_VNODE_TEST4_DESC		"Vn_rename Test"
-
 #define SPLAT_VNODE_TEST5_ID		0x0905
 #define SPLAT_VNODE_TEST5_NAME		"vn_getattr"
 #define SPLAT_VNODE_TEST5_DESC		"Vn_getattr Test"
@@ -218,94 +214,10 @@  splat_vnode_test3(struct file *file, void *arg)
 
 out:
         VOP_CLOSE(vp, 0, 0, 0, 0, 0);
-	vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
 
         return -rc;
 } /* splat_vnode_test3() */
 
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
-static int
-splat_vnode_test4(struct file *file, void *arg)
-{
-	vnode_t *vp;
-	char buf1[32] = "SPL VNode Interface Test File\n";
-	char buf2[32] = "";
-	int rc;
-
-	if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST4_NAME)))
-		return rc;
-
-	if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE,
-			  FWRITE | FREAD | FCREAT | FEXCL, 0644, &vp, 0, 0))) {
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
-			     "Failed to vn_open test file: %s (%d)\n",
-			     SPLAT_VNODE_TEST_FILE_RW1, rc);
-		goto out;
-	}
-
-        rc = vn_rdwr(UIO_WRITE, vp, buf1, strlen(buf1), 0,
-                     UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
-	if (rc) {
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
-			     "Failed vn_rdwr write of test file: %s (%d)\n",
-			     SPLAT_VNODE_TEST_FILE_RW1, rc);
-		goto out2;
-	}
-
-        VOP_CLOSE(vp, 0, 0, 0, 0, 0);
-
-	rc = vn_rename(SPLAT_VNODE_TEST_FILE_RW1,SPLAT_VNODE_TEST_FILE_RW2,0);
-	if (rc) {
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Failed vn_rename "
-			     "%s -> %s (%d)\n",
-			     SPLAT_VNODE_TEST_FILE_RW1,
-			     SPLAT_VNODE_TEST_FILE_RW2, rc);
-		goto out;
-	}
-
-	if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE,
-			  FREAD | FEXCL, 0644, &vp, 0, 0))) {
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
-			     "Failed to vn_open test file: %s (%d)\n",
-			     SPLAT_VNODE_TEST_FILE_RW2, rc);
-		goto out;
-	}
-
-        rc = vn_rdwr(UIO_READ, vp, buf2, strlen(buf1), 0,
-                     UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
-	if (rc) {
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
-			     "Failed vn_rdwr read of test file: %s (%d)\n",
-			     SPLAT_VNODE_TEST_FILE_RW2, rc);
-		goto out2;
-	}
-
-	if (strncmp(buf1, buf2, strlen(buf1))) {
-		rc = EINVAL;
-		splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
-			     "Failed strncmp data written does not match "
-			     "data read\nWrote: %sRead:  %s\n", buf1, buf2);
-		goto out2;
-	}
-
-	rc = 0;
-	splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Wrote to %s:  %s",
-		     SPLAT_VNODE_TEST_FILE_RW1, buf1);
-	splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Read from %s: %s",
-		     SPLAT_VNODE_TEST_FILE_RW2, buf2);
-	splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Successfully renamed "
-		     "test file %s -> %s and verified data pattern\n",
-		     SPLAT_VNODE_TEST_FILE_RW1, SPLAT_VNODE_TEST_FILE_RW2);
-out2:
-        VOP_CLOSE(vp, 0, 0, 0, 0, 0);
-out:
-	vn_remove(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE, RMFILE);
-	vn_remove(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE, RMFILE);
-
-        return -rc;
-} /* splat_vnode_test4() */
-#endif
-
 static int
 splat_vnode_test5(struct file *file, void *arg)
 {
@@ -387,7 +299,6 @@  splat_vnode_test6(struct file *file, void *arg)
 		     "fsync'ed test file %s\n", SPLAT_VNODE_TEST_FILE_RW);
 out:
         VOP_CLOSE(vp, 0, 0, 0, 0, 0);
-	vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
 
         return -rc;
 } /* splat_vnode_test6() */
@@ -415,10 +326,6 @@  splat_vnode_init(void)
 	                SPLAT_VNODE_TEST2_ID, splat_vnode_test2);
         splat_test_init(sub, SPLAT_VNODE_TEST3_NAME, SPLAT_VNODE_TEST3_DESC,
 	                SPLAT_VNODE_TEST3_ID, splat_vnode_test3);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
-        splat_test_init(sub, SPLAT_VNODE_TEST4_NAME, SPLAT_VNODE_TEST4_DESC,
-	                SPLAT_VNODE_TEST4_ID, splat_vnode_test4);
-#endif
         splat_test_init(sub, SPLAT_VNODE_TEST5_NAME, SPLAT_VNODE_TEST5_DESC,
 	                SPLAT_VNODE_TEST5_ID, splat_vnode_test5);
         splat_test_init(sub, SPLAT_VNODE_TEST6_NAME, SPLAT_VNODE_TEST6_DESC,
@@ -434,9 +341,6 @@  splat_vnode_fini(splat_subsystem_t *sub)
 
         splat_test_fini(sub, SPLAT_VNODE_TEST6_ID);
         splat_test_fini(sub, SPLAT_VNODE_TEST5_ID);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
-        splat_test_fini(sub, SPLAT_VNODE_TEST4_ID);
-#endif
         splat_test_fini(sub, SPLAT_VNODE_TEST3_ID);
         splat_test_fini(sub, SPLAT_VNODE_TEST2_ID);
         splat_test_fini(sub, SPLAT_VNODE_TEST1_ID);
diff --git a/spl/rpm/Makefile.in b/spl/rpm/Makefile.in
index 036f216..d9f5194 100644
--- a/spl/rpm/Makefile.in
+++ b/spl/rpm/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = rpm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/rpm/generic/Makefile.in b/spl/rpm/generic/Makefile.in
index 9915e0d..7f15e2b 100644
--- a/spl/rpm/generic/Makefile.in
+++ b/spl/rpm/generic/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = rpm/generic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/rpm/generic/spl-dkms.spec.in b/spl/rpm/generic/spl-dkms.spec.in
index 4196240..a8691d2 100644
--- a/spl/rpm/generic/spl-dkms.spec.in
+++ b/spl/rpm/generic/spl-dkms.spec.in
@@ -7,6 +7,16 @@ 
 %define module  @PACKAGE@
 %define mkconf  scripts/dkms.mkconf
 
+# Python permits the !/usr/bin/python shebang for scripts that are cross
+# compatible between python2 and python3, but Fedora 28 does not.  Fedora
+# wants us to choose python3 for cross-compatible scripts.  Since we want
+# to support python2 and python3 users, exclude our scripts from Fedora 28's
+# RPM build check, so that we don't get a bunch of build warnings.
+#
+# Details: https://github.com/zfsonlinux/zfs/issues/7360
+#
+%global __brp_mangle_shebangs_exclude_from      splslab.py
+
 Name:           %{module}-dkms
 
 Version:        @VERSION@
diff --git a/spl/rpm/generic/spl-kmod.spec.in b/spl/rpm/generic/spl-kmod.spec.in
index af7132d..9cd2225 100644
--- a/spl/rpm/generic/spl-kmod.spec.in
+++ b/spl/rpm/generic/spl-kmod.spec.in
@@ -167,6 +167,18 @@  chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
+- Released 0.7.9-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
+* Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
+- Released 0.7.8-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
+* Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
+- Released 0.7.7-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
+* Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
+- Released 0.7.6-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
 * Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
 - Released 0.7.5-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
diff --git a/spl/rpm/generic/spl.spec.in b/spl/rpm/generic/spl.spec.in
index f619475..39c6411 100644
--- a/spl/rpm/generic/spl.spec.in
+++ b/spl/rpm/generic/spl.spec.in
@@ -1,3 +1,13 @@ 
+# Python permits the !/usr/bin/python shebang for scripts that are cross
+# compatible between python2 and python3, but Fedora 28 does not.  Fedora
+# wants us to choose python3 for cross-compatible scripts.  Since we want
+# to support python2 and python3 users, exclude our scripts from Fedora 28's
+# RPM build check, so that we don't get a bunch of build warnings.
+#
+# Details: https://github.com/zfsonlinux/zfs/issues/7360
+#
+%global __brp_mangle_shebangs_exclude_from	splslab.py
+
 Name:           @PACKAGE@
 Version:        @VERSION@
 Release:        @RELEASE@%{?dist}
@@ -34,6 +44,18 @@  make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
+- Released 0.7.9-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
+* Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
+- Released 0.7.8-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
+* Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
+- Released 0.7.7-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
+* Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
+- Released 0.7.6-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
 * Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
 - Released 0.7.5-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
diff --git a/spl/rpm/redhat/Makefile.in b/spl/rpm/redhat/Makefile.in
index d9cc5a0d..d491803 100644
--- a/spl/rpm/redhat/Makefile.in
+++ b/spl/rpm/redhat/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = rpm/redhat
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/rpm/redhat/spl-dkms.spec.in b/spl/rpm/redhat/spl-dkms.spec.in
index 4196240..a8691d2 100644
--- a/spl/rpm/redhat/spl-dkms.spec.in
+++ b/spl/rpm/redhat/spl-dkms.spec.in
@@ -7,6 +7,16 @@ 
 %define module  @PACKAGE@
 %define mkconf  scripts/dkms.mkconf
 
+# Python permits the !/usr/bin/python shebang for scripts that are cross
+# compatible between python2 and python3, but Fedora 28 does not.  Fedora
+# wants us to choose python3 for cross-compatible scripts.  Since we want
+# to support python2 and python3 users, exclude our scripts from Fedora 28's
+# RPM build check, so that we don't get a bunch of build warnings.
+#
+# Details: https://github.com/zfsonlinux/zfs/issues/7360
+#
+%global __brp_mangle_shebangs_exclude_from      splslab.py
+
 Name:           %{module}-dkms
 
 Version:        @VERSION@
diff --git a/spl/rpm/redhat/spl.spec.in b/spl/rpm/redhat/spl.spec.in
index f619475..39c6411 100644
--- a/spl/rpm/redhat/spl.spec.in
+++ b/spl/rpm/redhat/spl.spec.in
@@ -1,3 +1,13 @@ 
+# Python permits the !/usr/bin/python shebang for scripts that are cross
+# compatible between python2 and python3, but Fedora 28 does not.  Fedora
+# wants us to choose python3 for cross-compatible scripts.  Since we want
+# to support python2 and python3 users, exclude our scripts from Fedora 28's
+# RPM build check, so that we don't get a bunch of build warnings.
+#
+# Details: https://github.com/zfsonlinux/zfs/issues/7360
+#
+%global __brp_mangle_shebangs_exclude_from	splslab.py
+
 Name:           @PACKAGE@
 Version:        @VERSION@
 Release:        @RELEASE@%{?dist}
@@ -34,6 +44,18 @@  make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
+- Released 0.7.9-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
+* Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
+- Released 0.7.8-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
+* Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
+- Released 0.7.7-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
+* Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
+- Released 0.7.6-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
 * Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
 - Released 0.7.5-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
diff --git a/spl/scripts/Makefile.in b/spl/scripts/Makefile.in
index ba33984..4cfd2b1 100644
--- a/spl/scripts/Makefile.in
+++ b/spl/scripts/Makefile.in
@@ -90,7 +90,28 @@  host_triplet = @host@
 target_triplet = @target@
 subdir = scripts
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/config/kernel-ctl-table-name.m4 \
+	$(top_srcdir)/config/kernel-fallocate.m4 \
+	$(top_srcdir)/config/kernel-group-info.m4 \
+	$(top_srcdir)/config/kernel-inode-lock.m4 \
+	$(top_srcdir)/config/kernel-kmem-cache.m4 \
+	$(top_srcdir)/config/kernel-kuidgid.m4 \
+	$(top_srcdir)/config/kernel-pde-data.m4 \
+	$(top_srcdir)/config/kernel-rw.m4 \
+	$(top_srcdir)/config/kernel-rwsem.m4 \
+	$(top_srcdir)/config/kernel-sched.m4 \
+	$(top_srcdir)/config/kernel-set-fs-pwd.m4 \
+	$(top_srcdir)/config/kernel-shrinker.m4 \
+	$(top_srcdir)/config/kernel-spinlock.m4 \
+	$(top_srcdir)/config/kernel-timer.m4 \
+	$(top_srcdir)/config/kernel-trim-unused-symbols.m4 \
+	$(top_srcdir)/config/kernel-truncate-range.m4 \
+	$(top_srcdir)/config/kernel-urange-sleep.m4 \
+	$(top_srcdir)/config/kernel-vfs-fsync.m4 \
+	$(top_srcdir)/config/kernel-vfs-getattr.m4 \
+	$(top_srcdir)/config/kernel-wait.m4 \
+	$(top_srcdir)/config/kernel-zlib.m4 \
+	$(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
diff --git a/spl/spl_config.h.in b/spl/spl_config.h.in
index 7d2a4d9..427f0de 100644
--- a/spl/spl_config.h.in
+++ b/spl/spl_config.h.in
@@ -21,9 +21,6 @@ 
 /* vfs_getattr wants 2 args */
 #undef HAVE_2ARGS_VFS_GETATTR
 
-/* vfs_unlink() wants 2 args */
-#undef HAVE_2ARGS_VFS_UNLINK
-
 /* zlib_deflate_workspacesize() wants 2 args */
 #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
 
@@ -33,21 +30,9 @@ 
 /* vfs_getattr wants 3 args */
 #undef HAVE_3ARGS_VFS_GETATTR
 
-/* vfs_unlink() wants 3 args */
-#undef HAVE_3ARGS_VFS_UNLINK
-
 /* vfs_getattr wants 4 args */
 #undef HAVE_4ARGS_VFS_GETATTR
 
-/* vfs_rename() wants 4 args */
-#undef HAVE_4ARGS_VFS_RENAME
-
-/* vfs_rename() wants 5 args */
-#undef HAVE_5ARGS_VFS_RENAME
-
-/* vfs_rename() wants 6 args */
-#undef HAVE_6ARGS_VFS_RENAME
-
 /* kernel defines atomic64_t */
 #undef HAVE_ATOMIC64_T
 
@@ -78,11 +63,14 @@ 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* yes */
+#undef HAVE_IO_SCHEDULE_TIMEOUT
+
 /* kernel_read() take loff_t pointer */
 #undef HAVE_KERNEL_READ_PPOS
 
-/* use timer_setup() for timer initialization */
-#undef HAVE_KERNEL_TIMER_SETUP
+/* timer_list.function gets a timer_list */
+#undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
 
 /* kernel_write() take loff_t pointer */
 #undef HAVE_KERNEL_WRITE_PPOS
diff --git a/zfs/META b/zfs/META
index 3b3713d..4bd2905 100644
--- a/zfs/META
+++ b/zfs/META
@@ -1,8 +1,8 @@ 
 Meta:         1
 Name:         zfs
 Branch:       1.0
-Version:      0.7.5
-Release:      1ubuntu17
+Version:      0.7.9
+Release:      3ubuntu1
 Release-Tags: relext
 License:      CDDL
 Author:       OpenZFS on Linux
diff --git a/zfs/Makefile.am b/zfs/Makefile.am
index 86d920e..df8254c 100644
--- a/zfs/Makefile.am
+++ b/zfs/Makefile.am
@@ -23,16 +23,18 @@  EXTRA_DIST  = autogen.sh copy-builtin
 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
 EXTRA_DIST += META DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
 
+@CODE_COVERAGE_RULES@
+
 distclean-local::
 	-$(RM) -R autom4te*.cache
 	-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
 		-o -name .pc -o -name .hg -o -name .git \) -prune -o \
 		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-		-o -name '.*.rej' -o -name '.script-config' -o -size 0 \
-		-o -name '*%' -o -name '.*.cmd' -o -name 'core' \
-		-o -name 'Makefile' -o -name 'Module.symvers' \
-		-o -name '*.order' -o -name '*.markers' \) \
+		-o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
+		-o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
+		-o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
+		-o -name '*.gcno' \) \
 		-type f -print | xargs $(RM)
 
 dist-hook:
@@ -65,10 +67,10 @@  lint: cppcheck paxcheck
 
 cppcheck:
 	@if type cppcheck > /dev/null 2>&1; then \
-		cppcheck --quiet --force --error-exitcode=2 \
+		cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
 			--suppressions-list=.github/suppressions.txt \
-			-UHAVE_SSE2 -UHAVE_AVX512F \
-			${top_srcdir}; \
+			-UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
+			-UHAVE_DNLC ${top_srcdir}; \
 	fi
 
 paxcheck:
diff --git a/zfs/Makefile.in b/zfs/Makefile.in
index db7e606..35ce941 100644
--- a/zfs/Makefile.in
+++ b/zfs/Makefile.in
@@ -102,6 +102,7 @@  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
 	$(top_srcdir)/config/always-no-bool-compare.m4 \
 	$(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+	$(top_srcdir)/config/ax_code_coverage.m4 \
 	$(top_srcdir)/config/dkms.m4 \
 	$(top_srcdir)/config/kernel-acl-refcount.m4 \
 	$(top_srcdir)/config/kernel-acl.m4 \
@@ -156,6 +157,7 @@  am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
 	$(top_srcdir)/config/kernel-get-disk-ro.m4 \
 	$(top_srcdir)/config/kernel-get-gendisk.m4 \
 	$(top_srcdir)/config/kernel-get-link.m4 \
+	$(top_srcdir)/config/kernel-global_page_state.m4 \
 	$(top_srcdir)/config/kernel-inode-getattr.m4 \
 	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
 	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
@@ -188,7 +190,6 @@  am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
 	$(top_srcdir)/config/kernel-userns-capabilities.m4 \
 	$(top_srcdir)/config/kernel-vfs-iterate.m4 \
 	$(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
-	$(top_srcdir)/config/kernel-vm_node_stat.m4 \
 	$(top_srcdir)/config/kernel-xattr-handler.m4 \
 	$(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
@@ -200,7 +201,6 @@  am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
 	$(top_srcdir)/config/user-dracut.m4 \
 	$(top_srcdir)/config/user-frame-larger-than.m4 \
 	$(top_srcdir)/config/user-libaio.m4 \
-	$(top_srcdir)/config/user-libattr.m4 \
 	$(top_srcdir)/config/user-libblkid.m4 \
 	$(top_srcdir)/config/user-libtirpc.m4 \
 	$(top_srcdir)/config/user-libudev.m4 \
@@ -389,6 +389,12 @@  CCASDEPMODE = @CCASDEPMODE@
 CCASFLAGS = @CCASFLAGS@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
+CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
+CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
+CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
+CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
+CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -400,6 +406,7 @@  DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
 DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
 DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
 DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFINE_SYSTEMD = @DEFINE_SYSTEMD@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
@@ -416,6 +423,8 @@  EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
 GREP = @GREP@
 HAVE_ALIEN = @HAVE_ALIEN@
 HAVE_DPKG = @HAVE_DPKG@
@@ -429,10 +438,10 @@  INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 KERNELCPPFLAGS = @KERNELCPPFLAGS@
 KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LCOV = @LCOV@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBAIO = @LIBAIO@
-LIBATTR = @LIBATTR@
 LIBBLKID = @LIBBLKID@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
@@ -453,6 +462,7 @@  MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+MULTIARCH_LIBDIR = @MULTIARCH_LIBDIR@
 NM = @NM@
 NMEDIT = @NMEDIT@
 NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
@@ -1223,38 +1233,41 @@  deb-local:
 	@(if test "${HAVE_DPKGBUILD}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${DPKGBUILD} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${DPKGBUILD},\n" \
+	"*** package for your distribution which provides ${DPKGBUILD},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi; \
 	if test "${HAVE_ALIEN}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+	"*** package for your distribution which provides ${ALIEN},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi)
 
 deb-kmod: deb-local rpm-kmod
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-dkms: deb-local rpm-dkms
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-utils: deb-local rpm-utils
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-$${version}.$${arch}.rpm; \
 	pkg2=libnvpair1-$${version}.$${arch}.rpm; \
 	pkg3=libuutil1-$${version}.$${arch}.rpm; \
@@ -1271,7 +1284,7 @@  deb-utils: deb-local rpm-utils
 	 >> $${path_prepend}/dh_shlibdeps; \
 	chmod +x $${path_prepend}/dh_shlibdeps; \
 	env PATH=$${path_prepend}:$${PATH} \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
 	    $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
 	    $$pkg8 $$pkg9; \
 	$(RM) $${path_prepend}/dh_shlibdeps; \
@@ -1284,9 +1297,9 @@  tgz-local:
 	@(if test "${HAVE_ALIEN}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+	"*** package for your distribution which provides ${ALIEN},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi)
 
 tgz-kmod: tgz-local rpm-kmod
@@ -1309,16 +1322,18 @@  tgz-utils: tgz-local rpm-utils
 
 tgz: tgz-kmod tgz-utils
 
+@CODE_COVERAGE_RULES@
+
 distclean-local::
 	-$(RM) -R autom4te*.cache
 	-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
 		-o -name .pc -o -name .hg -o -name .git \) -prune -o \
 		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-		-o -name '.*.rej' -o -name '.script-config' -o -size 0 \
-		-o -name '*%' -o -name '.*.cmd' -o -name 'core' \
-		-o -name 'Makefile' -o -name 'Module.symvers' \
-		-o -name '*.order' -o -name '*.markers' \) \
+		-o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
+		-o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
+		-o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
+		-o -name '*.gcno' \) \
 		-type f -print | xargs $(RM)
 
 dist-hook:
@@ -1351,10 +1366,10 @@  lint: cppcheck paxcheck
 
 cppcheck:
 	@if type cppcheck > /dev/null 2>&1; then \
-		cppcheck --quiet --force --error-exitcode=2 \
+		cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
 			--suppressions-list=.github/suppressions.txt \
-			-UHAVE_SSE2 -UHAVE_AVX512F \
-			${top_srcdir}; \
+			-UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
+			-UHAVE_DNLC ${top_srcdir}; \
 	fi
 
 paxcheck:
diff --git a/zfs/README.markdown b/zfs/README.markdown
index fd2ca8c..1c305b3 100644
--- a/zfs/README.markdown
+++ b/zfs/README.markdown
@@ -1,9 +1,9 @@ 
-<p align="center"><img src="http://zfsonlinux.org/images/zfs-linux.png"/></p>
-ZFS is an advanced file system and volume manager which was originally
-developed for Solaris and is now maintained by the Illumos community.
+![img](http://zfsonlinux.org/images/zfs-linux.png)
 
-ZFS on Linux, which is also known as ZoL, is currently feature complete.  It
-includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers. And it's native!
+ZFS on Linux is an advanced file system and volume manager which was originally
+developed for Solaris and is now maintained by the OpenZFS community.
+
+[![codecov](https://codecov.io/gh/zfsonlinux/zfs/branch/master/graph/badge.svg)](https://codecov.io/gh/zfsonlinux/zfs)
 
 # Official Resources
   * [Site](http://zfsonlinux.org)
@@ -16,4 +16,4 @@  Full documentation for installing ZoL on your favorite Linux distribution can
 be found at [our site](http://zfsonlinux.org/).
 
 # Contribute & Develop
-We have a separate document with [contribution guidelines](./.github/CONTRIBUTING.md).
\ No newline at end of file
+We have a separate document with [contribution guidelines](./.github/CONTRIBUTING.md).
diff --git a/zfs/aclocal.m4 b/zfs/aclocal.m4
index 2c3aa98..ebaf028 100644
--- a/zfs/aclocal.m4
+++ b/zfs/aclocal.m4
@@ -1209,6 +1209,7 @@  AC_SUBST([am__untar])
 m4_include([config/always-arch.m4])
 m4_include([config/always-no-bool-compare.m4])
 m4_include([config/always-no-unused-but-set-variable.m4])
+m4_include([config/ax_code_coverage.m4])
 m4_include([config/dkms.m4])
 m4_include([config/kernel-acl-refcount.m4])
 m4_include([config/kernel-acl.m4])
@@ -1263,6 +1264,7 @@  m4_include([config/kernel-get-disk-and-module.m4])
 m4_include([config/kernel-get-disk-ro.m4])
 m4_include([config/kernel-get-gendisk.m4])
 m4_include([config/kernel-get-link.m4])
+m4_include([config/kernel-global_page_state.m4])
 m4_include([config/kernel-inode-getattr.m4])
 m4_include([config/kernel-inode-set-flags.m4])
 m4_include([config/kernel-inode-set-iversion.m4])
@@ -1295,7 +1297,6 @@  m4_include([config/kernel-truncate-setsize.m4])
 m4_include([config/kernel-userns-capabilities.m4])
 m4_include([config/kernel-vfs-iterate.m4])
 m4_include([config/kernel-vfs-rw-iterate.m4])
-m4_include([config/kernel-vm_node_stat.m4])
 m4_include([config/kernel-xattr-handler.m4])
 m4_include([config/kernel.m4])
 m4_include([config/libtool.m4])
@@ -1308,7 +1309,6 @@  m4_include([config/toolchain-simd.m4])
 m4_include([config/user-dracut.m4])
 m4_include([config/user-frame-larger-than.m4])
 m4_include([config/user-libaio.m4])
-m4_include([config/user-libattr.m4])
 m4_include([config/user-libblkid.m4])
 m4_include([config/user-libtirpc.m4])
 m4_include([config/user-libudev.m4])
diff --git a/zfs/config/Rules.am b/zfs/config/Rules.am
index 1d39e77..215f09c 100644
--- a/zfs/config/Rules.am
+++ b/zfs/config/Rules.am
@@ -6,6 +6,7 @@  AM_CFLAGS += ${NO_UNUSED_BUT_SET_VARIABLE}
 AM_CFLAGS += ${NO_BOOL_COMPARE}
 AM_CFLAGS += -fno-strict-aliasing
 AM_CFLAGS += -std=gnu99
+AM_CFLAGS += $(CODE_COVERAGE_CFLAGS)
 AM_CPPFLAGS  = -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT
 AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
 AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DHAVE_LARGE_STACKS=1
@@ -14,3 +15,4 @@  AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\"
 AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\"
 AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\"
 AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\"
+AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
diff --git a/zfs/config/ax_code_coverage.m4 b/zfs/config/ax_code_coverage.m4
new file mode 100644
index 0000000..4417d44
--- /dev/null
+++ b/zfs/config/ax_code_coverage.m4
@@ -0,0 +1,264 @@ 
+# ===========================================================================
+#     https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CODE_COVERAGE()
+#
+# DESCRIPTION
+#
+#   Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
+#   CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
+#   in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
+#   build target (program or library) which should be built with code
+#   coverage support. Also defines CODE_COVERAGE_RULES which should be
+#   substituted in your Makefile; and $enable_code_coverage which can be
+#   used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
+#   and substituted, and corresponds to the value of the
+#   --enable-code-coverage option, which defaults to being disabled.
+#
+#   Test also for gcov program and create GCOV variable that could be
+#   substituted.
+#
+#   Note that all optimization flags in CFLAGS must be disabled when code
+#   coverage is enabled.
+#
+#   Usage example:
+#
+#   configure.ac:
+#
+#     AX_CODE_COVERAGE
+#
+#   Makefile.am:
+#
+#     @CODE_COVERAGE_RULES@
+#     my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
+#     my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
+#     my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
+#     my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
+#
+#   This results in a "check-code-coverage" rule being added to any
+#   Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
+#   has been configured with --enable-code-coverage). Running `make
+#   check-code-coverage` in that directory will run the module's test suite
+#   (`make check`) and build a code coverage report detailing the code which
+#   was touched, then print the URI for the report.
+#
+#   In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
+#   instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
+#   CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
+#   deprecated. They have the same value.
+#
+#   This code was derived from Makefile.decl in GLib, originally licenced
+#   under LGPLv2.1+.
+#
+# LICENSE
+#
+#   Copyright (c) 2012, 2016 Philip Withnall
+#   Copyright (c) 2012 Xan Lopez
+#   Copyright (c) 2012 Christian Persch
+#   Copyright (c) 2012 Paolo Borelli
+#   Copyright (c) 2012 Dan Winship
+#   Copyright (c) 2015 Bastien ROUCARIES
+#
+#   This library is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU Lesser General Public License as published by
+#   the Free Software Foundation; either version 2.1 of the License, or (at
+#   your option) any later version.
+#
+#   This library is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+#   General Public License for more details.
+#
+#   You should have received a copy of the GNU Lesser General Public License
+#   along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+#serial 25
+
+AC_DEFUN([AX_CODE_COVERAGE],[
+	dnl Check for --enable-code-coverage
+	AC_REQUIRE([AC_PROG_SED])
+
+	# allow to override gcov location
+	AC_ARG_WITH([gcov],
+	  [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
+	  [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
+	  [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
+
+	AC_MSG_CHECKING([whether to build with code coverage support])
+	AC_ARG_ENABLE([code-coverage],
+	  AS_HELP_STRING([--enable-code-coverage],
+	  [Whether to enable code coverage support]),,
+	  enable_code_coverage=no)
+
+	AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
+	AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
+	AC_MSG_RESULT($enable_code_coverage)
+
+	AS_IF([ test "$enable_code_coverage" = "yes" ], [
+		# check for gcov
+		AC_CHECK_TOOL([GCOV],
+		  [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
+		  [:])
+		AS_IF([test "X$GCOV" = "X:"],
+		  [AC_MSG_ERROR([gcov is needed to do coverage])])
+		AC_SUBST([GCOV])
+
+		dnl Check if gcc is being used
+		AS_IF([ test "$GCC" = "no" ], [
+			AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
+		])
+
+		AC_CHECK_PROG([LCOV], [lcov], [lcov])
+		AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
+
+		AS_IF([ test -z "$LCOV" ], [
+			AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
+		])
+
+		AS_IF([ test -z "$GENHTML" ], [
+			AC_MSG_ERROR([Could not find genhtml from the lcov package])
+		])
+
+		dnl Build the code coverage flags
+		dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
+		CODE_COVERAGE_CPPFLAGS=""
+		CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+		CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+		CODE_COVERAGE_LIBS="-lgcov"
+		CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
+
+		AC_SUBST([CODE_COVERAGE_CPPFLAGS])
+		AC_SUBST([CODE_COVERAGE_CFLAGS])
+		AC_SUBST([CODE_COVERAGE_CXXFLAGS])
+		AC_SUBST([CODE_COVERAGE_LIBS])
+		AC_SUBST([CODE_COVERAGE_LDFLAGS])
+
+		[CODE_COVERAGE_RULES_CHECK='
+	-$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
+	$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+']
+		[CODE_COVERAGE_RULES_CAPTURE='
+	$(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
+	$(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
+	-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+	$(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
+	@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+']
+		[CODE_COVERAGE_RULES_CLEAN='
+clean: code-coverage-clean
+distclean: code-coverage-clean
+code-coverage-clean:
+	-$(LCOV) --directory $(top_builddir) -z
+	-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+	-find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
+']
+	], [
+		[CODE_COVERAGE_RULES_CHECK='
+	@echo "Need to reconfigure with --enable-code-coverage"
+']
+		CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
+		CODE_COVERAGE_RULES_CLEAN=''
+	])
+
+[CODE_COVERAGE_RULES='
+# Code coverage
+#
+# Optional:
+#  - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
+#    Multiple directories may be specified, separated by whitespace.
+#    (Default: $(top_builddir))
+#  - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
+#    by lcov for code coverage. (Default:
+#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
+#  - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
+#    reports to be created. (Default:
+#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
+#  - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
+#    set to 0 to disable it and leave empty to stay with the default.
+#    (Default: empty)
+#  - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
+#    instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
+#  - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
+#    instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
+#  - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
+#  - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
+#    collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
+#  - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
+#    instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
+#  - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
+#    lcov instance. (Default: empty)
+#  - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
+#    instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
+#  - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
+#    genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
+#  - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
+#    instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
+#  - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
+#
+# The generated report will be titled using the $(PACKAGE_NAME) and
+# $(PACKAGE_VERSION). In order to add the current git hash to the title,
+# use the git-version-gen script, available online.
+
+# Optional variables
+CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
+CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
+CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
+CODE_COVERAGE_BRANCH_COVERAGE ?=
+CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
+--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
+CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
+CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
+CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
+CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
+CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
+CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
+CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
+$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
+--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
+CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
+CODE_COVERAGE_IGNORE_PATTERN ?=
+
+GITIGNOREFILES ?=
+GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+
+code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
+code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
+code_coverage_v_lcov_cap_0 = @echo "  LCOV   --capture"\
+ $(CODE_COVERAGE_OUTPUT_FILE);
+code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
+code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
+code_coverage_v_lcov_ign_0 = @echo "  LCOV   --remove /tmp/*"\
+ $(CODE_COVERAGE_IGNORE_PATTERN);
+code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
+code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
+code_coverage_v_genhtml_0 = @echo "  GEN   " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
+code_coverage_quiet = $(code_coverage_quiet_$(V))
+code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
+code_coverage_quiet_0 = --quiet
+
+# sanitizes the test-name: replaces with underscores: dashes and dots
+code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
+
+# Use recursive makes in order to ignore errors during check
+check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
+
+# Capture code coverage data
+code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
+
+# Hook rule executed before code-coverage-capture, overridable by the user
+code-coverage-capture-hook:
+
+'"$CODE_COVERAGE_RULES_CLEAN"'
+
+A''M_DISTCHECK_CONFIGURE_FLAGS ?=
+A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
+
+.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
+']
+
+	AC_SUBST([CODE_COVERAGE_RULES])
+	m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
+])
diff --git a/zfs/config/deb.am b/zfs/config/deb.am
index 98e98e4..58ab96e 100644
--- a/zfs/config/deb.am
+++ b/zfs/config/deb.am
@@ -2,24 +2,25 @@  deb-local:
 	@(if test "${HAVE_DPKGBUILD}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${DPKGBUILD} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${DPKGBUILD},\n" \
+	"*** package for your distribution which provides ${DPKGBUILD},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi; \
 	if test "${HAVE_ALIEN}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+	"*** package for your distribution which provides ${ALIEN},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi)
 
 deb-kmod: deb-local rpm-kmod
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 
@@ -27,14 +28,16 @@  deb-dkms: deb-local rpm-dkms
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1; \
 	$(RM) $$pkg1
 
 deb-utils: deb-local rpm-utils
 	name=${PACKAGE}; \
 	version=${VERSION}-${RELEASE}; \
 	arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+	debarch=`$(DPKG) --print-architecture`; \
 	pkg1=$${name}-$${version}.$${arch}.rpm; \
 	pkg2=libnvpair1-$${version}.$${arch}.rpm; \
 	pkg3=libuutil1-$${version}.$${arch}.rpm; \
@@ -57,7 +60,7 @@  deb-utils: deb-local rpm-utils
 ## which should NOT be mixed with the alien-generated debs created here
 	chmod +x $${path_prepend}/dh_shlibdeps; \
 	env PATH=$${path_prepend}:$${PATH} \
-	fakeroot $(ALIEN) --bump=0 --scripts --to-deb \
+	fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
 	    $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
 	    $$pkg8 $$pkg9; \
 	$(RM) $${path_prepend}/dh_shlibdeps; \
diff --git a/zfs/config/kernel-acl.m4 b/zfs/config/kernel-acl.m4
index 3114843..02cc020 100644
--- a/zfs/config/kernel-acl.m4
+++ b/zfs/config/kernel-acl.m4
@@ -184,6 +184,7 @@  AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
 	AC_MSG_CHECKING([whether iops->permission() wants nameidata])
 	ZFS_LINUX_TRY_COMPILE([
 		#include <linux/fs.h>
+		#include <linux/sched.h>
 
 		int permission_fn(struct inode *inode, int mask,
 		    struct nameidata *nd) { return 0; }
diff --git a/zfs/config/kernel-create-nameidata.m4 b/zfs/config/kernel-create-nameidata.m4
index a71490a..d4c155c 100644
--- a/zfs/config/kernel-create-nameidata.m4
+++ b/zfs/config/kernel-create-nameidata.m4
@@ -5,6 +5,7 @@  AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
 	AC_MSG_CHECKING([whether iops->create() passes nameidata])
 	ZFS_LINUX_TRY_COMPILE([
 		#include <linux/fs.h>
+		#include <linux/sched.h>
 
 		#ifdef HAVE_MKDIR_UMODE_T
 		int inode_create(struct inode *inode ,struct dentry *dentry,
diff --git a/zfs/config/kernel-dentry-operations.m4 b/zfs/config/kernel-dentry-operations.m4
index 3182490..61f5a27 100644
--- a/zfs/config/kernel-dentry-operations.m4
+++ b/zfs/config/kernel-dentry-operations.m4
@@ -5,6 +5,7 @@  AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
 	AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
 	ZFS_LINUX_TRY_COMPILE([
 		#include <linux/dcache.h>
+		#include <linux/sched.h>
 
 		int revalidate (struct dentry *dentry,
 		    struct nameidata *nidata) { return 0; }
diff --git a/zfs/config/kernel-get-link.m4 b/zfs/config/kernel-get-link.m4
index 022c49c..3cda08c 100644
--- a/zfs/config/kernel-get-link.m4
+++ b/zfs/config/kernel-get-link.m4
@@ -41,7 +41,7 @@  AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
 			AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
 			          [iops->follow_link() nameidata])
 		],[
-                        AC_MSG_ERROR(no; please file a bug report)
+			AC_MSG_ERROR(no; please file a bug report)
 		])
 	])
 ])
diff --git a/zfs/config/kernel-global_page_state.m4 b/zfs/config/kernel-global_page_state.m4
new file mode 100644
index 0000000..f4a4001
--- /dev/null
+++ b/zfs/config/kernel-global_page_state.m4
@@ -0,0 +1,109 @@ 
+dnl #
+dnl # 4.8 API change
+dnl #
+dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
+dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
+	AC_MSG_CHECKING([whether global_node_page_state() exists])
+	ZFS_LINUX_TRY_COMPILE([
+		#include <linux/mm.h>
+		#include <linux/vmstat.h>
+	],[
+		(void) global_node_page_state(0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1, [global_node_page_state() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # 4.14 API change
+dnl #
+dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
+	AC_MSG_CHECKING([whether global_zone_page_state() exists])
+	ZFS_LINUX_TRY_COMPILE([
+		#include <linux/mm.h>
+		#include <linux/vmstat.h>
+	],[
+		(void) global_zone_page_state(0);
+	],[
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1, [global_zone_page_state() exists])
+	],[
+		AC_MSG_RESULT(no)
+	])
+])
+
+dnl #
+dnl # Create a define and autoconf variable for an enum member
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
+	AC_MSG_CHECKING([whether enum $2 contains $1])
+	AS_IF([AC_TRY_COMMAND("${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
+		AC_MSG_RESULT([yes])
+		AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1, [enum $2 contains $1])
+		m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
+	],[
+		AC_MSG_RESULT([no])
+	])
+])
+
+dnl #
+dnl # Sanity check helpers
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
+	AC_MSG_RESULT(no)
+	AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
+	AC_MSG_RESULT([configure needs updating, see: config/kernel-global_page_state.m4])
+	AC_MSG_FAILURE([SHUT 'ER DOWN CLANCY, SHE'S PUMPIN' MUD!])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
+	enum_check_a="m4_join([_], [$ZFS_ENUM_NODE_STAT_ITEM], $1)"
+	enum_check_b="m4_join([_], [$ZFS_ENUM_ZONE_STAT_ITEM], $1)"
+	AS_IF([test -n "$enum_check_a" -a -n "$enum_check_b"],[
+		ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [DUPLICATE])
+	])
+	AS_IF([test -z "$enum_check_a" -a -z "$enum_check_b"],[
+		ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [NOT FOUND])
+	])
+])
+
+dnl #
+dnl # Ensure the config tests are finding one and only one of each enum of interest
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
+	AC_MSG_CHECKING([global_page_state enums are sane])
+
+	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
+	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
+	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
+	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_SLAB_RECLAIMABLE])
+
+	AC_MSG_RESULT(yes)
+])
+
+dnl #
+dnl # enum members in which we're interested
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
+	ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
+	ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
+
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],		[node_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],		[node_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],		[node_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],	[node_stat_item], [$LINUX/include/linux/mmzone.h])
+
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],		[zone_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],		[zone_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],		[zone_stat_item], [$LINUX/include/linux/mmzone.h])
+	ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],	[zone_stat_item], [$LINUX/include/linux/mmzone.h])
+
+	ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
+])
diff --git a/zfs/config/kernel-lookup-nameidata.m4 b/zfs/config/kernel-lookup-nameidata.m4
index 43f5fb4..5453be5 100644
--- a/zfs/config/kernel-lookup-nameidata.m4
+++ b/zfs/config/kernel-lookup-nameidata.m4
@@ -5,6 +5,7 @@  AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
 	AC_MSG_CHECKING([whether iops->lookup() passes nameidata])
 	ZFS_LINUX_TRY_COMPILE([
 		#include <linux/fs.h>
+		#include <linux/sched.h>
 
 		struct dentry *inode_lookup(struct inode *inode,
 		    struct dentry *dentry, struct nameidata *nidata)
diff --git a/zfs/config/kernel-vfs-iterate.m4 b/zfs/config/kernel-vfs-iterate.m4
index 7b1599e..5de901d 100644
--- a/zfs/config/kernel-vfs-iterate.m4
+++ b/zfs/config/kernel-vfs-iterate.m4
@@ -23,16 +23,27 @@  AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
 		dnl #
 		dnl # 3.11 API change
 		dnl #
+		dnl # RHEL 7.5 compatibility; the fops.iterate() method was
+		dnl # added to the file_operations structure but in order to
+		dnl # maintain KABI compatibility all callers must set
+		dnl # FMODE_KABI_ITERATE which is checked in iterate_dir().
+		dnl # When detected ignore this interface and fallback to
+		dnl # to using fops.readdir() to retain KABI compatibility.
+		dnl #
 		AC_MSG_CHECKING([whether fops->iterate() is available])
 		ZFS_LINUX_TRY_COMPILE([
 			#include <linux/fs.h>
-			int iterate(struct file *filp, struct dir_context * context)
-			    { return 0; }
+			int iterate(struct file *filp,
+			    struct dir_context *context) { return 0; }
 
 			static const struct file_operations fops
 			    __attribute__ ((unused)) = {
 				.iterate	 = iterate,
 			};
+
+			#if defined(FMODE_KABI_ITERATE)
+			#error "RHEL 7.5, FMODE_KABI_ITERATE interface"
+			#endif
 		],[
 		],[
 			AC_MSG_RESULT(yes)
@@ -44,8 +55,8 @@  AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
 			AC_MSG_CHECKING([whether fops->readdir() is available])
 			ZFS_LINUX_TRY_COMPILE([
 				#include <linux/fs.h>
-				int readdir(struct file *filp, void *entry, filldir_t func)
-				    { return 0; }
+				int readdir(struct file *filp, void *entry,
+				    filldir_t func) { return 0; }
 
 				static const struct file_operations fops
 				    __attribute__ ((unused)) = {
@@ -57,7 +68,7 @@  AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
 				AC_DEFINE(HAVE_VFS_READDIR, 1,
 					  [fops->readdir() is available])
 			],[
-				AC_MSG_ERROR(no; file a bug report with ZFSOnLinux)
+				AC_MSG_ERROR(no; file a bug report with ZoL)
 			])
 		])
 	])
diff --git a/zfs/config/kernel-vfs-rw-iterate.m4 b/zfs/config/kernel-vfs-rw-iterate.m4
index 9f8fe65..ace54f7 100644
--- a/zfs/config/kernel-vfs-rw-iterate.m4
+++ b/zfs/config/kernel-vfs-rw-iterate.m4
@@ -32,15 +32,23 @@  dnl #
 dnl # Linux 4.1 API
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_NEW_SYNC_READ],
-	[AC_MSG_CHECKING([whether new_sync_read() is available])
+	[AC_MSG_CHECKING([whether new_sync_read/write() are available])
 	ZFS_LINUX_TRY_COMPILE([
 		#include <linux/fs.h>
 	],[
-		new_sync_read(NULL, NULL, 0, NULL);
+		        ssize_t ret __attribute__ ((unused));
+			struct file *filp = NULL;
+			char __user *rbuf = NULL;
+			const char __user *wbuf = NULL;
+			size_t len = 0;
+			loff_t ppos;
+
+			ret = new_sync_read(filp, rbuf, len, &ppos);
+			ret = new_sync_write(filp, wbuf, len, &ppos);
 	],[
 		AC_MSG_RESULT(yes)
 		AC_DEFINE(HAVE_NEW_SYNC_READ, 1,
-			[new_sync_read() is available])
+			[new_sync_read()/new_sync_write() are available])
 	],[
 		AC_MSG_RESULT(no)
 	])
diff --git a/zfs/config/kernel-vm_node_stat.m4 b/zfs/config/kernel-vm_node_stat.m4
deleted file mode 100644
index e1c42f8..0000000
--- a/zfs/config/kernel-vm_node_stat.m4
+++ /dev/null
@@ -1,22 +0,0 @@ 
-dnl #
-dnl # 4.8 API change
-dnl # kernel vm counters change
-dnl #
-AC_DEFUN([ZFS_AC_KERNEL_VM_NODE_STAT], [
-	AC_MSG_CHECKING([whether to use vm_node_stat based fn's])
-	ZFS_LINUX_TRY_COMPILE([
-		#include <linux/mm.h>
-		#include <linux/vmstat.h>
-        ],[
-			int a __attribute__ ((unused)) = NR_VM_NODE_STAT_ITEMS;
-			long x __attribute__ ((unused)) =
-				atomic_long_read(&vm_node_stat[0]);
-			(void) global_node_page_state(0);
-	],[
-		AC_MSG_RESULT(yes)
-		AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1,
-			[using global_node_page_state()])
-	],[
-		AC_MSG_RESULT(no)
-	])
-])
diff --git a/zfs/config/kernel.m4 b/zfs/config/kernel.m4
index 5751cc1..375e4b7 100644
--- a/zfs/config/kernel.m4
+++ b/zfs/config/kernel.m4
@@ -126,7 +126,7 @@  AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
 	ZFS_AC_KERNEL_RENAME_WANTS_FLAGS
 	ZFS_AC_KERNEL_HAVE_GENERIC_SETXATTR
 	ZFS_AC_KERNEL_CURRENT_TIME
-	ZFS_AC_KERNEL_VM_NODE_STAT
+	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE
 	ZFS_AC_KERNEL_ACL_HAS_REFCOUNT
 	ZFS_AC_KERNEL_USERNS_CAPABILITIES
 
@@ -727,7 +727,7 @@  AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
 	modpost_flag=''
 	test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
 	AS_IF(
-		[AC_TRY_COMMAND(cp conftest.c conftest.h build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
+		[AC_TRY_COMMAND(cp conftest.c conftest.h build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $FRAME_LARGER_THAN $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
 		[$4],
 		[_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
 	)
diff --git a/zfs/config/ltmain.sh b/zfs/config/ltmain.sh
index a736cf9..e4eda6d 100644
--- a/zfs/config/ltmain.sh
+++ b/zfs/config/ltmain.sh
@@ -31,7 +31,7 @@ 
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-2"
+VERSION="2.4.6 Debian-2.4.6-2.1"
 package_revision=2.4.6
 
 
@@ -64,7 +64,7 @@  package_revision=2.4.6
 # libraries, which are installed to $pkgauxdir.
 
 # Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
@@ -580,16 +580,16 @@  if test yes = "$_G_HAVE_PLUSEQ_OP"; then
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1+=\\ \$func_quote_arg_result"
   }'
 else
   func_append_quoted ()
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1=\$$1\\ \$func_quote_arg_result"
   }
 fi
 
@@ -1091,85 +1091,181 @@  func_relative_path ()
 }
 
 
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg.  Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
 {
     $debug_cmd
 
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+    func_quote_portable_result=$2
+
+    # one-time-loop (easy break)
+    while true
+    do
+      if $1; then
+        func_quote_portable_result=`$ECHO "$2" | $SED \
+          -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+        break
       fi
 
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
+      # Quote for eval.
+      case $func_quote_portable_result in
+        *[\\\`\"\$]*)
+          case $func_quote_portable_result in
+            *[\[\*\?]*)
+              func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
+              break
+              ;;
+          esac
+
+          func_quote_portable_old_IFS=$IFS
+          for _G_char in '\' '`' '"' '$'
+          do
+            # STATE($1) PREV($2) SEPARATOR($3)
+            set start "" ""
+            func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+            IFS=$_G_char
+            for _G_part in $func_quote_portable_result
+            do
+              case $1 in
+              quote)
+                func_append func_quote_portable_result "$3$2"
+                set quote "$_G_part" "\\$_G_char"
+                ;;
+              start)
+                set first "" ""
+                func_quote_portable_result=
+                ;;
+              first)
+                set quote "$_G_part" ""
+                ;;
+              esac
+            done
+          done
+          IFS=$func_quote_portable_old_IFS
           ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
+        *) ;;
       esac
-
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
+      break
     done
+
+    func_quote_portable_unquoted_result=$func_quote_portable_result
+    case $func_quote_portable_result in
+      # double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and variable expansion
+      # for a subsequent eval.
+      # many bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_portable_result=\"$func_quote_portable_result\"
+        ;;
+    esac
 }
 
 
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal).  This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed.  Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+  func_quotefast_eval ()
+  {
+    printf -v func_quotefast_eval_result %q "$1"
+  }
+else
+  func_quotefast_eval ()
+  {
+    func_quote_portable false "$1"
+    func_quotefast_eval_result=$func_quote_portable_result
+  }
+fi
 
-    case $1 in
-      *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later.  MODEs argument may contain zero ore more
+# specifiers listed below separated by ',' character.  This function returns two
+# values:
+#   i) func_quote_arg_result
+#      double-quoted (when needed), suitable for a subsequent eval
+#  ii) func_quote_arg_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.  Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+#       - escape shell special characters
+# 'expand'
+#       - the same as 'eval';  but do not quote variable references
+# 'pretty'
+#       - request aesthetic output, i.e. '"a b"' instead of 'a\ b'.  This might
+#         later used in func_quote to get output like: 'echo "a b"' instead of
+#         'echo a\ b'.  This is slower than default on some shells.
+# 'unquoted'
+#       - produce also $func_quote_arg_unquoted_result which does not contain
+#         wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+#   string      | *_result              | *_unquoted_result
+#   ------------+-----------------------+-------------------
+#   "           | \"                    | \"
+#   a b         | "a b"                 | a b
+#   "a b"       | "\"a b\""             | \"a b\"
+#   *           | "*"                   | *
+#   z="${x-$y}" | "z=\"\${x-\$y}\""     | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+#   string        |   *_result          |  *_unquoted_result
+#   --------------+---------------------+--------------------
+#   z="${x-$y}"   | "z=\"${x-$y}\""     | z=\"${x-$y}\"
+func_quote_arg ()
+{
+    _G_quote_expand=false
+    case ,$1, in
+      *,expand,*)
+        _G_quote_expand=:
+        ;;
     esac
 
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
+    case ,$1, in
+      *,pretty,*|*,expand,*|*,unquoted,*)
+        func_quote_portable $_G_quote_expand "$2"
+        func_quote_arg_result=$func_quote_portable_result
+        func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+        ;;
+      *)
+        # Faster quote-for-eval for some shells.
+        func_quotefast_eval "$2"
+        func_quote_arg_result=$func_quotefast_eval_result
         ;;
     esac
+}
 
-    func_quote_for_expand_result=$_G_arg
+
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command.  See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+    $debug_cmd
+    _G_func_quote_mode=$1 ; shift
+    func_quote_result=
+    while test 0 -lt $#; do
+      func_quote_arg "$_G_func_quote_mode" "$1"
+      if test -n "$func_quote_result"; then
+        func_append func_quote_result " $func_quote_arg_result"
+      else
+        func_append func_quote_result "$func_quote_arg_result"
+      fi
+      shift
+    done
 }
 
 
@@ -1215,8 +1311,8 @@  func_show_eval ()
     _G_cmd=$1
     _G_fail_exp=${2-':'}
 
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
+    func_quote_arg pretty,expand "$_G_cmd"
+    eval "func_notquiet $func_quote_arg_result"
 
     $opt_dry_run || {
       eval "$_G_cmd"
@@ -1241,8 +1337,8 @@  func_show_eval_locale ()
     _G_fail_exp=${2-':'}
 
     $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
+      func_quote_arg expand,pretty "$_G_cmd"
+      eval "func_echo $func_quote_arg_result"
     }
 
     $opt_dry_run || {
@@ -1370,7 +1466,7 @@  func_lt_ver ()
 #! /bin/sh
 
 # Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # A portable, pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
@@ -1530,6 +1626,8 @@  func_run_hooks ()
 {
     $debug_cmd
 
+    _G_rc_run_hooks=false
+
     case " $hookable_fns " in
       *" $1 "*) ;;
       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
@@ -1538,16 +1636,16 @@  func_run_hooks ()
     eval _G_hook_fns=\$$1_hooks; shift
 
     for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
+      if eval $_G_hook '"$@"'; then
+        # store returned options list back into positional
+        # parameters for next 'cmd' execution.
+        eval _G_hook_result=\$${_G_hook}_result
+        eval set dummy "$_G_hook_result"; shift
+        _G_rc_run_hooks=:
+      fi
     done
 
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
+    $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
 }
 
 
@@ -1557,10 +1655,16 @@  func_run_hooks ()
 ## --------------- ##
 
 # In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
+# full positional parameter list in your hook function, you may remove/edit
+# any options that you action, and then pass back the remaining unprocessed
 # options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
+# 'eval'.  In this case you also must return $EXIT_SUCCESS to let the
+# hook's caller know that it should pay attention to
+# '<hooked_function_name>_result'.  Returning $EXIT_FAILURE signalizes that
+# arguments are left untouched by the hook and therefore caller will ignore the
+# result variable.
+#
+# Like this:
 #
 #    my_options_prep ()
 #    {
@@ -1570,9 +1674,11 @@  func_run_hooks ()
 #        usage_message=$usage_message'
 #      -s, --silent       don'\''t print informational messages
 #    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
+#        # No change in '$@' (ignored completely by this hook).  There is
+#        # no need to do the equivalent (but slower) action:
+#        # func_quote eval ${1+"$@"}
+#        # my_options_prep_result=$func_quote_result
+#        false
 #    }
 #    func_add_hook func_options_prep my_options_prep
 #
@@ -1581,25 +1687,37 @@  func_run_hooks ()
 #    {
 #        $debug_cmd
 #
+#        args_changed=false
+#
 #        # Note that for efficiency, we parse as many options as we can
 #        # recognise in a loop before passing the remainder back to the
 #        # caller on the first unrecognised argument we encounter.
 #        while test $# -gt 0; do
 #          opt=$1; shift
 #          case $opt in
-#            --silent|-s) opt_silent=: ;;
+#            --silent|-s) opt_silent=:
+#                         args_changed=:
+#                         ;;
 #            # Separate non-argument short options:
 #            -s*)         func_split_short_opt "$_G_opt"
 #                         set dummy "$func_split_short_opt_name" \
 #                             "-$func_split_short_opt_arg" ${1+"$@"}
 #                         shift
+#                         args_changed=:
 #                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#            *)           # Make sure the first unrecognised option "$_G_opt"
+#                         # is added back to "$@", we could need that later
+#                         # if $args_changed is true.
+#                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
 #          esac
 #        done
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
+#        if $args_changed; then
+#          func_quote eval ${1+"$@"}
+#          my_silent_option_result=$func_quote_result
+#        fi
+#
+#        $args_changed
 #    }
 #    func_add_hook func_parse_options my_silent_option
 #
@@ -1611,16 +1729,32 @@  func_run_hooks ()
 #        $opt_silent && $opt_verbose && func_fatal_help "\
 #    '--silent' and '--verbose' options are mutually exclusive."
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
+#        false
 #    }
 #    func_add_hook func_validate_options my_option_validation
 #
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
 # options you parse.  It's preferable to append if you can, so that
 # multiple option parsing hooks can be added safely.
 
 
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+    $debug_cmd
+
+    _G_func_options_finish_exit=false
+    if func_run_hooks func_options ${1+"$@"}; then
+      func_options_finish_result=$func_run_hooks_result
+      _G_func_options_finish_exit=:
+    fi
+
+    $_G_func_options_finish_exit
+}
+
+
 # func_options [ARG]...
 # ---------------------
 # All the functions called inside func_options are hookable. See the
@@ -1630,17 +1764,28 @@  func_options ()
 {
     $debug_cmd
 
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
+    _G_rc_options=false
 
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
+    for my_func in options_prep parse_options validate_options options_finish
+    do
+      if eval func_$my_func '${1+"$@"}'; then
+        eval _G_res_var='$'"func_${my_func}_result"
+        eval set dummy "$_G_res_var" ; shift
+        _G_rc_options=:
+      fi
+    done
 
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
+    # Save modified positional parameters for caller.  As a top-level
+    # options-parser function we always need to set the 'func_options_result'
+    # variable (regardless the $_G_rc_options value).
+    if $_G_rc_options; then
+      func_options_result=$_G_res_var
+    else
+      func_quote eval ${1+"$@"}
+      func_options_result=$func_quote_result
+    fi
+
+    $_G_rc_options
 }
 
 
@@ -1649,9 +1794,9 @@  func_options ()
 # All initialisations required before starting the option parse loop.
 # Note that when calling hook functions, we pass through the list of
 # positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
+# needs to propagate that back to rest of this script, then the complete
 # modified list must be put in 'func_run_hooks_result' before
-# returning.
+# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
 func_hookable func_options_prep
 func_options_prep ()
 {
@@ -1661,10 +1806,14 @@  func_options_prep ()
     opt_verbose=false
     opt_warning_types=
 
-    func_run_hooks func_options_prep ${1+"$@"}
+    _G_rc_options_prep=false
+    if func_run_hooks func_options_prep ${1+"$@"}; then
+      _G_rc_options_prep=:
+      # save modified positional parameters for caller
+      func_options_prep_result=$func_run_hooks_result
+    fi
 
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
+    $_G_rc_options_prep
 }
 
 
@@ -1678,18 +1827,20 @@  func_parse_options ()
 
     func_parse_options_result=
 
+    _G_rc_parse_options=false
     # this just eases exit handling
     while test $# -gt 0; do
       # Defer to hook functions for initial option parsing, so they
       # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
+      if func_run_hooks func_parse_options ${1+"$@"}; then
+        eval set dummy "$func_run_hooks_result"; shift
+        _G_rc_parse_options=:
+      fi
 
       # Break out of the loop if we already parsed every option.
       test $# -gt 0 || break
 
+      _G_match_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -1704,7 +1855,10 @@  func_parse_options ()
 		      ;;
 
         --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
+                      if test $# = 0 && func_missing_arg $_G_opt; then
+                        _G_rc_parse_options=:
+                        break
+                      fi
                       case " $warning_categories $1" in
                         *" $1 "*)
                           # trailing space prevents matching last $1 above
@@ -1757,15 +1911,25 @@  func_parse_options ()
                       shift
                       ;;
 
-        --)           break ;;
+        --)           _G_rc_parse_options=: ; break ;;
         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift
+                      _G_match_parse_options=false
+                      break
+                      ;;
       esac
+
+      $_G_match_parse_options && _G_rc_parse_options=:
     done
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
+
+    if $_G_rc_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      func_parse_options_result=$func_quote_result
+    fi
+
+    $_G_rc_parse_options
 }
 
 
@@ -1778,16 +1942,21 @@  func_validate_options ()
 {
     $debug_cmd
 
+    _G_rc_validate_options=false
+
     # Display all warnings if -W was not given.
     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    func_run_hooks func_validate_options ${1+"$@"}
+    if func_run_hooks func_validate_options ${1+"$@"}; then
+      # save modified positional parameters for caller
+      func_validate_options_result=$func_run_hooks_result
+      _G_rc_validate_options=:
+    fi
 
     # Bail if the options were screwed!
     $exit_cmd $EXIT_FAILURE
 
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
+    $_G_rc_validate_options
 }
 
 
@@ -2068,7 +2237,7 @@  include the following information:
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname $scriptversion Debian-2.4.6-2
+       version:        $progname $scriptversion Debian-2.4.6-2.1
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
@@ -2270,6 +2439,8 @@  libtool_options_prep ()
     nonopt=
     preserve_args=
 
+    _G_rc_lt_options_prep=:
+
     # Shorthand for --mode=foo, only valid as the first argument
     case $1 in
     clean|clea|cle|cl)
@@ -2293,11 +2464,18 @@  libtool_options_prep ()
     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
       shift; set dummy --mode uninstall ${1+"$@"}; shift
       ;;
+    *)
+      _G_rc_lt_options_prep=false
+      ;;
     esac
 
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
+    if $_G_rc_lt_options_prep; then
+      # Pass back the list of options.
+      func_quote eval ${1+"$@"}
+      libtool_options_prep_result=$func_quote_result
+    fi
+
+    $_G_rc_lt_options_prep
 }
 func_add_hook func_options_prep libtool_options_prep
 
@@ -2309,9 +2487,12 @@  libtool_parse_options ()
 {
     $debug_cmd
 
+    _G_rc_lt_parse_options=false
+
     # Perform our own loop to consume as many options as possible in
     # each iteration.
     while test $# -gt 0; do
+      _G_match_lt_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -2386,15 +2567,22 @@  libtool_parse_options ()
                         func_append preserve_args " $_G_opt"
                         ;;
 
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+        # An option not handled by this hook function:
+        *)              set dummy "$_G_opt" ${1+"$@"} ; shift
+                        _G_match_lt_parse_options=false
+                        break
+                        ;;
       esac
+      $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
     done
 
+    if $_G_rc_lt_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      libtool_parse_options_result=$func_quote_result
+    fi
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
+    $_G_rc_lt_parse_options
 }
 func_add_hook func_parse_options libtool_parse_options
 
@@ -2451,8 +2639,8 @@  libtool_validate_options ()
     }
 
     # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_result
 }
 func_add_hook func_validate_options libtool_validate_options
 
@@ -3418,8 +3606,8 @@  func_mode_compile ()
       esac
     done
 
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
+    func_quote_arg pretty "$libobj"
+    test "X$libobj" != "X$func_quote_arg_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
       && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
@@ -3492,8 +3680,8 @@  compiler."
 
     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
     srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
+    func_quote_arg pretty "$srcfile"
+    qsrcfile=$func_quote_arg_result
 
     # Only build a PIC object if we are building libtool libraries.
     if test yes = "$build_libtool_libs"; then
@@ -4096,8 +4284,8 @@  func_mode_install ()
        case $nonopt in *shtool*) :;; *) false;; esac
     then
       # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
+      func_quote_arg pretty "$nonopt"
+      install_prog="$func_quote_arg_result "
       arg=$1
       shift
     else
@@ -4107,8 +4295,8 @@  func_mode_install ()
 
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
+    func_quote_arg pretty "$arg"
+    func_append install_prog "$func_quote_arg_result"
     install_shared_prog=$install_prog
     case " $install_prog " in
       *[\\\ /]cp\ *) install_cp=: ;;
@@ -4165,12 +4353,12 @@  func_mode_install ()
       esac
 
       # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
+      func_quote_arg pretty "$arg"
+      func_append install_prog " $func_quote_arg_result"
       if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
+	func_quote_arg pretty "$arg2"
       fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
+      func_append install_shared_prog " $func_quote_arg_result"
     done
 
     test -z "$install_prog" && \
@@ -4181,8 +4369,8 @@  func_mode_install ()
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
+	func_quote_arg pretty "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_arg_result"
       fi
     fi
 
@@ -4478,8 +4666,8 @@  func_mode_install ()
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
 	        $opt_quiet || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
+	          func_quote_arg expand,pretty "$relink_command"
+		  eval "func_echo $func_quote_arg_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
@@ -5258,7 +5446,8 @@  else
   if test \"\$libtool_execute_magic\" != \"$magic\"; then
     file=\"\$0\""
 
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    func_quote_arg pretty "$ECHO"
+    qECHO=$func_quote_arg_result
     $ECHO "\
 
 # A function that is used when there is no print builtin or printf.
@@ -5268,7 +5457,7 @@  func_fallback_echo ()
 \$1
 _LTECHO_EOF'
 }
-    ECHO=\"$qECHO\"
+    ECHO=$qECHO
   fi
 
 # Very basic option parsing. These options are (a) specific to
@@ -6611,9 +6800,9 @@  func_mode_link ()
     while test "$#" -gt 0; do
       arg=$1
       shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
+      func_quote_arg pretty,unquoted "$arg"
+      qarg=$func_quote_arg_unquoted_result
+      func_append libtool_args " $func_quote_arg_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
@@ -7211,9 +7400,9 @@  func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $func_quote_arg_result"
+	  func_append compiler_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7227,10 +7416,10 @@  func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $wl$func_quote_arg_result"
+	  func_append compiler_flags " $wl$func_quote_arg_result"
+	  func_append linker_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7254,8 +7443,8 @@  func_mode_link ()
 
       # -msg_* for osf cc
       -msg_*)
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -7279,8 +7468,8 @@  func_mode_link ()
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
       -specs=*|-fsanitize=*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
@@ -7301,15 +7490,15 @@  func_mode_link ()
 	  continue
         else
 	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
+	  func_quote_arg pretty "$arg"
+	  arg=$func_quote_arg_result
         fi
 	;;
 
       # Some other compiler flag.
       -* | +*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       *.$objext)
@@ -7429,8 +7618,8 @@  func_mode_link ()
       *)
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
       esac # arg
 
@@ -9942,8 +10131,8 @@  EOF
 	    for cmd in $concat_cmds; do
 	      IFS=$save_ifs
 	      $opt_quiet || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
+		  func_quote_arg expand,pretty "$cmd"
+		  eval "func_echo $func_quote_arg_result"
 	      }
 	      $opt_dry_run || eval "$cmd" || {
 		lt_exit=$?
@@ -10036,8 +10225,8 @@  EOF
 	  eval cmd=\"$cmd\"
 	  IFS=$save_ifs
 	  $opt_quiet || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
+	    func_quote_arg expand,pretty "$cmd"
+	    eval "func_echo $func_quote_arg_result"
 	  }
 	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
@@ -10511,12 +10700,12 @@  EOF
 	  elif eval var_value=\$$var; test -z "$var_value"; then
 	    relink_command="$var=; export $var; $relink_command"
 	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	    func_quote_arg pretty "$var_value"
+	    relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
 	  fi
 	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+	func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
+	relink_command=$func_quote_arg_unquoted_result
       fi
 
       # Only actually do things if not in dry run mode.
@@ -10756,13 +10945,14 @@  EOF
 	elif eval var_value=\$$var; test -z "$var_value"; then
 	  relink_command="$var=; export $var; $relink_command"
 	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  func_quote_arg pretty,unquoted "$var_value"
+	  relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
 	fi
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      func_quote_arg pretty,unquoted "$relink_command"
+      relink_command=$func_quote_arg_unquoted_result
       if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
diff --git a/zfs/config/tgz.am b/zfs/config/tgz.am
index 2997b1d..0657d04 100644
--- a/zfs/config/tgz.am
+++ b/zfs/config/tgz.am
@@ -2,9 +2,9 @@  tgz-local:
 	@(if test "${HAVE_ALIEN}" = "no"; then \
 		echo -e "\n" \
 	"*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+	"*** package for your distribution which provides ${ALIEN},\n" \
 	"*** re-run configure, and try again.\n"; \
-                exit 1; \
+		exit 1; \
 	fi)
 
 tgz-kmod: tgz-local rpm-kmod
diff --git a/zfs/config/user-libattr.m4 b/zfs/config/user-libattr.m4
deleted file mode 100644
index 3298fd4..0000000
--- a/zfs/config/user-libattr.m4
+++ /dev/null
@@ -1,12 +0,0 @@ 
-dnl #
-dnl # Check for libattr
-dnl #
-AC_DEFUN([ZFS_AC_CONFIG_USER_LIBATTR], [
-	LIBATTR=
-
-	AC_CHECK_HEADER([attr/xattr.h], [], [AC_MSG_FAILURE([
-	*** attr/xattr.h missing, libattr-devel package required])])
-
-	AC_SUBST([LIBATTR], ["-lattr"])
-	AC_DEFINE([HAVE_LIBATTR], 1, [Define if you have libattr])
-])
diff --git a/zfs/config/user-libblkid.m4 b/zfs/config/user-libblkid.m4
index 5bc7f46..88e6f99 100644
--- a/zfs/config/user-libblkid.m4
+++ b/zfs/config/user-libblkid.m4
@@ -6,7 +6,7 @@  AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
 	LIBBLKID=
 
 	AC_CHECK_HEADER([blkid/blkid.h], [], [AC_MSG_FAILURE([
-        *** blkid.h missing, libblkid-devel package required])])
+	*** blkid.h missing, libblkid-devel package required])])
 
 	AC_SUBST([LIBBLKID], ["-lblkid"])
 	AC_DEFINE([HAVE_LIBBLKID], 1, [Define if you have libblkid])
diff --git a/zfs/config/user-systemd.m4 b/zfs/config/user-systemd.m4
index c2105ab..de2a44f 100644
--- a/zfs/config/user-systemd.m4
+++ b/zfs/config/user-systemd.m4
@@ -2,7 +2,8 @@  AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
 	AC_ARG_ENABLE(systemd,
 		AC_HELP_STRING([--enable-systemd],
 		[install systemd unit/preset files [[default: yes]]]),
-		[],enable_systemd=yes)
+		[enable_systemd=$enableval],
+		[enable_systemd=check])
 
 	AC_ARG_WITH(systemdunitdir,
 		AC_HELP_STRING([--with-systemdunitdir=DIR],
@@ -19,16 +20,27 @@  AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
 		[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
 		systemdmoduleloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
 
+	AS_IF([test "x$enable_systemd" = xcheck], [
+		AS_IF([systemctl --version >/dev/null 2>&1],
+			[enable_systemd=yes],
+			[enable_systemd=no])
+	])
 
-	AS_IF([test "x$enable_systemd" = xyes],
-		[
+	AC_MSG_CHECKING(for systemd support)
+	AC_MSG_RESULT([$enable_systemd])
+
+	AS_IF([test "x$enable_systemd" = xyes], [
 		ZFS_INIT_SYSTEMD=systemd
 		ZFS_MODULE_LOAD=modules-load.d
+		DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)"'
 		modulesloaddir=$systemdmodulesloaddir
-		])
+	],[
+		DEFINE_SYSTEMD='--without systemd'
+	])
 
 	AC_SUBST(ZFS_INIT_SYSTEMD)
 	AC_SUBST(ZFS_MODULE_LOAD)
+	AC_SUBST(DEFINE_SYSTEMD)
 	AC_SUBST(systemdunitdir)
 	AC_SUBST(systemdpresetdir)
 	AC_SUBST(modulesloaddir)
diff --git a/zfs/config/user.m4 b/zfs/config/user.m4
index d5d0a90..9edf2bd 100644
--- a/zfs/config/user.m4
+++ b/zfs/config/user.m4
@@ -12,10 +12,9 @@  AC_DEFUN([ZFS_AC_CONFIG_USER], [
 	ZFS_AC_CONFIG_USER_LIBUUID
 	ZFS_AC_CONFIG_USER_LIBTIRPC
 	ZFS_AC_CONFIG_USER_LIBBLKID
-	ZFS_AC_CONFIG_USER_LIBATTR
 	ZFS_AC_CONFIG_USER_LIBUDEV
-	ZFS_AC_CONFIG_USER_LIBAIO
 	ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN
+	ZFS_AC_CONFIG_USER_LIBAIO
 	ZFS_AC_CONFIG_USER_RUNSTATEDIR
 	ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
 	ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
diff --git a/zfs/config/zfs-build.m4 b/zfs/config/zfs-build.m4
index 1224682..5e081c2 100644
--- a/zfs/config/zfs-build.m4
+++ b/zfs/config/zfs-build.m4
@@ -6,37 +6,75 @@  AC_DEFUN([ZFS_AC_LICENSE], [
 	AC_MSG_RESULT([$ZFS_META_LICENSE])
 ])
 
+AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [
+	KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
+	HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG -Werror"
+	DEBUG_CFLAGS="-DDEBUG -Werror"
+	DEBUG_ZFS="_with_debug"
+	AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
+])
+
+AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [
+	KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
+	HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
+	DEBUG_CFLAGS="-DNDEBUG"
+	DEBUG_STACKFLAGS=""
+	DEBUG_ZFS="_without_debug"
+])
+
 AC_DEFUN([ZFS_AC_DEBUG], [
-	AC_MSG_CHECKING([whether debugging is enabled])
+	AC_MSG_CHECKING([whether assertion support will be enabled])
 	AC_ARG_ENABLE([debug],
 		[AS_HELP_STRING([--enable-debug],
-		[Enable generic debug support @<:@default=no@:>@])],
+		[Enable assertion support @<:@default=no@:>@])],
 		[],
 		[enable_debug=no])
 
-	AS_IF([test "x$enable_debug" = xyes],
-	[
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
-		HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG -Werror"
-		DEBUG_CFLAGS="-DDEBUG -Werror"
-		DEBUG_STACKFLAGS="-fstack-check"
-		DEBUG_ZFS="_with_debug"
-		AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
-	],
-	[
-		KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
-		HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
-		DEBUG_CFLAGS="-DNDEBUG"
-		DEBUG_STACKFLAGS=""
-		DEBUG_ZFS="_without_debug"
-	])
+	AS_CASE(["x$enable_debug"],
+		["xyes"],
+		[ZFS_AC_DEBUG_ENABLE],
+		["xno"],
+		[ZFS_AC_DEBUG_DISABLE],
+		[AC_MSG_ERROR([Unknown option $enable_debug])])
 
-	AC_SUBST(DEBUG_CFLAGS)
 	AC_SUBST(DEBUG_STACKFLAGS)
 	AC_SUBST(DEBUG_ZFS)
 	AC_MSG_RESULT([$enable_debug])
 ])
 
+AC_DEFUN([ZFS_AC_DEBUGINFO_KERNEL], [
+	KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS CONFIG_DEBUG_INFO=y"
+	KERNELCPPFLAGS="${KERNELCPPFLAGS} -fno-inline"
+])
+
+AC_DEFUN([ZFS_AC_DEBUGINFO_USER], [
+	DEBUG_CFLAGS="${DEBUG_CFLAGS} -g -fno-inline"
+])
+
+AC_DEFUN([ZFS_AC_DEBUGINFO], [
+	AC_MSG_CHECKING([whether debuginfo support will be forced])
+	AC_ARG_ENABLE([debuginfo],
+		[AS_HELP_STRING([--enable-debuginfo],
+		[Force generation of debuginfo @<:@default=no@:>@])],
+		[],
+		[enable_debuginfo=no])
+
+	AS_CASE(["x$enable_debuginfo"],
+		["xyes"],
+		[ZFS_AC_DEBUGINFO_KERNEL
+		ZFS_AC_DEBUGINFO_USER],
+		["xkernel"],
+		[ZFS_AC_DEBUGINFO_KERNEL],
+		["xuser"],
+		[ZFS_AC_DEBUGINFO_USER],
+		["xno"],
+		[],
+		[AC_MSG_ERROR([Unknown option $enable_debug])])
+
+	AC_SUBST(DEBUG_CFLAGS)
+	AC_MSG_RESULT([$enable_debuginfo])
+])
+
 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
 	ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
 	ZFS_AC_CONFIG_ALWAYS_NO_BOOL_COMPARE
@@ -121,10 +159,45 @@  AC_DEFUN([ZFS_AC_RPM], [
 	])
 
 	RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
-	RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)" --define "_udevdir $(udevdir)" --define "_udevruledir $(udevruledir)" --define "_initconfdir $(DEFAULT_INITCONF_DIR)" $(DEFINE_INITRAMFS)'
+
+
+	RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
+
+        dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
+        dnl # their values may not be set when running:
+        dnl #
+        dnl #   ./configure --with-config=srpm
+        dnl #
+        AS_IF([test -n "$dracutdir" ], [
+                RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)"'
+        ])
+        AS_IF([test -n "$udevdir" ], [
+                RPM_DEFINE_UTIL+=' --define "_udevdir $(udevdir)"'
+        ])
+        AS_IF([test -n "$udevruledir" ], [
+                RPM_DEFINE_UTIL+=' --define "_udevdir $(udevruledir)"'
+        ])
+        RPM_DEFINE_UTIL+=' $(DEFINE_INITRAMFS)'
+        RPM_DEFINE_UTIL+=' $(DEFINE_SYSTEMD)'
+
 	RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)" --define "require_spldir $(SPL)" --define "require_splobj $(SPL_OBJ)" --define "ksrc $(LINUX)" --define "kobj $(LINUX_OBJ)"'
+	RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
+
 	RPM_DEFINE_DKMS=
 
+	dnl # Override default lib directory on Debian/Ubuntu systems.  The provided
+	dnl # /usr/lib/rpm/platform/<arch>/macros files do not specify the correct
+	dnl # path for multiarch systems as described by the packaging guidelines.
+	dnl #
+	dnl # https://wiki.ubuntu.com/MultiarchSpec
+	dnl # https://wiki.debian.org/Multiarch/Implementation
+	dnl #
+	AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [
+		MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
+		RPM_DEFINE_UTIL+=' --define "_lib $(MULTIARCH_LIBDIR)"'
+		AC_SUBST(MULTIARCH_LIBDIR)
+	])
+
 	SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
 	SRPM_DEFINE_UTIL=
 	SRPM_DEFINE_KMOD=
diff --git a/zfs/configure b/zfs/configure
index 180bcc9..27f37db 100755
--- a/zfs/configure
+++ b/zfs/configure
@@ -1,6 +1,6 @@ 
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for zfs 0.7.5.
+# Generated by GNU Autoconf 2.69 for zfs 0.7.9.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@  MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='zfs'
 PACKAGE_TARNAME='zfs'
-PACKAGE_VERSION='0.7.5'
-PACKAGE_STRING='zfs 0.7.5'
+PACKAGE_VERSION='0.7.9'
+PACKAGE_STRING='zfs 0.7.9'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -632,9 +632,9 @@  ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+DEBUG_CFLAGS
 DEBUG_ZFS
 DEBUG_STACKFLAGS
-DEBUG_CFLAGS
 WANT_MMAP_LIBAIO_FALSE
 WANT_MMAP_LIBAIO_TRUE
 WANT_DEVNAME2DEVID_FALSE
@@ -648,10 +648,9 @@  CONFIG_USER_TRUE
 RM
 ZONENAME
 NO_FORMAT_TRUNCATION
-FRAME_LARGER_THAN
 LIBAIO
+FRAME_LARGER_THAN
 LIBUDEV
-LIBATTR
 LIBBLKID
 LIBTIRPC_CFLAGS
 LIBTIRPC
@@ -662,6 +661,7 @@  ZFS_INIT_SYSV
 modulesloaddir
 systemdpresetdir
 systemdunitdir
+DEFINE_SYSTEMD
 ZFS_MODULE_LOAD
 ZFS_INIT_SYSTEMD
 udevruledir
@@ -714,12 +714,25 @@  HAVE_RPMBUILD
 RPM_VERSION
 RPM
 HAVE_RPM
+MULTIARCH_LIBDIR
 DEFINE_INITRAMFS
 DEFAULT_INITCONF_DIR
 DEFAULT_INIT_SCRIPT
 DEFAULT_INIT_DIR
 DEFAULT_PACKAGE
 VENDOR
+CODE_COVERAGE_RULES
+CODE_COVERAGE_LDFLAGS
+CODE_COVERAGE_LIBS
+CODE_COVERAGE_CXXFLAGS
+CODE_COVERAGE_CFLAGS
+CODE_COVERAGE_CPPFLAGS
+GENHTML
+LCOV
+GCOV
+CODE_COVERAGE_ENABLED
+CODE_COVERAGE_ENABLED_FALSE
+CODE_COVERAGE_ENABLED_TRUE
 am__fastdepCCAS_FALSE
 am__fastdepCCAS_TRUE
 CCASDEPMODE
@@ -871,6 +884,8 @@  with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
+with_gcov
+enable_code_coverage
 with_spec
 with_config
 enable_linux_builtin
@@ -892,6 +907,7 @@  enable_sysvinit
 with_dracutdir
 with_tirpc
 enable_debug
+enable_debuginfo
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1455,7 +1471,7 @@  if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures zfs 0.7.5 to adapt to many kinds of systems.
+\`configure' configures zfs 0.7.9 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1527,7 +1543,7 @@  fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of zfs 0.7.5:";;
+     short | recursive ) echo "Configuration of zfs 0.7.9:";;
    esac
   cat <<\_ACEOF
 
@@ -1549,11 +1565,13 @@  Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-code-coverage  Whether to enable code coverage support
   --enable-linux-builtin  Configure for builtin in-tree kernel modules
                           [default=no]
   --enable-systemd        install systemd unit/preset files [[default: yes]]
   --enable-sysvinit       install SysV init scripts [default: yes]
-  --enable-debug          Enable generic debug support [default=no]
+  --enable-debug          Enable assertion support [default=no]
+  --enable-debuginfo      Force generation of debuginfo [default=no]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1566,6 +1584,7 @@  Optional Packages:
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                           compiler's sysroot if not specified).
+  --with-gcov=GCOV        use given GCOV for coverage (GCOV=gcov).
   --with-spec=SPEC        Spec files 'generic|redhat'
   --with-config=CONFIG    Config file 'kernel|user|all|srpm'
   --with-linux=PATH       Path to kernel source
@@ -1671,7 +1690,7 @@  fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-zfs configure 0.7.5
+zfs configure 0.7.9
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2036,7 +2055,7 @@  cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by zfs $as_me 0.7.5, which was
+It was created by zfs $as_me 0.7.9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3203,7 +3222,7 @@  fi
 
 # Define the identity of the package.
  PACKAGE='zfs'
- VERSION='0.7.5'
+ VERSION='0.7.9'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12489,6 +12508,376 @@  fi
 
 
 
+
+	# allow to override gcov location
+
+# Check whether --with-gcov was given.
+if test "${with_gcov+set}" = set; then :
+  withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov
+else
+  _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov
+fi
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5
+$as_echo_n "checking whether to build with code coverage support... " >&6; }
+	# Check whether --enable-code-coverage was given.
+if test "${enable_code_coverage+set}" = set; then :
+  enableval=$enable_code_coverage;
+else
+  enable_code_coverage=no
+fi
+
+
+	 if test x$enable_code_coverage = xyes; then
+  CODE_COVERAGE_ENABLED_TRUE=
+  CODE_COVERAGE_ENABLED_FALSE='#'
+else
+  CODE_COVERAGE_ENABLED_TRUE='#'
+  CODE_COVERAGE_ENABLED_FALSE=
+fi
+
+	CODE_COVERAGE_ENABLED=$enable_code_coverage
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5
+$as_echo "$enable_code_coverage" >&6; }
+
+	if  test "$enable_code_coverage" = "yes" ; then :
+
+		# check for gcov
+		if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GCOV+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$GCOV"; then
+  ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+GCOV=$ac_cv_prog_GCOV
+if test -n "$GCOV"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
+$as_echo "$GCOV" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_GCOV"; then
+  ac_ct_GCOV=$GCOV
+  # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args.
+set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_GCOV+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_GCOV"; then
+  ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV
+if test -n "$ac_ct_GCOV"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5
+$as_echo "$ac_ct_GCOV" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_GCOV" = x; then
+    GCOV=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    GCOV=$ac_ct_GCOV
+  fi
+else
+  GCOV="$ac_cv_prog_GCOV"
+fi
+
+		if test "X$GCOV" = "X:"; then :
+  as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5
+fi
+
+
+				if  test "$GCC" = "no" ; then :
+
+			as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5
+
+fi
+
+		# Extract the first word of "lcov", so it can be a program name with args.
+set dummy lcov; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LCOV+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LCOV"; then
+  ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LCOV="lcov"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LCOV=$ac_cv_prog_LCOV
+if test -n "$LCOV"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
+$as_echo "$LCOV" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+		# Extract the first word of "genhtml", so it can be a program name with args.
+set dummy genhtml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GENHTML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$GENHTML"; then
+  ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GENHTML="genhtml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+GENHTML=$ac_cv_prog_GENHTML
+if test -n "$GENHTML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
+$as_echo "$GENHTML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+		if  test -z "$LCOV" ; then :
+
+			as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5
+
+fi
+
+		if  test -z "$GENHTML" ; then :
+
+			as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5
+
+fi
+
+						CODE_COVERAGE_CPPFLAGS=""
+		CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+		CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+		CODE_COVERAGE_LIBS="-lgcov"
+		CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
+
+
+
+
+
+
+
+		CODE_COVERAGE_RULES_CHECK='
+	-$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
+	$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+'
+		CODE_COVERAGE_RULES_CAPTURE='
+	$(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
+	$(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
+	-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+	$(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)