[PATCH] UBUNTU: SAUCE: (noup) Update spl to 0.7.11-1ubuntu1, zfs to 0.7.11-3ubuntu1

Colin Ian King colin.king at canonical.com
Tue Nov 6 15:18:12 UTC 2018


Forgot to state, this is for Ubuntu Disco 4.19

On 06/11/2018 15:16, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> This sync's SPL and ZFS to the latest versions in 19.04 Ubuntu Disco,
> as built against the 4.19 unstable kernel and tested agains the
> Ubuntu ZFS regression tests. This contains 4.20 compat fixes too,
> so it should be good for when me move to 4.20
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  debian/rules                         |   2 +-
>  spl/META                             |   4 +-
>  spl/Makefile.in                      |  15 +-
>  spl/aclocal.m4                       | 191 +++++------
>  spl/cmd/Makefile.in                  |  15 +-
>  spl/cmd/splat/Makefile.in            |  34 +-
>  spl/cmd/splslab/Makefile.in          |  13 +-
>  spl/config/compile                   |  13 +-
>  spl/config/depcomp                   |   8 +-
>  spl/config/install-sh                |  36 +-
>  spl/config/libtool.m4                |  12 +-
>  spl/config/ltmain.sh                 |   4 +-
>  spl/config/missing                   |  16 +-
>  spl/config/spl-build.m4              |   2 +-
>  spl/configure                        | 331 +++++++++---------
>  spl/copy-builtin                     |  27 +-
>  spl/dkms.conf                        |   2 +-
>  spl/include/Makefile.in              |  15 +-
>  spl/include/fs/Makefile.in           |  13 +-
>  spl/include/linux/Makefile.in        |  13 +-
>  spl/include/rpc/Makefile.in          |  13 +-
>  spl/include/sharefs/Makefile.in      |  13 +-
>  spl/include/sys/Makefile.in          |  15 +-
>  spl/include/sys/fm/Makefile.in       |  13 +-
>  spl/include/sys/fs/Makefile.in       |  13 +-
>  spl/include/sys/isa_defs.h           |   8 +
>  spl/include/sys/kstat.h              |   2 +-
>  spl/include/sys/rwlock.h             |  10 +-
>  spl/include/sys/time.h               |   6 +-
>  spl/include/util/Makefile.in         |  13 +-
>  spl/include/vm/Makefile.in           |  13 +-
>  spl/lib/Makefile.in                  |  48 +--
>  spl/man/Makefile.in                  |  15 +-
>  spl/man/man1/Makefile.in             |  13 +-
>  spl/man/man5/Makefile.in             |  13 +-
>  spl/module/spl/spl-kstat.c           |   4 +-
>  spl/module/spl/spl-rwlock.c          |  19 +-
>  spl/module/spl/spl-vnode.c           |   2 +
>  spl/rpm/Makefile.in                  |  15 +-
>  spl/rpm/generic/Makefile.in          |  13 +-
>  spl/rpm/generic/spl-kmod.spec.in     |   6 +
>  spl/rpm/generic/spl.spec.in          |   6 +
>  spl/rpm/redhat/Makefile.in           |  13 +-
>  spl/rpm/redhat/spl.spec.in           |   6 +
>  spl/scripts/Makefile.in              |  13 +-
>  zfs/META                             |   4 +-
>  zfs/Makefile.in                      |  32 --
>  zfs/aclocal.m4                       |   1 -
>  zfs/config/kernel-elevator-change.m4 |   4 +-
>  zfs/config/kernel-inode-times.m4     |  25 --
>  zfs/config/kernel.m4                 |   1 -
>  zfs/config/ltmain.sh                 |   4 +-
>  zfs/configure                        | 489 +--------------------------
>  zfs/configure.ac                     |   1 -
>  zfs/cp                               |   2 -
>  zfs/dkms.conf                        |  81 ++---
>  zfs/include/Makefile.in              |  32 --
>  zfs/include/libzfs.h                 |   2 +
>  zfs/include/linux/Makefile.in        |  32 --
>  zfs/include/linux/blkdev_compat.h    |  11 -
>  zfs/include/linux/vfs_compat.h       |   5 -
>  zfs/include/sys/Makefile.in          |  32 --
>  zfs/include/sys/abd.h                |   2 +-
>  zfs/include/sys/arc.h                |   2 +-
>  zfs/include/sys/arc_impl.h           |   8 +-
>  zfs/include/sys/crypto/Makefile.in   |  32 --
>  zfs/include/sys/dbuf.h               |   2 +-
>  zfs/include/sys/dmu.h                |  15 +-
>  zfs/include/sys/dmu_tx.h             |  12 +-
>  zfs/include/sys/dnode.h              |  10 +-
>  zfs/include/sys/dsl_dataset.h        |   2 +-
>  zfs/include/sys/fm/Makefile.in       |  32 --
>  zfs/include/sys/fm/fs/Makefile.in    |  32 --
>  zfs/include/sys/fs/Makefile.in       |  32 --
>  zfs/include/sys/metaslab_impl.h      |   4 +-
>  zfs/include/sys/refcount.h           |  52 ++-
>  zfs/include/sys/rrwlock.h            |   4 +-
>  zfs/include/sys/sa_impl.h            |   2 +-
>  zfs/include/sys/spa.h                |   3 +
>  zfs/include/sys/spa_impl.h           |   6 +-
>  zfs/include/sys/sysevent/Makefile.in |  32 --
>  zfs/include/sys/zap.h                |   2 +-
>  zfs/include/sys/zap_leaf.h           |  15 +-
>  zfs/include/sys/zfs_znode.h          |   2 +-
>  zfs/module/icp/algs/modes/ccm.c      |   2 +-
>  zfs/module/icp/core/kcf_mech_tabs.c  |   2 +-
>  zfs/module/zfs/arc.c                 |  12 +-
>  zfs/module/zfs/dbuf.c                |  10 +-
>  zfs/module/zfs/dmu.c                 |   2 +-
>  zfs/module/zfs/dmu_object.c          |   6 +-
>  zfs/module/zfs/dmu_send.c            |  81 ++++-
>  zfs/module/zfs/dmu_tx.c              |  63 ++--
>  zfs/module/zfs/dnode.c               |  91 ++++-
>  zfs/module/zfs/dnode_sync.c          |   2 +
>  zfs/module/zfs/dsl_dataset.c         |   2 +-
>  zfs/module/zfs/metaslab.c            |  14 +-
>  zfs/module/zfs/mmp.c                 |   5 +-
>  zfs/module/zfs/refcount.c            |  30 +-
>  zfs/module/zfs/rrwlock.c             |   4 +-
>  zfs/module/zfs/sa.c                  |  37 +-
>  zfs/module/zfs/spa_misc.c            |  48 ++-
>  zfs/module/zfs/spa_stats.c           |  62 ++++
>  zfs/module/zfs/vdev_disk.c           |  93 +++--
>  zfs/module/zfs/zap.c                 |  10 +-
>  zfs/module/zfs/zap_leaf.c            |   2 +-
>  zfs/module/zfs/zap_micro.c           |  47 ++-
>  zfs/module/zfs/zfs_ctldir.c          |  12 +-
>  zfs/module/zfs/zfs_dir.c             |  29 +-
>  zfs/module/zfs/zfs_ioctl.c           |  35 +-
>  zfs/module/zfs/zfs_vnops.c           |  95 ++++--
>  zfs/module/zfs/zfs_znode.c           |   2 +-
>  zfs/module/zfs/zil.c                 |  21 +-
>  zfs/scripts/dkms.postbuild           |  24 ++
>  zfs/zfs_config.h.in                  |   3 -
>  114 files changed, 1332 insertions(+), 1646 deletions(-)
>  delete mode 100644 zfs/config/kernel-inode-times.m4
>  delete mode 100755 zfs/cp
>  create mode 100755 zfs/scripts/dkms.postbuild
> 
> diff --git a/debian/rules b/debian/rules
> index 9b9d46eb1b01..2ac36294b87b 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -87,7 +87,7 @@ ifneq ($(do_tools),true)
>  	do_tools_host=
>  endif
>  
> -do_zfs=false
> +do_zfs=true
>  
>  ifeq ($(do_zfs),false)
>  	do_zfs_disable:=$(shell cat $(DROOT)/zfs-modules.ignore >>$(prev_abidir)/../modules.ignore)
> diff --git a/spl/META b/spl/META
> index 3bc9f73f53f7..7bd657daea87 100644
> --- a/spl/META
> +++ b/spl/META
> @@ -1,8 +1,8 @@
>  Meta:         1
>  Name:         spl
>  Branch:       1.0
> -Version:      0.7.9
> -Release:      3ubuntu2
> +Version:      0.7.11
> +Release:      1ubuntu1
>  Release-Tags: relext
>  License:      GPL
>  Author:       OpenZFS on Linux
> diff --git a/spl/Makefile.in b/spl/Makefile.in
> index 4768b103b116..3f3aad1332ba 100644
> --- a/spl/Makefile.in
> +++ b/spl/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -234,7 +234,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	cscope distdir dist dist-all distcheck
> +	cscope distdir distdir-am dist dist-all distcheck
>  am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
>  	$(LISP)spl_config.h.in
>  # Read a list of newline-separated strings from the standard input,
> @@ -513,8 +513,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	    echo ' $(SHELL) ./config.status'; \
>  	    $(SHELL) ./config.status;; \
>  	  *) \
> -	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
> -	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  $(srcdir)/config/rpm.am $(srcdir)/config/deb.am $(srcdir)/config/tgz.am $(am__empty):
>  
> @@ -705,7 +705,10 @@ distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	$(am__remove_distdir)
>  	test -d "$(distdir)" || mkdir "$(distdir)"
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
> diff --git a/spl/aclocal.m4 b/spl/aclocal.m4
> index da21f5a43114..4579a6fccb70 100644
> --- a/spl/aclocal.m4
> +++ b/spl/aclocal.m4
> @@ -1,6 +1,6 @@
> -# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
> +# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
>  
> -# Copyright (C) 1996-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
>  
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
>  If you have problems, you may need to regenerate the build system entirely.
>  To do so, use the procedure documented by the package, typically 'autoreconf'.])])
>  
> -# Copyright (C) 2002-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2002-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
>  # generated from the m4 files accompanying Automake X.Y.
>  # (This private macro should not be called outside this file.)
>  AC_DEFUN([AM_AUTOMAKE_VERSION],
> -[am__api_version='1.15'
> +[am__api_version='1.16'
>  dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
>  dnl require some minimum version.  Point them to the right macro.
> -m4_if([$1], [1.15.1], [],
> +m4_if([$1], [1.16.1], [],
>        [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
>  ])
>  
> @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
>  # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
>  # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
>  AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
> -[AM_AUTOMAKE_VERSION([1.15.1])dnl
> +[AM_AUTOMAKE_VERSION([1.16.1])dnl
>  m4_ifndef([AC_AUTOCONF_VERSION],
>    [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
>  _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
>  
>  # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
>  
>  # AM_CONDITIONAL                                            -*- Autoconf -*-
>  
> -# Copyright (C) 1997-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1997-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
>  Usually this means the macro was only invoked conditionally.]])
>  fi])])
>  
> -# Copyright (C) 1999-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1999-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
>  
>  # Generate code to set up dependency tracking.              -*- Autoconf -*-
>  
> -# Copyright (C) 1999-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1999-2018 Free Software Foundation, Inc.
>  #
>  # This file 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.
>  
> -
>  # _AM_OUTPUT_DEPENDENCY_COMMANDS
>  # ------------------------------
>  AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
> @@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
>    # Older Autoconf quotes --file arguments for eval, but not when files
>    # are listed without --file.  Let's play safe and only enable the eval
>    # if we detect the quoting.
> -  case $CONFIG_FILES in
> -  *\'*) eval set x "$CONFIG_FILES" ;;
> -  *)   set x $CONFIG_FILES ;;
> -  esac
> +  # TODO: see whether this extra hack can be removed once we start
> +  # requiring Autoconf 2.70 or later.
> +  AS_CASE([$CONFIG_FILES],
> +          [*\'*], [eval set x "$CONFIG_FILES"],
> +          [*], [set x $CONFIG_FILES])
>    shift
> -  for mf
> +  # Used to flag and report bootstrapping failures.
> +  am_rc=0
> +  for am_mf
>    do
>      # Strip MF so we end up with the name of the file.
> -    mf=`echo "$mf" | sed -e 's/:.*$//'`
> -    # Check whether this is an Automake generated Makefile or not.
> -    # We used to match only the files named 'Makefile.in', but
> -    # some people rename them; so instead we look at the file content.
> -    # Grep'ing the first line is not enough: some people post-process
> -    # each Makefile.in and add a new line on top of each file to say so.
> -    # Grep'ing the whole file is not good either: AIX grep has a line
> +    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
> +    # Check whether this is an Automake generated Makefile which includes
> +    # dependency-tracking related rules and includes.
> +    # Grep'ing the whole file directly is not great: AIX grep has a line
>      # limit of 2048, but all sed's we know have understand at least 4000.
> -    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
> -      dirpart=`AS_DIRNAME("$mf")`
> -    else
> -      continue
> -    fi
> -    # Extract the definition of DEPDIR, am__include, and am__quote
> -    # from the Makefile without running 'make'.
> -    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
> -    test -z "$DEPDIR" && continue
> -    am__include=`sed -n 's/^am__include = //p' < "$mf"`
> -    test -z "$am__include" && continue
> -    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
> -    # Find all dependency output files, they are included files with
> -    # $(DEPDIR) in their names.  We invoke sed twice because it is the
> -    # simplest approach to changing $(DEPDIR) to its actual value in the
> -    # expansion.
> -    for file in `sed -n "
> -      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
> -	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
> -      # Make sure the directory exists.
> -      test -f "$dirpart/$file" && continue
> -      fdir=`AS_DIRNAME(["$file"])`
> -      AS_MKDIR_P([$dirpart/$fdir])
> -      # echo "creating $dirpart/$file"
> -      echo '# dummy' > "$dirpart/$file"
> -    done
> +    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
> +      || continue
> +    am_dirpart=`AS_DIRNAME(["$am_mf"])`
> +    am_filepart=`AS_BASENAME(["$am_mf"])`
> +    AM_RUN_LOG([cd "$am_dirpart" \
> +      && sed -e '/# am--include-marker/d' "$am_filepart" \
> +        | $MAKE -f - am--depfiles]) || am_rc=$?
>    done
> +  if test $am_rc -ne 0; then
> +    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
> +    for automatic dependency tracking.  Try re-running configure with the
> +    '--disable-dependency-tracking' option to at least be able to build
> +    the package (albeit without support for automatic dependency tracking).])
> +  fi
> +  AS_UNSET([am_dirpart])
> +  AS_UNSET([am_filepart])
> +  AS_UNSET([am_mf])
> +  AS_UNSET([am_rc])
> +  rm -f conftest-deps.mk
>  }
>  ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
>  
> @@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
>  # -----------------------------
>  # This macro should only be invoked once -- use via AC_REQUIRE.
>  #
> -# This code is only required when automatic dependency tracking
> -# is enabled.  FIXME.  This creates each '.P' file that we will
> -# need in order to bootstrap the dependency handling code.
> +# This code is only required when automatic dependency tracking is enabled.
> +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
> +# order to bootstrap the dependency handling code.
>  AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
>  [AC_CONFIG_COMMANDS([depfiles],
>       [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
> -     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
> -])
> +     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
>  
>  # Do all the work for Automake.                             -*- Autoconf -*-
>  
> -# Copyright (C) 1996-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
>  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
>  # For better backward compatibility.  To be removed once Automake 1.9.x
>  # dies out for good.  For more background, see:
> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
>  AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
>  # We need awk for the "check" target (and possibly the TAP driver).  The
>  # system "awk" is bad on some platforms.
> @@ -563,7 +553,7 @@ END
>  Aborting the configuration process, to ensure you take notice of the issue.
>  
>  You can download and install GNU coreutils to get an 'rm' implementation
> -that behaves properly: <http://www.gnu.org/software/coreutils/>.
> +that behaves properly: <https://www.gnu.org/software/coreutils/>.
>  
>  If you want to complete the configuration process using your problematic
>  'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
> @@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
>  done
>  echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
>  fi
>  AC_SUBST([install_sh])])
>  
> -# Copyright (C) 2003-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2003-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -648,7 +638,7 @@ AC_SUBST([am__leading_dot])])
>  # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
>  # From Jim Meyering
>  
> -# Copyright (C) 1996-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -683,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
>  
>  # Check to see how 'make' treats includes.	            -*- Autoconf -*-
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -691,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
>  
>  # AM_MAKE_INCLUDE()
>  # -----------------
> -# Check to see how make treats includes.
> +# Check whether make has an 'include' directive that can support all
> +# the idioms we need for our automatic dependency tracking code.
>  AC_DEFUN([AM_MAKE_INCLUDE],
> -[am_make=${MAKE-make}
> -cat > confinc << 'END'
> +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
> +cat > confinc.mk << 'END'
>  am__doit:
> -	@echo this is the am__doit target
> +	@echo this is the am__doit target >confinc.out
>  .PHONY: am__doit
>  END
> -# If we don't find an include directive, just comment out the code.
> -AC_MSG_CHECKING([for style of include used by $am_make])
>  am__include="#"
>  am__quote=
> -_am_result=none
> -# First try GNU make style include.
> -echo "include confinc" > confmf
> -# Ignore all kinds of additional output from 'make'.
> -case `$am_make -s -f confmf 2> /dev/null` in #(
> -*the\ am__doit\ target*)
> -  am__include=include
> -  am__quote=
> -  _am_result=GNU
> -  ;;
> -esac
> -# Now try BSD make style include.
> -if test "$am__include" = "#"; then
> -   echo '.include "confinc"' > confmf
> -   case `$am_make -s -f confmf 2> /dev/null` in #(
> -   *the\ am__doit\ target*)
> -     am__include=.include
> -     am__quote="\""
> -     _am_result=BSD
> -     ;;
> -   esac
> -fi
> -AC_SUBST([am__include])
> -AC_SUBST([am__quote])
> -AC_MSG_RESULT([$_am_result])
> -rm -f confinc confmf
> -])
> +# BSD make does it like this.
> +echo '.include "confinc.mk" # ignored' > confmf.BSD
> +# Other make implementations (GNU, Solaris 10, AIX) do it like this.
> +echo 'include confinc.mk # ignored' > confmf.GNU
> +_am_result=no
> +for s in GNU BSD; do
> +  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
> +  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
> +      ['0:this is the am__doit target'],
> +      [AS_CASE([$s],
> +          [BSD], [am__include='.include' am__quote='"'],
> +          [am__include='include' am__quote=''])])
> +  if test "$am__include" != "#"; then
> +    _am_result="yes ($s style)"
> +    break
> +  fi
> +done
> +rm -f confinc.* confmf.*
> +AC_MSG_RESULT([${_am_result}])
> +AC_SUBST([am__include])])
> +AC_SUBST([am__quote])])
>  
>  # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
>  
> -# Copyright (C) 1997-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1997-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -772,7 +755,7 @@ fi
>  
>  # Helper functions for option handling.                     -*- Autoconf -*-
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -801,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
>  AC_DEFUN([_AM_IF_OPTION],
>  [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
>  
> -# Copyright (C) 1999-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1999-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -848,7 +831,7 @@ AC_LANG_POP([C])])
>  # For backward compatibility.
>  AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -867,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG],
>  
>  # Check to make sure that the build environment is sane.    -*- Autoconf -*-
>  
> -# Copyright (C) 1996-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -948,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE(
>  rm -f conftest.file
>  ])
>  
> -# Copyright (C) 2009-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2009-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -1008,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl
>  _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
>  ])
>  
> -# Copyright (C) 2001-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2001-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -1036,7 +1019,7 @@ fi
>  INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
>  AC_SUBST([INSTALL_STRIP_PROGRAM])])
>  
> -# Copyright (C) 2006-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2006-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -1055,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
>  
>  # Check how to create a tarball.                            -*- Autoconf -*-
>  
> -# Copyright (C) 2004-2017 Free Software Foundation, Inc.
> +# Copyright (C) 2004-2018 Free Software Foundation, Inc.
>  #
>  # This file is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> diff --git a/spl/cmd/Makefile.in b/spl/cmd/Makefile.in
> index 9a704a20830b..11d981fe2f15 100644
> --- a/spl/cmd/Makefile.in
> +++ b/spl/cmd/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -160,7 +160,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	distdir
> +	distdir distdir-am
>  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
> @@ -398,8 +398,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -516,7 +516,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/cmd/splat/Makefile.in b/spl/cmd/splat/Makefile.in
> index beb996456866..5f8063ad5787 100644
> --- a/spl/cmd/splat/Makefile.in
> +++ b/spl/cmd/splat/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -161,7 +161,8 @@ am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
>  am__v_at_0 = @
>  am__v_at_1 = 
>  depcomp = $(SHELL) $(top_srcdir)/config/depcomp
> -am__depfiles_maybe = depfiles
> +am__maybe_remake_depfiles = depfiles
> +am__depfiles_remade = ./$(DEPDIR)/splat.Po
>  am__mv = mv -f
>  COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
>  	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
> @@ -409,8 +410,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  $(top_srcdir)/config/Rules.am $(am__empty):
>  
> @@ -482,7 +483,13 @@ mostlyclean-compile:
>  distclean-compile:
>  	-rm -f *.tab.c
>  
> - at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/splat.Po at am__quote@
> + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/splat.Po at am__quote@ # am--include-marker
> +
> +$(am__depfiles_remade):
> +	@$(MKDIR_P) $(@D)
> +	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
> +
> +am--depfiles: $(am__depfiles_remade)
>  
>  .c.o:
>  @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
> @@ -563,7 +570,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> @@ -636,7 +646,7 @@ clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
>  	mostlyclean-am
>  
>  distclean: distclean-am
> -	-rm -rf ./$(DEPDIR)
> +		-rm -f ./$(DEPDIR)/splat.Po
>  	-rm -f Makefile
>  distclean-am: clean-am distclean-compile distclean-generic \
>  	distclean-tags
> @@ -682,7 +692,7 @@ install-ps-am:
>  installcheck-am:
>  
>  maintainer-clean: maintainer-clean-am
> -	-rm -rf ./$(DEPDIR)
> +		-rm -f ./$(DEPDIR)/splat.Po
>  	-rm -f Makefile
>  maintainer-clean-am: distclean-am maintainer-clean-generic
>  
> @@ -703,9 +713,9 @@ uninstall-am: uninstall-sbinPROGRAMS
>  
>  .MAKE: install-am install-strip
>  
> -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
> -	clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
> -	distclean distclean-compile distclean-generic \
> +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
> +	clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \
> +	ctags ctags-am distclean distclean-compile 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 \
> diff --git a/spl/cmd/splslab/Makefile.in b/spl/cmd/splslab/Makefile.in
> index d115c72332ed..e0a485dfda65 100644
> --- a/spl/cmd/splslab/Makefile.in
> +++ b/spl/cmd/splslab/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -369,8 +369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -429,7 +429,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/config/compile b/spl/config/compile
> index a85b723c7e67..99e50524b3ba 100755
> --- a/spl/config/compile
> +++ b/spl/config/compile
> @@ -1,9 +1,9 @@
>  #! /bin/sh
>  # Wrapper for compilers which do not understand '-c -o'.
>  
> -scriptversion=2012-10-14.11; # UTC
> +scriptversion=2018-03-07.03; # UTC
>  
> -# Copyright (C) 1999-2014 Free Software Foundation, Inc.
> +# Copyright (C) 1999-2018 Free Software Foundation, Inc.
>  # Written by Tom Tromey <tromey at cygnus.com>.
>  #
>  # This program is free software; you can redistribute it and/or modify
> @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
>  # GNU General Public License for more details.
>  #
>  # You should have received a copy of the GNU General Public License
> -# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +# along with this program.  If not, see <https://www.gnu.org/licenses/>.
>  
>  # As a special exception to the GNU General Public License, if you
>  # distribute this file as part of a program that contains a
> @@ -255,7 +255,8 @@ EOF
>      echo "compile $scriptversion"
>      exit $?
>      ;;
> -  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
> +  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
> +  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
>      func_cl_wrapper "$@"      # Doesn't return...
>      ;;
>  esac
> @@ -339,9 +340,9 @@ exit $ret
>  # Local Variables:
>  # mode: shell-script
>  # sh-indentation: 2
> -# eval: (add-hook 'write-file-hooks 'time-stamp)
> +# eval: (add-hook 'before-save-hook 'time-stamp)
>  # time-stamp-start: "scriptversion="
>  # time-stamp-format: "%:y-%02m-%02d.%02H"
> -# time-stamp-time-zone: "UTC"
> +# time-stamp-time-zone: "UTC0"
>  # time-stamp-end: "; # UTC"
>  # End:
> diff --git a/spl/config/depcomp b/spl/config/depcomp
> index b39f98f9ae9f..65cbf7093a1e 100755
> --- a/spl/config/depcomp
> +++ b/spl/config/depcomp
> @@ -1,9 +1,9 @@
>  #! /bin/sh
>  # depcomp - compile a program generating dependencies as side-effects
>  
> -scriptversion=2016-01-11.22; # UTC
> +scriptversion=2018-03-07.03; # UTC
>  
> -# Copyright (C) 1999-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1999-2018 Free Software Foundation, Inc.
>  
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
>  # GNU General Public License for more details.
>  
>  # You should have received a copy of the GNU General Public License
> -# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +# along with this program.  If not, see <https://www.gnu.org/licenses/>.
>  
>  # As a special exception to the GNU General Public License, if you
>  # distribute this file as part of a program that contains a
> @@ -783,7 +783,7 @@ exit 0
>  # Local Variables:
>  # mode: shell-script
>  # sh-indentation: 2
> -# eval: (add-hook 'write-file-hooks 'time-stamp)
> +# eval: (add-hook 'before-save-hook 'time-stamp)
>  # time-stamp-start: "scriptversion="
>  # time-stamp-format: "%:y-%02m-%02d.%02H"
>  # time-stamp-time-zone: "UTC0"
> diff --git a/spl/config/install-sh b/spl/config/install-sh
> index 59990a104926..8175c640fe62 100755
> --- a/spl/config/install-sh
> +++ b/spl/config/install-sh
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  # install - install a program, script, or datafile
>  
> -scriptversion=2014-09-12.12; # UTC
> +scriptversion=2018-03-11.20; # UTC
>  
>  # This originates from X11R5 (mit/util/scripts/install.sh), which was
>  # later released in X11R6 (xc/config/util/install.sh) with the
> @@ -271,15 +271,18 @@ do
>      fi
>      dst=$dst_arg
>  
> -    # If destination is a directory, append the input filename; won't work
> -    # if double slashes aren't ignored.
> +    # If destination is a directory, append the input filename.
>      if test -d "$dst"; then
>        if test "$is_target_a_directory" = never; then
>          echo "$0: $dst_arg: Is a directory" >&2
>          exit 1
>        fi
>        dstdir=$dst
> -      dst=$dstdir/`basename "$src"`
> +      dstbase=`basename "$src"`
> +      case $dst in
> +	*/) dst=$dst$dstbase;;
> +	*)  dst=$dst/$dstbase;;
> +      esac
>        dstdir_status=0
>      else
>        dstdir=`dirname "$dst"`
> @@ -288,6 +291,11 @@ do
>      fi
>    fi
>  
> +  case $dstdir in
> +    */) dstdirslash=$dstdir;;
> +    *)  dstdirslash=$dstdir/;;
> +  esac
> +
>    obsolete_mkdir_used=false
>  
>    if test $dstdir_status != 0; then
> @@ -324,14 +332,16 @@ do
>              # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
>              ;;
>            *)
> -            # $RANDOM is not portable (e.g. dash);  use it when possible to
> -            # lower collision chance
> +            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
> +            # here however when possible just to lower collision chance.
>              tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
> +
>              trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
>  
> -            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
> -            # create the $tmpdir first (and fail if unsuccessful) to make sure
> -            # that nobody tries to guess the $tmpdir name.
> +            # Because "mkdir -p" follows existing symlinks and we likely work
> +            # directly in world-writeable /tmp, make sure that the '$tmpdir'
> +            # directory is successfully created first before we actually test
> +            # 'mkdir -p' feature.
>              if (umask $mkdir_umask &&
>                  $mkdirprog $mkdir_mode "$tmpdir" &&
>                  exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
> @@ -434,8 +444,8 @@ do
>    else
>  
>      # Make a couple of temp file names in the proper directory.
> -    dsttmp=$dstdir/_inst.$$_
> -    rmtmp=$dstdir/_rm.$$_
> +    dsttmp=${dstdirslash}_inst.$$_
> +    rmtmp=${dstdirslash}_rm.$$_
>  
>      # Trap to clean up those temp files at exit.
>      trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
> @@ -500,9 +510,9 @@ do
>  done
>  
>  # Local variables:
> -# eval: (add-hook 'write-file-hooks 'time-stamp)
> +# eval: (add-hook 'before-save-hook 'time-stamp)
>  # time-stamp-start: "scriptversion="
>  # time-stamp-format: "%:y-%02m-%02d.%02H"
> -# time-stamp-time-zone: "UTC"
> +# time-stamp-time-zone: "UTC0"
>  # time-stamp-end: "; # UTC"
>  # End:
> diff --git a/spl/config/libtool.m4 b/spl/config/libtool.m4
> index ee80844b619f..e67ed69978a1 100644
> --- a/spl/config/libtool.m4
> +++ b/spl/config/libtool.m4
> @@ -6438,7 +6438,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>        # Commands to make compiler produce verbose output that lists
>        # what "hidden" libraries, object files and flags are used when
>        # linking a shared library.
> -      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
> +      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
>  
>      else
>        GXX=no
> @@ -6813,7 +6813,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>              # explicitly linking system object files so we need to strip them
>              # from the output so that they don't get included in the library
>              # dependencies.
> -            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
> +            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
>              ;;
>            *)
>              if test yes = "$GXX"; then
> @@ -6878,7 +6878,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>  	    # explicitly linking system object files so we need to strip them
>  	    # from the output so that they don't get included in the library
>  	    # dependencies.
> -	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
> +	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
>  	    ;;
>            *)
>  	    if test yes = "$GXX"; then
> @@ -7217,7 +7217,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>  	      # Commands to make compiler produce verbose output that lists
>  	      # what "hidden" libraries, object files and flags are used when
>  	      # linking a shared library.
> -	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
> +	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
>  
>  	    else
>  	      # FIXME: insert proper C++ library support
> @@ -7301,7 +7301,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>  	        # Commands to make compiler produce verbose output that lists
>  	        # what "hidden" libraries, object files and flags are used when
>  	        # linking a shared library.
> -	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
> +	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
>  	      else
>  	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
>  	        # platform.
> @@ -7312,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; then
>  	        # Commands to make compiler produce verbose output that lists
>  	        # what "hidden" libraries, object files and flags are used when
>  	        # linking a shared library.
> -	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
> +	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
>  	      fi
>  
>  	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
> diff --git a/spl/config/ltmain.sh b/spl/config/ltmain.sh
> index e4eda6d697f5..d3230f7c343e 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.1"
> +VERSION="2.4.6 Debian-2.4.6-4"
>  package_revision=2.4.6
>  
>  
> @@ -2237,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.1
> +       version:        $progname $scriptversion Debian-2.4.6-4
>         automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
>         autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
>  
> diff --git a/spl/config/missing b/spl/config/missing
> index f62bbae306c7..625aeb11897a 100755
> --- a/spl/config/missing
> +++ b/spl/config/missing
> @@ -1,9 +1,9 @@
>  #! /bin/sh
>  # Common wrapper for a few potentially missing GNU programs.
>  
> -scriptversion=2013-10-28.13; # UTC
> +scriptversion=2018-03-07.03; # UTC
>  
> -# Copyright (C) 1996-2014 Free Software Foundation, Inc.
> +# Copyright (C) 1996-2018 Free Software Foundation, Inc.
>  # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
>  
>  # This program is free software; you can redistribute it and/or modify
> @@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
>  # GNU General Public License for more details.
>  
>  # You should have received a copy of the GNU General Public License
> -# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +# along with this program.  If not, see <https://www.gnu.org/licenses/>.
>  
>  # As a special exception to the GNU General Public License, if you
>  # distribute this file as part of a program that contains a
> @@ -101,9 +101,9 @@ else
>    exit $st
>  fi
>  
> -perl_URL=http://www.perl.org/
> -flex_URL=http://flex.sourceforge.net/
> -gnu_software_URL=http://www.gnu.org/software
> +perl_URL=https://www.perl.org/
> +flex_URL=https://github.com/westes/flex
> +gnu_software_URL=https://www.gnu.org/software
>  
>  program_details ()
>  {
> @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
>  exit $st
>  
>  # Local variables:
> -# eval: (add-hook 'write-file-hooks 'time-stamp)
> +# eval: (add-hook 'before-save-hook 'time-stamp)
>  # time-stamp-start: "scriptversion="
>  # time-stamp-format: "%:y-%02m-%02d.%02H"
> -# time-stamp-time-zone: "UTC"
> +# time-stamp-time-zone: "UTC0"
>  # time-stamp-end: "; # UTC"
>  # End:
> diff --git a/spl/config/spl-build.m4 b/spl/config/spl-build.m4
> index 112c3479dfa7..0dc5be81012a 100644
> --- a/spl/config/spl-build.m4
> +++ b/spl/config/spl-build.m4
> @@ -43,8 +43,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
>  	SPL_AC_2ARGS_VFS_GETATTR
>  	SPL_AC_USLEEP_RANGE
>  	SPL_AC_KMEM_CACHE_ALLOCFLAGS
> -	SPL_AC_WAIT_ON_BIT
>  	SPL_AC_KERNEL_INODE_TIMES
> +	SPL_AC_WAIT_ON_BIT
>  	SPL_AC_INODE_LOCK
>  	SPL_AC_GROUP_INFO_GID
>  	SPL_AC_KMEM_CACHE_CREATE_USERCOPY
> diff --git a/spl/configure b/spl/configure
> index c88402979735..2e6f1ee2c931 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.9.
> +# Generated by GNU Autoconf 2.69 for spl 0.7.11.
>  #
>  #
>  # 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.9'
> -PACKAGE_STRING='spl 0.7.9'
> +PACKAGE_VERSION='0.7.11'
> +PACKAGE_STRING='spl 0.7.11'
>  PACKAGE_BUGREPORT=''
>  PACKAGE_URL=''
>  
> @@ -703,7 +703,6 @@ am__nodep
>  AMDEPBACKSLASH
>  AMDEP_FALSE
>  AMDEP_TRUE
> -am__quote
>  am__include
>  DEPDIR
>  OBJEXT
> @@ -804,7 +803,8 @@ PACKAGE_VERSION
>  PACKAGE_TARNAME
>  PACKAGE_NAME
>  PATH_SEPARATOR
> -SHELL'
> +SHELL
> +am__quote'
>  ac_subst_files=''
>  ac_user_opts='
>  enable_option_checking
> @@ -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.9 to adapt to many kinds of systems.
> +\`configure' configures spl 0.7.11 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.9:";;
> +     short | recursive ) echo "Configuration of spl 0.7.11:";;
>     esac
>    cat <<\_ACEOF
>  
> @@ -1586,7 +1586,7 @@ fi
>  test -n "$ac_init_help" && exit $ac_status
>  if $ac_init_version; then
>    cat <<\_ACEOF
> -spl configure 0.7.9
> +spl configure 0.7.11
>  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.9, which was
> +It was created by spl $as_me 0.7.11, which was
>  generated by GNU Autoconf 2.69.  Invocation command line was
>  
>    $ $0 $@
> @@ -2600,7 +2600,7 @@ else
>  fi
>  AM_BACKSLASH='\'
>  
> -am__api_version='1.15'
> +am__api_version='1.16'
>  
>  # Find a good install program.  We prefer a C program (faster),
>  # so one script is as good as another.  But avoid the broken or
> @@ -3005,7 +3005,7 @@ fi
>  
>  # Define the identity of the package.
>   PACKAGE='spl'
> - VERSION='0.7.9'
> + VERSION='0.7.11'
>  
>  
>  cat >>confdefs.h <<_ACEOF
> @@ -3035,8 +3035,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
>  
>  # For better backward compatibility.  To be removed once Automake 1.9.x
>  # dies out for good.  For more background, see:
> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
>  mkdir_p='$(MKDIR_P)'
>  
>  # We need awk for the "check" target (and possibly the TAP driver).  The
> @@ -3087,7 +3087,7 @@ END
>  Aborting the configuration process, to ensure you take notice of the issue.
>  
>  You can download and install GNU coreutils to get an 'rm' implementation
> -that behaves properly: <http://www.gnu.org/software/coreutils/>.
> +that behaves properly: <https://www.gnu.org/software/coreutils/>.
>  
>  If you want to complete the configuration process using your problematic
>  'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
> @@ -3953,45 +3953,45 @@ DEPDIR="${am__leading_dot}deps"
>  
>  ac_config_commands="$ac_config_commands depfiles"
>  
> -
> -am_make=${MAKE-make}
> -cat > confinc << 'END'
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
> +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
> +cat > confinc.mk << 'END'
>  am__doit:
> -	@echo this is the am__doit target
> +	@echo this is the am__doit target >confinc.out
>  .PHONY: am__doit
>  END
> -# If we don't find an include directive, just comment out the code.
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
> -$as_echo_n "checking for style of include used by $am_make... " >&6; }
>  am__include="#"
>  am__quote=
> -_am_result=none
> -# First try GNU make style include.
> -echo "include confinc" > confmf
> -# Ignore all kinds of additional output from 'make'.
> -case `$am_make -s -f confmf 2> /dev/null` in #(
> -*the\ am__doit\ target*)
> -  am__include=include
> -  am__quote=
> -  _am_result=GNU
> -  ;;
> -esac
> -# Now try BSD make style include.
> -if test "$am__include" = "#"; then
> -   echo '.include "confinc"' > confmf
> -   case `$am_make -s -f confmf 2> /dev/null` in #(
> -   *the\ am__doit\ target*)
> -     am__include=.include
> -     am__quote="\""
> -     _am_result=BSD
> +# BSD make does it like this.
> +echo '.include "confinc.mk" # ignored' > confmf.BSD
> +# Other make implementations (GNU, Solaris 10, AIX) do it like this.
> +echo 'include confinc.mk # ignored' > confmf.GNU
> +_am_result=no
> +for s in GNU BSD; do
> +  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
> +   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
> +   ac_status=$?
> +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
> +   (exit $ac_status); }
> +  case $?:`cat confinc.out 2>/dev/null` in #(
> +  '0:this is the am__doit target') :
> +    case $s in #(
> +  BSD) :
> +    am__include='.include' am__quote='"' ;; #(
> +  *) :
> +    am__include='include' am__quote='' ;;
> +esac ;; #(
> +  *) :
>       ;;
> -   esac
> -fi
> -
> -
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
> -$as_echo "$_am_result" >&6; }
> -rm -f confinc confmf
> +esac
> +  if test "$am__include" != "#"; then
> +    _am_result="yes ($s style)"
> +    break
> +  fi
> +done
> +rm -f confinc.* confmf.*
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
> +$as_echo "${_am_result}" >&6; }
>  
>  # Check whether --enable-dependency-tracking was given.
>  if test "${enable_dependency_tracking+set}" = set; then :
> @@ -14743,21 +14743,26 @@ fi
>  
>  
>  
> -	{ $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 inode->i_*time's are timespec64" >&5
> +$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> +	tmp_flags="$EXTRA_KCFLAGS"
> +	EXTRA_KCFLAGS="-Werror"
>  
>  
>  cat confdefs.h - <<_ACEOF >conftest.c
>  
>  
> -		#include <linux/wait.h>
> +		#include <linux/fs.h>
>  
>  int
>  main (void)
>  {
>  
> -		int (*action)(void *) = NULL;
> -		wait_on_bit(NULL, 0, action, 0);
> +		struct inode ip;
> +		struct timespec ts;
> +
> +		memset(&ip, 0, sizeof(ip));
> +		ts = ip.i_mtime;
>  
>    ;
>    return 0;
> @@ -14782,18 +14787,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 "yes" >&6; }
> -
> -$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 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_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_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> +
>  
>  
>  
> @@ -14801,28 +14806,24 @@ fi
>  	rm -Rf build
>  
>  
> +	EXTRA_KCFLAGS="$tmp_flags"
>  
>  
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode->i_*time's are timespec64" >&5
> -$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> -	tmp_flags="$EXTRA_KCFLAGS"
> -	EXTRA_KCFLAGS="-Werror"
> +	{ $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)
>  {
>  
> -		struct inode ip;
> -		struct timespec ts;
> -
> -		memset(&ip, 0, sizeof(ip));
> -		ts = ip.i_mtime;
> +		int (*action)(void *) = NULL;
> +		wait_on_bit(NULL, 0, action, 0);
>  
>    ;
>    return 0;
> @@ -14847,18 +14848,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: no" >&5
> -$as_echo "no" >&6; }
> +		{ $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
> +
>  
>  else
>    $as_echo "$as_me: failed program was:" >&5
>  sed 's/^/| /' conftest.$ac_ext >&5
>  
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> -
> -$as_echo "#define HAVE_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> -
> +		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
>  
>  
>  
> @@ -14866,7 +14867,6 @@ fi
>  	rm -Rf build
>  
>  
> -	EXTRA_KCFLAGS="$tmp_flags"
>  
>  
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_lock_shared() exists" >&5
> @@ -17855,21 +17855,26 @@ fi
>  
>  
>  
> -	{ $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 inode->i_*time's are timespec64" >&5
> +$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> +	tmp_flags="$EXTRA_KCFLAGS"
> +	EXTRA_KCFLAGS="-Werror"
>  
>  
>  cat confdefs.h - <<_ACEOF >conftest.c
>  
>  
> -		#include <linux/wait.h>
> +		#include <linux/fs.h>
>  
>  int
>  main (void)
>  {
>  
> -		int (*action)(void *) = NULL;
> -		wait_on_bit(NULL, 0, action, 0);
> +		struct inode ip;
> +		struct timespec ts;
> +
> +		memset(&ip, 0, sizeof(ip));
> +		ts = ip.i_mtime;
>  
>    ;
>    return 0;
> @@ -17894,18 +17899,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 "yes" >&6; }
> -
> -$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 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_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_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> +
>  
>  
>  
> @@ -17913,28 +17918,24 @@ fi
>  	rm -Rf build
>  
>  
> +	EXTRA_KCFLAGS="$tmp_flags"
>  
>  
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode->i_*time's are timespec64" >&5
> -$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> -	tmp_flags="$EXTRA_KCFLAGS"
> -	EXTRA_KCFLAGS="-Werror"
> +	{ $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)
>  {
>  
> -		struct inode ip;
> -		struct timespec ts;
> -
> -		memset(&ip, 0, sizeof(ip));
> -		ts = ip.i_mtime;
> +		int (*action)(void *) = NULL;
> +		wait_on_bit(NULL, 0, action, 0);
>  
>    ;
>    return 0;
> @@ -17959,18 +17960,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: no" >&5
> -$as_echo "no" >&6; }
> +		{ $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
> +
>  
>  else
>    $as_echo "$as_me: failed program was:" >&5
>  sed 's/^/| /' conftest.$ac_ext >&5
>  
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> -
> -$as_echo "#define HAVE_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> -
> +		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
>  
>  
>  
> @@ -17978,7 +17979,6 @@ fi
>  	rm -Rf build
>  
>  
> -	EXTRA_KCFLAGS="$tmp_flags"
>  
>  
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_lock_shared() exists" >&5
> @@ -19279,7 +19279,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.9, which was
> +This file was extended by spl $as_me 0.7.11, which was
>  generated by GNU Autoconf 2.69.  Invocation command line was
>  
>    CONFIG_FILES    = $CONFIG_FILES
> @@ -19345,7 +19345,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.9
> +spl config.status 0.7.11
>  configured by $0, generated by GNU Autoconf 2.69,
>    with options \\"\$ac_cs_config\\"
>  
> @@ -19464,7 +19464,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
>  #
>  # INIT-COMMANDS
>  #
> -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
> +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
>  
>  
>  # The HP-UX ksh and POSIX shell print the target directory to stdout
> @@ -20395,29 +20395,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
>    # Older Autoconf quotes --file arguments for eval, but not when files
>    # are listed without --file.  Let's play safe and only enable the eval
>    # if we detect the quoting.
> -  case $CONFIG_FILES in
> -  *\'*) eval set x "$CONFIG_FILES" ;;
> -  *)   set x $CONFIG_FILES ;;
> -  esac
> +  # TODO: see whether this extra hack can be removed once we start
> +  # requiring Autoconf 2.70 or later.
> +  case $CONFIG_FILES in #(
> +  *\'*) :
> +    eval set x "$CONFIG_FILES" ;; #(
> +  *) :
> +    set x $CONFIG_FILES ;; #(
> +  *) :
> +     ;;
> +esac
>    shift
> -  for mf
> +  # Used to flag and report bootstrapping failures.
> +  am_rc=0
> +  for am_mf
>    do
>      # Strip MF so we end up with the name of the file.
> -    mf=`echo "$mf" | sed -e 's/:.*$//'`
> -    # Check whether this is an Automake generated Makefile or not.
> -    # We used to match only the files named 'Makefile.in', but
> -    # some people rename them; so instead we look at the file content.
> -    # Grep'ing the first line is not enough: some people post-process
> -    # each Makefile.in and add a new line on top of each file to say so.
> -    # Grep'ing the whole file is not good either: AIX grep has a line
> +    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
> +    # Check whether this is an Automake generated Makefile which includes
> +    # dependency-tracking related rules and includes.
> +    # Grep'ing the whole file directly is not great: AIX grep has a line
>      # limit of 2048, but all sed's we know have understand at least 4000.
> -    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
> -      dirpart=`$as_dirname -- "$mf" ||
> -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
> -	 X"$mf" : 'X\(//\)[^/]' \| \
> -	 X"$mf" : 'X\(//\)$' \| \
> -	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
> -$as_echo X"$mf" |
> +    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
> +      || continue
> +    am_dirpart=`$as_dirname -- "$am_mf" ||
> +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
> +	 X"$am_mf" : 'X\(//\)[^/]' \| \
> +	 X"$am_mf" : 'X\(//\)$' \| \
> +	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
> +$as_echo X"$am_mf" |
>      sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
>  	    s//\1/
>  	    q
> @@ -20435,53 +20441,48 @@ $as_echo X"$mf" |
>  	    q
>  	  }
>  	  s/.*/./; q'`
> -    else
> -      continue
> -    fi
> -    # Extract the definition of DEPDIR, am__include, and am__quote
> -    # from the Makefile without running 'make'.
> -    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
> -    test -z "$DEPDIR" && continue
> -    am__include=`sed -n 's/^am__include = //p' < "$mf"`
> -    test -z "$am__include" && continue
> -    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
> -    # Find all dependency output files, they are included files with
> -    # $(DEPDIR) in their names.  We invoke sed twice because it is the
> -    # simplest approach to changing $(DEPDIR) to its actual value in the
> -    # expansion.
> -    for file in `sed -n "
> -      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
> -	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
> -      # Make sure the directory exists.
> -      test -f "$dirpart/$file" && continue
> -      fdir=`$as_dirname -- "$file" ||
> -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
> -	 X"$file" : 'X\(//\)[^/]' \| \
> -	 X"$file" : 'X\(//\)$' \| \
> -	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
> -$as_echo X"$file" |
> -    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
> -	    s//\1/
> -	    q
> -	  }
> -	  /^X\(\/\/\)[^/].*/{
> +    am_filepart=`$as_basename -- "$am_mf" ||
> +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
> +	 X"$am_mf" : 'X\(//\)$' \| \
> +	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
> +$as_echo X/"$am_mf" |
> +    sed '/^.*\/\([^/][^/]*\)\/*$/{
>  	    s//\1/
>  	    q
>  	  }
> -	  /^X\(\/\/\)$/{
> +	  /^X\/\(\/\/\)$/{
>  	    s//\1/
>  	    q
>  	  }
> -	  /^X\(\/\).*/{
> +	  /^X\/\(\/\).*/{
>  	    s//\1/
>  	    q
>  	  }
>  	  s/.*/./; q'`
> -      as_dir=$dirpart/$fdir; as_fn_mkdir_p
> -      # echo "creating $dirpart/$file"
> -      echo '# dummy' > "$dirpart/$file"
> -    done
> +    { echo "$as_me:$LINENO: cd "$am_dirpart" \
> +      && sed -e '/# am--include-marker/d' "$am_filepart" \
> +        | $MAKE -f - am--depfiles" >&5
> +   (cd "$am_dirpart" \
> +      && sed -e '/# am--include-marker/d' "$am_filepart" \
> +        | $MAKE -f - am--depfiles) >&5 2>&5
> +   ac_status=$?
> +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
> +   (exit $ac_status); } || am_rc=$?
>    done
> +  if test $am_rc -ne 0; 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 $? "Something went wrong bootstrapping makefile fragments
> +    for automatic dependency tracking.  Try re-running configure with the
> +    '--disable-dependency-tracking' option to at least be able to build
> +    the package (albeit without support for automatic dependency tracking).
> +See \`config.log' for more details" "$LINENO" 5; }
> +  fi
> +  { am_dirpart=; unset am_dirpart;}
> +  { am_filepart=; unset am_filepart;}
> +  { am_mf=; unset am_mf;}
> +  { am_rc=; unset am_rc;}
> +  rm -f conftest-deps.mk
>  }
>   ;;
>      "libtool":C)
> diff --git a/spl/copy-builtin b/spl/copy-builtin
> index 34c482bab697..b8e3a08de8ee 100755
> --- a/spl/copy-builtin
> +++ b/spl/copy-builtin
> @@ -88,32 +88,7 @@ EOF
>  	done
>  } > "$KERNEL_DIR/spl/Kbuild"
>  
> -add_after()
> -{
> -	local FILE="$1"
> -	local MARKER="$2"
> -	local NEW="$3"
> -	local LINE
> -
> -	while IFS='' read -r LINE
> -	do
> -		echo "$LINE"
> -
> -		if [ -n "$MARKER" -a "$LINE" = "$MARKER" ]
> -		then
> -			echo "$NEW"
> -			MARKER=''
> -			if IFS='' read -r LINE
> -			then
> -				[ "$LINE" != "$NEW" ] && echo "$LINE"
> -			fi
> -		fi
> -	done < "$FILE" > "$FILE.new"
> -
> -	mv "$FILE.new" "$FILE"
> -}
> -
> -add_after "$KERNEL_DIR/Kconfig" 'source "arch/$SRCARCH/Kconfig"' 'source "spl/Kconfig"'
> +echo 'source "spl/Kconfig"' >>"$KERNEL_DIR/Kconfig"
>  # We must take care to build SPL before ZFS, otherwise the symbols required
>  # to link ZFS will not be available.
>  sed -i 's~mm/ fs/~mm/ spl/ fs/~' "$KERNEL_DIR/Makefile"
> diff --git a/spl/dkms.conf b/spl/dkms.conf
> index 88a2a273948f..62df11e83df6 100644
> --- a/spl/dkms.conf
> +++ b/spl/dkms.conf
> @@ -1,6 +1,6 @@
>  AUTOINSTALL="yes"
>  PACKAGE_NAME="spl"
> -PACKAGE_VERSION="0.7.9"
> +PACKAGE_VERSION="0.7.11"
>  PRE_BUILD="configure
>    --prefix=/usr
>    --with-config=kernel
> diff --git a/spl/include/Makefile.in b/spl/include/Makefile.in
> index 8de2b98900e4..6fbfdcf66de2 100644
> --- a/spl/include/Makefile.in
> +++ b/spl/include/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -194,7 +194,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	distdir
> +	distdir distdir-am
>  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
> @@ -443,8 +443,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -582,7 +582,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/fs/Makefile.in b/spl/include/fs/Makefile.in
> index be87e5eb9dd7..f648f9ff8b7e 100644
> --- a/spl/include/fs/Makefile.in
> +++ b/spl/include/fs/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -395,8 +395,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -487,7 +487,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/linux/Makefile.in b/spl/include/linux/Makefile.in
> index 41a72933708c..1859450c83ae 100644
> --- a/spl/include/linux/Makefile.in
> +++ b/spl/include/linux/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -415,8 +415,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -507,7 +507,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/rpc/Makefile.in b/spl/include/rpc/Makefile.in
> index 4b4be5dd45d5..a3d3aa4b7aff 100644
> --- a/spl/include/rpc/Makefile.in
> +++ b/spl/include/rpc/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -397,8 +397,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -489,7 +489,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/sharefs/Makefile.in b/spl/include/sharefs/Makefile.in
> index 7f767d861a97..9b36dc6afad3 100644
> --- a/spl/include/sharefs/Makefile.in
> +++ b/spl/include/sharefs/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -395,8 +395,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -487,7 +487,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/sys/Makefile.in b/spl/include/sys/Makefile.in
> index 32f5d91a9926..9186785050c3 100644
> --- a/spl/include/sys/Makefile.in
> +++ b/spl/include/sys/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -289,7 +289,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	distdir
> +	distdir distdir-am
>  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
> @@ -632,8 +632,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -771,7 +771,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/sys/fm/Makefile.in b/spl/include/sys/fm/Makefile.in
> index e88b19b9f6bb..d090f77ca1b6 100644
> --- a/spl/include/sys/fm/Makefile.in
> +++ b/spl/include/sys/fm/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -397,8 +397,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -489,7 +489,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/sys/fs/Makefile.in b/spl/include/sys/fs/Makefile.in
> index dc759ac42454..28f89d092b0d 100644
> --- a/spl/include/sys/fs/Makefile.in
> +++ b/spl/include/sys/fs/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -395,8 +395,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -487,7 +487,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/sys/isa_defs.h b/spl/include/sys/isa_defs.h
> index 55597828054b..13dcb357c29c 100644
> --- a/spl/include/sys/isa_defs.h
> +++ b/spl/include/sys/isa_defs.h
> @@ -210,6 +210,14 @@
>  
>  #include <sys/byteorder.h>
>  
> +/*
> + * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS will be defined by the Linux
> + * kernel for architectures which support efficient unaligned access.
> + */
> +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
> +#define        HAVE_EFFICIENT_UNALIGNED_ACCESS
> +#endif
> +
>  #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
>  #define	_LITTLE_ENDIAN __LITTLE_ENDIAN
>  #endif
> diff --git a/spl/include/sys/kstat.h b/spl/include/sys/kstat.h
> index 2018019965e4..b8aa7ed63ca8 100644
> --- a/spl/include/sys/kstat.h
> +++ b/spl/include/sys/kstat.h
> @@ -72,7 +72,7 @@
>  #define	KSTAT_FLAG_UNSUPPORTED	\
>  	(KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
>  	KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
> -
> +#define	KSTAT_FLAG_NO_HEADERS	0x80
>  
>  #define	KS_MAGIC		0x9d9d9d9d
>  
> diff --git a/spl/include/sys/rwlock.h b/spl/include/sys/rwlock.h
> index 325dfc499c98..2699229684ad 100644
> --- a/spl/include/sys/rwlock.h
> +++ b/spl/include/sys/rwlock.h
> @@ -135,7 +135,7 @@ RW_LOCK_HELD(krwlock_t *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
> @@ -151,10 +151,10 @@ RW_LOCK_HELD(krwlock_t *rwp)
>  	spl_rw_set_type(rwp, type);					\
>  })
>  
> -#define	rw_destroy(rwp)							\
> -({									\
> -	VERIFY(!RW_LOCK_HELD(rwp));					\
> -})
> +/*
> + * The Linux rwsem implementation does not require a matching destroy.
> + */
> +#define	rw_destroy(rwp)		((void) 0)
>  
>  #define	rw_tryenter(rwp, rw)						\
>  ({									\
> diff --git a/spl/include/sys/time.h b/spl/include/sys/time.h
> index 1777246a2db0..59557afd01de 100644
> --- a/spl/include/sys/time.h
> +++ b/spl/include/sys/time.h
> @@ -52,11 +52,11 @@
>  #define	NSEC2SEC(n)	((n) / (NANOSEC / SEC))
>  #define	SEC2NSEC(m)	((hrtime_t)(m) * (NANOSEC / SEC))
>  
> -static const int hz = HZ;
> -
>  typedef longlong_t		hrtime_t;
>  typedef struct timespec		timespec_t;
>  
> +static const int hz = HZ;
> +
>  #define	TIMESPEC_OVERFLOW(ts)		\
>  	((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)
>  
> @@ -68,7 +68,7 @@ typedef struct timespec		inode_timespec_t;
>  
>  static inline void
>  gethrestime(inode_timespec_t *ts)
> -{
> + {
>  #if defined(HAVE_INODE_TIMESPEC64_TIMES)
>  	*ts = current_kernel_time64();
>  #else
> diff --git a/spl/include/util/Makefile.in b/spl/include/util/Makefile.in
> index 28d81c3ac3bd..fca47e3c25c7 100644
> --- a/spl/include/util/Makefile.in
> +++ b/spl/include/util/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -397,8 +397,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -489,7 +489,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/include/vm/Makefile.in b/spl/include/vm/Makefile.in
> index 7dcba440f456..a4e47d726d58 100644
> --- a/spl/include/vm/Makefile.in
> +++ b/spl/include/vm/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -399,8 +399,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -491,7 +491,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/lib/Makefile.in b/spl/lib/Makefile.in
> index ea21eb1b699c..03fc4c690ffa 100644
> --- a/spl/lib/Makefile.in
> +++ b/spl/lib/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -156,7 +156,8 @@ am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
>  am__v_at_0 = @
>  am__v_at_1 = 
>  depcomp = $(SHELL) $(top_srcdir)/config/depcomp
> -am__depfiles_maybe = depfiles
> +am__maybe_remake_depfiles = depfiles
> +am__depfiles_remade = ./$(DEPDIR)/list.Plo
>  am__mv = mv -f
>  COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
>  	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
> @@ -403,8 +404,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  $(top_srcdir)/config/Rules.am $(am__empty):
>  
> @@ -437,7 +438,13 @@ mostlyclean-compile:
>  distclean-compile:
>  	-rm -f *.tab.c
>  
> - at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Plo at am__quote@
> + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Plo at am__quote@ # am--include-marker
> +
> +$(am__depfiles_remade):
> +	@$(MKDIR_P) $(@D)
> +	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
> +
> +am--depfiles: $(am__depfiles_remade)
>  
>  .c.o:
>  @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
> @@ -518,7 +525,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> @@ -588,7 +598,7 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
>  	mostlyclean-am
>  
>  distclean: distclean-am
> -	-rm -rf ./$(DEPDIR)
> +		-rm -f ./$(DEPDIR)/list.Plo
>  	-rm -f Makefile
>  distclean-am: clean-am distclean-compile distclean-generic \
>  	distclean-tags
> @@ -634,7 +644,7 @@ install-ps-am:
>  installcheck-am:
>  
>  maintainer-clean: maintainer-clean-am
> -	-rm -rf ./$(DEPDIR)
> +		-rm -f ./$(DEPDIR)/list.Plo
>  	-rm -f Makefile
>  maintainer-clean-am: distclean-am maintainer-clean-generic
>  
> @@ -655,16 +665,16 @@ uninstall-am:
>  
>  .MAKE: install-am install-strip
>  
> -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
> -	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
> -	ctags-am distclean distclean-compile 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-man install-pdf install-pdf-am \
> -	install-ps install-ps-am install-strip installcheck \
> -	installcheck-am installdirs maintainer-clean \
> +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
> +	clean-generic clean-libtool clean-noinstLTLIBRARIES \
> +	cscopelist-am ctags ctags-am distclean distclean-compile \
> +	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-man install-pdf \
> +	install-pdf-am install-ps install-ps-am install-strip \
> +	installcheck installcheck-am installdirs maintainer-clean \
>  	maintainer-clean-generic mostlyclean mostlyclean-compile \
>  	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
>  	tags tags-am uninstall uninstall-am
> diff --git a/spl/man/Makefile.in b/spl/man/Makefile.in
> index d97856c52664..3e36748693b8 100644
> --- a/spl/man/Makefile.in
> +++ b/spl/man/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -160,7 +160,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	distdir
> +	distdir distdir-am
>  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
> @@ -398,8 +398,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -516,7 +516,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/man/man1/Makefile.in b/spl/man/man1/Makefile.in
> index a927e44861af..fe9b0b33672a 100644
> --- a/spl/man/man1/Makefile.in
> +++ b/spl/man/man1/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -369,8 +369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -437,7 +437,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/man/man5/Makefile.in b/spl/man/man5/Makefile.in
> index df617f4e24ed..c307df5a23e3 100644
> --- a/spl/man/man5/Makefile.in
> +++ b/spl/man/man5/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -369,8 +369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -437,7 +437,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/module/spl/spl-kstat.c b/spl/module/spl/spl-kstat.c
> index 6970fcc8a84b..f9b9015e7254 100644
> --- a/spl/module/spl/spl-kstat.c
> +++ b/spl/module/spl/spl-kstat.c
> @@ -388,7 +388,8 @@ kstat_seq_start(struct seq_file *f, loff_t *pos)
>  
>  	ksp->ks_snaptime = gethrtime();
>  
> -	if (!n && kstat_seq_show_headers(f))
> +	if (!(ksp->ks_flags & KSTAT_FLAG_NO_HEADERS) && !n &&
> +	    kstat_seq_show_headers(f))
>  		return (NULL);
>  
>  	if (n >= ksp->ks_ndata)
> @@ -538,7 +539,6 @@ __kstat_create(const char *ks_module, int ks_instance, const char *ks_name,
>  	ASSERT(ks_module);
>  	ASSERT(ks_instance == 0);
>  	ASSERT(ks_name);
> -	ASSERT(!(ks_flags & KSTAT_FLAG_UNSUPPORTED));
>  
>  	if ((ks_type == KSTAT_TYPE_INTR) || (ks_type == KSTAT_TYPE_IO))
>  		ASSERT(ks_ndata == 1);
> diff --git a/spl/module/spl/spl-rwlock.c b/spl/module/spl/spl-rwlock.c
> index bf7ee2f837f1..ac28c91899b8 100644
> --- a/spl/module/spl/spl-rwlock.c
> +++ b/spl/module/spl/spl-rwlock.c
> @@ -34,16 +34,24 @@
>  static int
>  __rwsem_tryupgrade(struct rw_semaphore *rwsem)
>  {
> -
> +#if defined(READER_BIAS) && defined(WRITER_BIAS)
> +	/*
> +	 * After the 4.9.20-rt16 kernel the realtime patch series lifted the
> +	 * single reader restriction.  While this could be accommodated by
> +	 * adding additional compatibility code assume the rwsem can never
> +	 * be upgraded.  All caller must already cleanly handle this case.
> +	 */
> +	return (0);
> +#else
>  	ASSERT((struct task_struct *)
>  	    ((unsigned long)rwsem->lock.owner & ~RT_MUTEX_OWNER_MASKALL) ==
>  	    current);
>  
>  	/*
> -	 * Under the realtime patch series, rwsem is implemented as a
> -	 * single mutex held by readers and writers alike. However,
> -	 * this implementation would prevent a thread from taking a
> -	 * read lock twice, as the mutex would already be locked on
> +	 * Prior to 4.9.20-rt16 kernel the realtime patch series, rwsem is
> +	 * implemented as a single mutex held by readers and writers alike.
> +	 * However, this implementation would prevent a thread from taking
> +	 * a read lock twice, as the mutex would already be locked on
>  	 * the second attempt. Therefore the implementation allows a
>  	 * single thread to take a rwsem as read lock multiple times
>  	 * tracking that nesting as read_depth counter.
> @@ -59,6 +67,7 @@ __rwsem_tryupgrade(struct rw_semaphore *rwsem)
>  		return (1);
>  	}
>  	return (0);
> +#endif
>  }
>  #elif defined(CONFIG_RWSEM_GENERIC_SPINLOCK)
>  static int
> diff --git a/spl/module/spl/spl-vnode.c b/spl/module/spl/spl-vnode.c
> index 74ae8fe06f5c..cd0015f6b857 100644
> --- a/spl/module/spl/spl-vnode.c
> +++ b/spl/module/spl/spl-vnode.c
> @@ -670,6 +670,8 @@ vn_file_cache_destructor(void *buf, void *cdrarg)
>  int
>  spl_vn_init(void)
>  {
> +	spin_lock_init(&vn_file_lock);
> +
>  	vn_cache = kmem_cache_create("spl_vn_cache",
>  	    sizeof (struct vnode), 64, vn_cache_constructor,
>  	    vn_cache_destructor, NULL, NULL, NULL, 0);
> diff --git a/spl/rpm/Makefile.in b/spl/rpm/Makefile.in
> index 28422fbe556d..81dd02de1e39 100644
> --- a/spl/rpm/Makefile.in
> +++ b/spl/rpm/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -160,7 +160,7 @@ am__recursive_targets = \
>    $(RECURSIVE_CLEAN_TARGETS) \
>    $(am__extra_recursive_targets)
>  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
> -	distdir
> +	distdir distdir-am
>  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
> @@ -398,8 +398,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -516,7 +516,10 @@ cscopelist-am: $(am__tagged_files)
>  distclean-tags:
>  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/rpm/generic/Makefile.in b/spl/rpm/generic/Makefile.in
> index 6263c6d14a57..a6c719658c13 100644
> --- a/spl/rpm/generic/Makefile.in
> +++ b/spl/rpm/generic/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -339,8 +339,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -370,7 +370,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/rpm/generic/spl-kmod.spec.in b/spl/rpm/generic/spl-kmod.spec.in
> index 9cd22251642f..4cc1fafbe252 100644
> --- a/spl/rpm/generic/spl-kmod.spec.in
> +++ b/spl/rpm/generic/spl-kmod.spec.in
> @@ -167,6 +167,12 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
>  rm -rf $RPM_BUILD_ROOT
>  
>  %changelog
> +* Thu Sep 13 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.11-1
> +- Released 0.7.11-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.11
> +* Wed Sep 05 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.10-1
> +- Released 0.7.10-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.10
>  * Tue May 08 2018 Tony Hutter <hutter2 at 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
> diff --git a/spl/rpm/generic/spl.spec.in b/spl/rpm/generic/spl.spec.in
> index 39c6411a9d58..4b3a3d705974 100644
> --- a/spl/rpm/generic/spl.spec.in
> +++ b/spl/rpm/generic/spl.spec.in
> @@ -44,6 +44,12 @@ make install DESTDIR=%{?buildroot}
>  %{_mandir}/man5/*
>  
>  %changelog
> +* Thu Sep 13 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.11-1
> +- Released 0.7.11-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.11
> +* Wed Sep 05 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.10-1
> +- Released 0.7.10-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.10
>  * Tue May 08 2018 Tony Hutter <hutter2 at 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
> diff --git a/spl/rpm/redhat/Makefile.in b/spl/rpm/redhat/Makefile.in
> index 6e9fca1246ff..df214a2c1f2a 100644
> --- a/spl/rpm/redhat/Makefile.in
> +++ b/spl/rpm/redhat/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -339,8 +339,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -370,7 +370,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/spl/rpm/redhat/spl.spec.in b/spl/rpm/redhat/spl.spec.in
> index 39c6411a9d58..4b3a3d705974 100644
> --- a/spl/rpm/redhat/spl.spec.in
> +++ b/spl/rpm/redhat/spl.spec.in
> @@ -44,6 +44,12 @@ make install DESTDIR=%{?buildroot}
>  %{_mandir}/man5/*
>  
>  %changelog
> +* Thu Sep 13 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.11-1
> +- Released 0.7.11-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.11
> +* Wed Sep 05 2018 Tony Hutter <hutter2 at llnl.gov> - 0.7.10-1
> +- Released 0.7.10-1, detailed release notes are available at:
> +- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.10
>  * Tue May 08 2018 Tony Hutter <hutter2 at 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
> diff --git a/spl/scripts/Makefile.in b/spl/scripts/Makefile.in
> index d2fbec75dd7e..a8e622feeca5 100644
> --- a/spl/scripts/Makefile.in
> +++ b/spl/scripts/Makefile.in
> @@ -1,7 +1,7 @@
> -# Makefile.in generated by automake 1.15.1 from Makefile.am.
> +# Makefile.in generated by automake 1.16.1 from Makefile.am.
>  # @configure_input@
>  
> -# Copyright (C) 1994-2017 Free Software Foundation, Inc.
> +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
>  
>  # This Makefile.in is free software; the Free Software Foundation
>  # gives unlimited permission to copy and/or distribute it,
> @@ -338,8 +338,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
>  	  *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);; \
> +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
> +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
>  	esac;
>  
>  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
> @@ -363,7 +363,10 @@ ctags CTAGS:
>  cscope cscopelist:
>  
>  
> -distdir: $(DISTFILES)
> +distdir: $(BUILT_SOURCES)
> +	$(MAKE) $(AM_MAKEFLAGS) distdir-am
> +
> +distdir-am: $(DISTFILES)
>  	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
>  	list='$(DISTFILES)'; \
> diff --git a/zfs/META b/zfs/META
> index 1ee5be7528b8..04a7c41485df 100644
> --- a/zfs/META
> +++ b/zfs/META
> @@ -1,8 +1,8 @@
>  Meta:         1
>  Name:         zfs
>  Branch:       1.0
> -Version:      0.7.9
> -Release:      3ubuntu6
> +Version:      0.7.11
> +Release:      3ubuntu1
>  Release-Tags: relext
>  License:      CDDL
>  Author:       OpenZFS on Linux
> diff --git a/zfs/Makefile.in b/zfs/Makefile.in
> index 22328a583c0c..40a67b101568 100644
> --- a/zfs/Makefile.in
> +++ b/zfs/Makefile.in
> @@ -160,7 +160,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -374,8 +373,6 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
>    | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
>  distcleancheck_listfiles = find . -type f -print
>  ACLOCAL = @ACLOCAL@
> -ALIEN = @ALIEN@
> -ALIEN_VERSION = @ALIEN_VERSION@
>  AMTAR = @AMTAR@
>  AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
>  AR = @AR@
> @@ -401,19 +398,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -426,11 +414,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -462,7 +445,6 @@ 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@
> @@ -486,15 +468,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -502,13 +475,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/aclocal.m4 b/zfs/aclocal.m4
> index 8797384d27d7..0b2b76e99b94 100644
> --- a/zfs/aclocal.m4
> +++ b/zfs/aclocal.m4
> @@ -1250,7 +1250,6 @@ 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])
> -m4_include([config/kernel-inode-times.m4])
>  m4_include([config/kernel-insert-inode-locked.m4])
>  m4_include([config/kernel-invalidate-bdev-args.m4])
>  m4_include([config/kernel-is_owner_or_cap.m4])
> diff --git a/zfs/config/kernel-elevator-change.m4 b/zfs/config/kernel-elevator-change.m4
> index ace5aa82d3d3..eba252579bcc 100644
> --- a/zfs/config/kernel-elevator-change.m4
> +++ b/zfs/config/kernel-elevator-change.m4
> @@ -1,6 +1,6 @@
>  dnl #
> -dnl # 2.6.36 API change
> -dnl # Verify the elevator_change() symbol is available.
> +dnl # 2.6.36 API, exported elevator_change() symbol
> +dnl # 4.12 API, removed elevator_change() symbol
>  dnl #
>  AC_DEFUN([ZFS_AC_KERNEL_ELEVATOR_CHANGE], [
>  	AC_MSG_CHECKING([whether elevator_change() is available])
> diff --git a/zfs/config/kernel-inode-times.m4 b/zfs/config/kernel-inode-times.m4
> deleted file mode 100644
> index f5818411aa50..000000000000
> --- a/zfs/config/kernel-inode-times.m4
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -dnl #
> -dnl # 4.18 API change
> -dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
> -dnl #
> -AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
> -	AC_MSG_CHECKING([whether inode->i_*time's are timespec64])
> -	tmp_flags="$EXTRA_KCFLAGS"
> -	EXTRA_KCFLAGS="-Werror"
> -	ZFS_LINUX_TRY_COMPILE([
> -		#include <linux/fs.h>
> -	],[
> -		struct inode ip;
> -		struct timespec ts;
> -
> -		memset(&ip, 0, sizeof(ip));
> -		ts = ip.i_mtime;
> -	],[
> -		AC_MSG_RESULT(no)
> -	],[
> -		AC_MSG_RESULT(yes)
> -		AC_DEFINE(HAVE_INODE_TIMESPEC64_TIMES, 1,
> -		    [inode->i_*time's are timespec64])
> -	])
> -	EXTRA_KCFLAGS="$tmp_flags"
> -])
> diff --git a/zfs/config/kernel.m4 b/zfs/config/kernel.m4
> index bac5f2370c11..c7ca260c5f08 100644
> --- a/zfs/config/kernel.m4
> +++ b/zfs/config/kernel.m4
> @@ -60,7 +60,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
>  	ZFS_AC_KERNEL_POSIX_ACL_CHMOD
>  	ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
>  	ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
> -	ZFS_AC_KERNEL_INODE_TIMES
>  	ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION
>  	ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
>  	ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL
> diff --git a/zfs/config/ltmain.sh b/zfs/config/ltmain.sh
> index 27c578911af0..d3230f7c343e 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-3.1"
> +VERSION="2.4.6 Debian-2.4.6-4"
>  package_revision=2.4.6
>  
>  
> @@ -2237,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-3.1
> +       version:        $progname $scriptversion Debian-2.4.6-4
>         automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
>         autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
>  
> diff --git a/zfs/configure b/zfs/configure
> index cbd13a81a890..853e1c8eb634 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.9.
> +# Generated by GNU Autoconf 2.69 for zfs 0.7.11.
>  #
>  #
>  # 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.9'
> -PACKAGE_STRING='zfs 0.7.9'
> +PACKAGE_VERSION='0.7.11'
> +PACKAGE_STRING='zfs 0.7.11'
>  PACKAGE_BUGREPORT=''
>  PACKAGE_URL=''
>  
> @@ -690,37 +690,6 @@ TARGET_ASM_DIR
>  NO_BOOL_COMPARE
>  NO_UNUSED_BUT_SET_VARIABLE
>  ZFS_CONFIG
> -ALIEN_VERSION
> -ALIEN
> -HAVE_ALIEN
> -DPKGBUILD_VERSION
> -DPKGBUILD
> -HAVE_DPKGBUILD
> -DPKG_VERSION
> -DPKG
> -HAVE_DPKG
> -SRPM_DEFINE_COMMON
> -SRPM_DEFINE_DKMS
> -SRPM_DEFINE_KMOD
> -SRPM_DEFINE_UTIL
> -RPM_DEFINE_COMMON
> -RPM_DEFINE_DKMS
> -RPM_DEFINE_KMOD
> -RPM_DEFINE_UTIL
> -RPM_SPEC_DIR
> -RPMBUILD_VERSION
> -RPMBUILD
> -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
> @@ -886,7 +855,6 @@ with_sysroot
>  enable_libtool_lock
>  with_gcov
>  enable_code_coverage
> -with_spec
>  with_config
>  enable_linux_builtin
>  with_linux
> @@ -1471,7 +1439,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.9 to adapt to many kinds of systems.
> +\`configure' configures zfs 0.7.11 to adapt to many kinds of systems.
>  
>  Usage: $0 [OPTION]... [VAR=VALUE]...
>  
> @@ -1543,7 +1511,7 @@ fi
>  
>  if test -n "$ac_init_help"; then
>    case $ac_init_help in
> -     short | recursive ) echo "Configuration of zfs 0.7.9:";;
> +     short | recursive ) echo "Configuration of zfs 0.7.11:";;
>     esac
>    cat <<\_ACEOF
>  
> @@ -1585,7 +1553,6 @@ Optional Packages:
>    --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
>    --with-linux-obj=PATH   Path to kernel build objects
> @@ -1690,7 +1657,7 @@ fi
>  test -n "$ac_init_help" && exit $ac_status
>  if $ac_init_version; then
>    cat <<\_ACEOF
> -zfs configure 0.7.9
> +zfs configure 0.7.11
>  generated by GNU Autoconf 2.69
>  
>  Copyright (C) 2012 Free Software Foundation, Inc.
> @@ -2055,7 +2022,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.9, which was
> +It was created by zfs $as_me 0.7.11, which was
>  generated by GNU Autoconf 2.69.  Invocation command line was
>  
>    $ $0 $@
> @@ -3222,7 +3189,7 @@ fi
>  
>  # Define the identity of the package.
>   PACKAGE='zfs'
> - VERSION='0.7.9'
> + VERSION='0.7.11'
>  
>  
>  cat >>confdefs.h <<_ACEOF
> @@ -12889,298 +12856,6 @@ $as_echo_n "checking zfs license... " >&6; }
>  $as_echo "$ZFS_META_LICENSE" >&6; }
>  
>  
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linux distribution" >&5
> -$as_echo_n "checking linux distribution... " >&6; }
> -	if test -f /etc/toss-release ; then
> -		VENDOR=toss ;
> -	elif test -f /etc/fedora-release ; then
> -		VENDOR=fedora ;
> -	elif test -f /etc/redhat-release ; then
> -		VENDOR=redhat ;
> -	elif test -f /etc/gentoo-release ; then
> -		VENDOR=gentoo ;
> -	elif test -f /etc/arch-release ; then
> -		VENDOR=arch ;
> -	elif test -f /etc/SuSE-release ; then
> -		VENDOR=sles ;
> -	elif test -f /etc/slackware-version ; then
> -		VENDOR=slackware ;
> -	elif test -f /etc/lunar.release ; then
> -		VENDOR=lunar ;
> -	elif test -f /etc/lsb-release ; then
> -		VENDOR=ubuntu ;
> -	elif test -f /etc/debian_version ; then
> -		VENDOR=debian ;
> -	elif test -f /etc/alpine-release ; then
> -		VENDOR=alpine ;
> -	else
> -		VENDOR= ;
> -	fi
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VENDOR" >&5
> -$as_echo "$VENDOR" >&6; }
> -
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default package type" >&5
> -$as_echo_n "checking default package type... " >&6; }
> -	case "$VENDOR" in
> -		toss)       DEFAULT_PACKAGE=rpm  ;;
> -		redhat)     DEFAULT_PACKAGE=rpm  ;;
> -		fedora)     DEFAULT_PACKAGE=rpm  ;;
> -		gentoo)     DEFAULT_PACKAGE=tgz  ;;
> -		alpine)     DEFAULT_PACKAGE=tgz  ;;
> -		arch)       DEFAULT_PACKAGE=tgz  ;;
> -		sles)       DEFAULT_PACKAGE=rpm  ;;
> -		slackware)  DEFAULT_PACKAGE=tgz  ;;
> -		lunar)      DEFAULT_PACKAGE=tgz  ;;
> -		ubuntu)     DEFAULT_PACKAGE=deb  ;;
> -		debian)     DEFAULT_PACKAGE=deb  ;;
> -		*)          DEFAULT_PACKAGE=rpm  ;;
> -	esac
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_PACKAGE" >&5
> -$as_echo "$DEFAULT_PACKAGE" >&6; }
> -
> -
> -	DEFAULT_INIT_DIR=$sysconfdir/init.d
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default init directory" >&5
> -$as_echo_n "checking default init directory... " >&6; }
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INIT_DIR" >&5
> -$as_echo "$DEFAULT_INIT_DIR" >&6; }
> -
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default init script type" >&5
> -$as_echo_n "checking default init script type... " >&6; }
> -	case "$VENDOR" in
> -		toss)       DEFAULT_INIT_SCRIPT=redhat ;;
> -		redhat)     DEFAULT_INIT_SCRIPT=redhat ;;
> -		fedora)     DEFAULT_INIT_SCRIPT=fedora ;;
> -		gentoo)     DEFAULT_INIT_SCRIPT=openrc ;;
> -		alpine)     DEFAULT_INIT_SCRIPT=openrc ;;
> -		arch)       DEFAULT_INIT_SCRIPT=lsb    ;;
> -		sles)       DEFAULT_INIT_SCRIPT=lsb    ;;
> -		slackware)  DEFAULT_INIT_SCRIPT=lsb    ;;
> -		lunar)      DEFAULT_INIT_SCRIPT=lunar  ;;
> -		ubuntu)     DEFAULT_INIT_SCRIPT=lsb    ;;
> -		debian)     DEFAULT_INIT_SCRIPT=lsb    ;;
> -		*)          DEFAULT_INIT_SCRIPT=lsb    ;;
> -	esac
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INIT_SCRIPT" >&5
> -$as_echo "$DEFAULT_INIT_SCRIPT" >&6; }
> -
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default init config direectory" >&5
> -$as_echo_n "checking default init config direectory... " >&6; }
> -	case "$VENDOR" in
> -		alpine)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
> -		gentoo)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
> -		toss)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
> -		redhat)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
> -		fedora)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
> -		sles)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
> -		ubuntu)     DEFAULT_INITCONF_DIR=/etc/default   ;;
> -		debian)     DEFAULT_INITCONF_DIR=/etc/default   ;;
> -		*)          DEFAULT_INITCONF_DIR=/etc/default   ;;
> -	esac
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INITCONF_DIR" >&5
> -$as_echo "$DEFAULT_INITCONF_DIR" >&6; }
> -
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether initramfs-tools is available" >&5
> -$as_echo_n "checking whether initramfs-tools is available... " >&6; }
> -	if test -d /usr/share/initramfs-tools ; then
> -		DEFINE_INITRAMFS='--define "_initramfs 1"'
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> -	else
> -		DEFINE_INITRAMFS=''
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }
> -	fi
> -
> -
> -
> -	RPM=rpm
> -	RPMBUILD=rpmbuild
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPM is available" >&5
> -$as_echo_n "checking whether $RPM is available... " >&6; }
> -	if tmp=$($RPM --version 2>/dev/null); then :
> -
> -		RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
> -		HAVE_RPM=yes
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM ($RPM_VERSION)" >&5
> -$as_echo "$HAVE_RPM ($RPM_VERSION)" >&6; }
> -
> -else
> -
> -		HAVE_RPM=no
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM" >&5
> -$as_echo "$HAVE_RPM" >&6; }
> -
> -fi
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPMBUILD is available" >&5
> -$as_echo_n "checking whether $RPMBUILD is available... " >&6; }
> -	if tmp=$($RPMBUILD --version 2>/dev/null); then :
> -
> -		RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
> -		HAVE_RPMBUILD=yes
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&5
> -$as_echo "$HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&6; }
> -
> -else
> -
> -		HAVE_RPMBUILD=no
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD" >&5
> -$as_echo "$HAVE_RPMBUILD" >&6; }
> -
> -fi
> -
> -	RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
> -
> -
> -	RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
> -
> -                                                if test -n "$dracutdir" ; then :
> -
> -                RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)"'
> -
> -fi
> -        if test -n "$udevdir" ; then :
> -
> -                RPM_DEFINE_UTIL+=' --define "_udevdir $(udevdir)"'
> -
> -fi
> -        if test -n "$udevruledir" ; then :
> -
> -                RPM_DEFINE_UTIL+=' --define "_udevdir $(udevruledir)"'
> -
> -fi
> -        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=
> -
> -								if test "$DEFAULT_PACKAGE" = "deb"; then :
> -
> -		MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
> -		RPM_DEFINE_UTIL+=' --define "_lib $(MULTIARCH_LIBDIR)"'
> -
> -
> -fi
> -
> -	SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
> -	SRPM_DEFINE_UTIL=
> -	SRPM_DEFINE_KMOD=
> -	SRPM_DEFINE_DKMS=
> -
> -	RPM_SPEC_DIR="rpm/generic"
> -
> -# Check whether --with-spec was given.
> -if test "${with_spec+set}" = set; then :
> -  withval=$with_spec; RPM_SPEC_DIR="rpm/$withval"
> -fi
> -
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether spec files are available" >&5
> -$as_echo_n "checking whether spec files are available... " >&6; }
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($RPM_SPEC_DIR/*.spec.in)" >&5
> -$as_echo "yes ($RPM_SPEC_DIR/*.spec.in)" >&6; }
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -	DPKG=dpkg
> -	DPKGBUILD=dpkg-buildpackage
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKG is available" >&5
> -$as_echo_n "checking whether $DPKG is available... " >&6; }
> -	if tmp=$($DPKG --version 2>/dev/null); then :
> -
> -		DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $7 }')
> -		HAVE_DPKG=yes
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG ($DPKG_VERSION)" >&5
> -$as_echo "$HAVE_DPKG ($DPKG_VERSION)" >&6; }
> -
> -else
> -
> -		HAVE_DPKG=no
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG" >&5
> -$as_echo "$HAVE_DPKG" >&6; }
> -
> -fi
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKGBUILD is available" >&5
> -$as_echo_n "checking whether $DPKGBUILD is available... " >&6; }
> -	if tmp=$($DPKGBUILD --version 2>/dev/null); then :
> -
> -		DPKGBUILD_VERSION=$(echo $tmp | \
> -		    $AWK '/Debian/ { print $4 }' | cut -f-4 -d'.')
> -		HAVE_DPKGBUILD=yes
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&5
> -$as_echo "$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&6; }
> -
> -else
> -
> -		HAVE_DPKGBUILD=no
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD" >&5
> -$as_echo "$HAVE_DPKGBUILD" >&6; }
> -
> -fi
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -	ALIEN=alien
> -
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ALIEN is available" >&5
> -$as_echo_n "checking whether $ALIEN is available... " >&6; }
> -	if tmp=$($ALIEN --version 2>/dev/null); then :
> -
> -		ALIEN_VERSION=$(echo $tmp | $AWK '{ print $3 }')
> -		HAVE_ALIEN=yes
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN ($ALIEN_VERSION)" >&5
> -$as_echo "$HAVE_ALIEN ($ALIEN_VERSION)" >&6; }
> -
> -else
> -
> -		HAVE_ALIEN=no
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN" >&5
> -$as_echo "$HAVE_ALIEN" >&6; }
> -
> -fi
> -
> -
> -
> -
> -
> -
> -
>  	ZFS_CONFIG=all
>  
>  # Check whether --with-config was given.
> @@ -19835,78 +19510,6 @@ fi
>  
>  
>  
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode->i_*time's are timespec64" >&5
> -$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> -	tmp_flags="$EXTRA_KCFLAGS"
> -	EXTRA_KCFLAGS="-Werror"
> -
> -
> -cat confdefs.h - <<_ACEOF >conftest.c
> -
> -
> -		#include <linux/fs.h>
> -
> -int
> -main (void)
> -{
> -
> -		struct inode ip;
> -		struct timespec ts;
> -
> -		memset(&ip, 0, sizeof(ip));
> -		ts = ip.i_mtime;
> -
> -  ;
> -  return 0;
> -}
> -
> -_ACEOF
> -
> -
> -
> -cat - <<_ACEOF >conftest.h
> -
> -_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 conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $FRAME_LARGER_THAN $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: no" >&5
> -$as_echo "no" >&6; }
> -
> -else
> -  $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> -
> -$as_echo "#define HAVE_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> -
> -
> -
> -
> -fi
> -	rm -Rf build
> -
> -
> -	EXTRA_KCFLAGS="$tmp_flags"
> -
> -
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() exists" >&5
>  $as_echo_n "checking whether iops->permission() exists... " >&6; }
>  
> @@ -35469,78 +35072,6 @@ fi
>  
>  
>  
> -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode->i_*time's are timespec64" >&5
> -$as_echo_n "checking whether inode->i_*time's are timespec64... " >&6; }
> -	tmp_flags="$EXTRA_KCFLAGS"
> -	EXTRA_KCFLAGS="-Werror"
> -
> -
> -cat confdefs.h - <<_ACEOF >conftest.c
> -
> -
> -		#include <linux/fs.h>
> -
> -int
> -main (void)
> -{
> -
> -		struct inode ip;
> -		struct timespec ts;
> -
> -		memset(&ip, 0, sizeof(ip));
> -		ts = ip.i_mtime;
> -
> -  ;
> -  return 0;
> -}
> -
> -_ACEOF
> -
> -
> -
> -cat - <<_ACEOF >conftest.h
> -
> -_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 conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $FRAME_LARGER_THAN $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: no" >&5
> -$as_echo "no" >&6; }
> -
> -else
> -  $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> -		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> -
> -$as_echo "#define HAVE_INODE_TIMESPEC64_TIMES 1" >>confdefs.h
> -
> -
> -
> -
> -fi
> -	rm -Rf build
> -
> -
> -	EXTRA_KCFLAGS="$tmp_flags"
> -
> -
>  	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() exists" >&5
>  $as_echo_n "checking whether iops->permission() exists... " >&6; }
>  
> @@ -43730,7 +43261,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 zfs $as_me 0.7.9, which was
> +This file was extended by zfs $as_me 0.7.11, which was
>  generated by GNU Autoconf 2.69.  Invocation command line was
>  
>    CONFIG_FILES    = $CONFIG_FILES
> @@ -43796,7 +43327,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="\\
> -zfs config.status 0.7.9
> +zfs config.status 0.7.11
>  configured by $0, generated by GNU Autoconf 2.69,
>    with options \\"\$ac_cs_config\\"
>  
> diff --git a/zfs/configure.ac b/zfs/configure.ac
> index f36f4a46c742..b33b5cfac4d0 100644
> --- a/zfs/configure.ac
> +++ b/zfs/configure.ac
> @@ -53,7 +53,6 @@ AM_PROG_CC_C_O
>  AX_CODE_COVERAGE
>  
>  ZFS_AC_LICENSE
> -ZFS_AC_PACKAGE
>  ZFS_AC_CONFIG
>  ZFS_AC_DEBUG
>  ZFS_AC_DEBUGINFO
> diff --git a/zfs/cp b/zfs/cp
> deleted file mode 100755
> index 46ff2c9b003b..000000000000
> --- a/zfs/cp
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -#!/bin/sh
> -cp "$@"
> diff --git a/zfs/dkms.conf b/zfs/dkms.conf
> index f0bd3a3b79c0..8b6114c45982 100644
> --- a/zfs/dkms.conf
> +++ b/zfs/dkms.conf
> @@ -1,13 +1,12 @@
> -BUILD_DEPENDS[0]="spl"
> -AUTOINSTALL="yes"
>  PACKAGE_NAME="zfs"
> -PACKAGE_VERSION="0.7.9"
> +PACKAGE_VERSION="0.7.11"
> +PACKAGE_CONFIG="/etc/sysconfig/zfs"
>  PRE_BUILD="configure
>    --prefix=/usr
>    --with-config=kernel
>    --with-linux=$(
>      case `lsb_release -is` in
> -      (Debian)
> +      (Debian|Devuan)
>          if [[ -e ${kernel_source_dir/%build/source} ]]
>          then
>            echo ${kernel_source_dir/%build/source}
> @@ -24,9 +23,16 @@ PRE_BUILD="configure
>    --with-linux-obj=${kernel_source_dir}
>    --with-spl=${source_tree}/spl-${PACKAGE_VERSION}
>    --with-spl-obj=${dkms_tree}/spl/${PACKAGE_VERSION}/${kernelver}/${arch}
> +  --with-spl-timeout=300
>    $(
> -    [[ -r /etc/default/zfs ]] \
> -    && source /etc/default/zfs \
> +    [[ -n \"${ICP_ROOT}\" ]] && \
> +    {
> +      echo --with-qat=\"${ICP_ROOT}\"
> +    }
> +  )
> +  $(
> +    [[ -r ${PACKAGE_CONFIG} ]] \
> +    && source ${PACKAGE_CONFIG} \
>      && shopt -q -s extglob \
>      && \
>      {
> @@ -34,32 +40,27 @@ PRE_BUILD="configure
>        then
>          echo --enable-debug
>        fi
> -      if [[ ${ZFS_DKMS_ENABLE_DEBUG_DMU_TX,,} == @(y|yes) ]]
> +      if [[ ${ZFS_DKMS_ENABLE_DMU_TX,,} == @(y|yes) ]]
>        then
>          echo --enable-debug-dmu-tx
>        fi
>      }
>    )
> -  --with-spl-timeout=600
>  "
> -POST_BUILD="cp
> -  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/zfs_config.h
> -  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
> -  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
> +POST_BUILD="scripts/dkms.postbuild
> +  -n ${PACKAGE_NAME}
> +  -v ${PACKAGE_VERSION}
> +  -a ${arch}
> +  -k ${kernelver}
> +  -t ${dkms_tree}
>  "
> -REMAKE_INITRD="$(
> -  if [ -e /usr/share/initramfs-tools/hooks/zfs \
> -       -o -e /usr/share/dracut/modules.d/90zfs ]
> -  then
> -    echo -n yes
> -  else
> -    echo -n no
> -  fi
> -)"
> +BUILD_DEPENDS[0]="spl"
> +AUTOINSTALL="yes"
> +REMAKE_INITRD="no"
>  MAKE[0]="make"
>  STRIP[0]="$(
> -  [[ -r /etc/default/zfs ]] \
> -  && source /etc/default/zfs \
> +  [[ -r ${PACKAGE_CONFIG} ]] \
> +  && source ${PACKAGE_CONFIG} \
>    && shopt -q -s extglob \
>    && [[ ${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \
>    && echo -n no
> @@ -72,22 +73,22 @@ STRIP[5]="${STRIP[0]}"
>  STRIP[6]="${STRIP[0]}"
>  BUILT_MODULE_NAME[0]="zavl"
>  BUILT_MODULE_LOCATION[0]="module/avl/"
> -DEST_MODULE_LOCATION[0]="/extra/zfs/zavl"
> -BUILT_MODULE_NAME[1]="zcommon"
> -BUILT_MODULE_LOCATION[1]="module/zcommon/"
> -DEST_MODULE_LOCATION[1]="/extra/zfs/zcommon"
> -BUILT_MODULE_NAME[2]="znvpair"
> -BUILT_MODULE_LOCATION[2]="module/nvpair/"
> -DEST_MODULE_LOCATION[2]="/extra/zfs/znvpair"
> -BUILT_MODULE_NAME[3]="zpios"
> -BUILT_MODULE_LOCATION[3]="module/zpios/"
> -DEST_MODULE_LOCATION[3]="/extra/zfs/zpios"
> -BUILT_MODULE_NAME[4]="zunicode"
> -BUILT_MODULE_LOCATION[4]="module/unicode/"
> -DEST_MODULE_LOCATION[4]="/extra/zfs/zunicode"
> -BUILT_MODULE_NAME[5]="zfs"
> -BUILT_MODULE_LOCATION[5]="module/zfs/"
> -DEST_MODULE_LOCATION[5]="/extra/zfs/zfs"
> +DEST_MODULE_LOCATION[0]="/extra/avl/avl"
> +BUILT_MODULE_NAME[1]="znvpair"
> +BUILT_MODULE_LOCATION[1]="module/nvpair/"
> +DEST_MODULE_LOCATION[1]="/extra/nvpair/znvpair"
> +BUILT_MODULE_NAME[2]="zunicode"
> +BUILT_MODULE_LOCATION[2]="module/unicode/"
> +DEST_MODULE_LOCATION[2]="/extra/unicode/zunicode"
> +BUILT_MODULE_NAME[3]="zcommon"
> +BUILT_MODULE_LOCATION[3]="module/zcommon/"
> +DEST_MODULE_LOCATION[3]="/extra/zcommon/zcommon"
> +BUILT_MODULE_NAME[4]="zfs"
> +BUILT_MODULE_LOCATION[4]="module/zfs/"
> +DEST_MODULE_LOCATION[4]="/extra/zfs/zfs"
> +BUILT_MODULE_NAME[5]="zpios"
> +BUILT_MODULE_LOCATION[5]="module/zpios/"
> +DEST_MODULE_LOCATION[5]="/extra/zpios/zpios"
>  BUILT_MODULE_NAME[6]="icp"
>  BUILT_MODULE_LOCATION[6]="module/icp/"
> -DEST_MODULE_LOCATION[6]="/extra/zfs/icp"
> +DEST_MODULE_LOCATION[6]="/extra/icp/icp"
> diff --git a/zfs/include/Makefile.in b/zfs/include/Makefile.in
> index 4ac617e735a6..360062629c75 100644
> --- a/zfs/include/Makefile.in
> +++ b/zfs/include/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -348,8 +347,6 @@ am__relativize = \
>    done; \
>    reldir="$$dir2"
>  ACLOCAL = @ACLOCAL@
> -ALIEN = @ALIEN@
> -ALIEN_VERSION = @ALIEN_VERSION@
>  AMTAR = @AMTAR@
>  AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
>  AR = @AR@
> @@ -375,19 +372,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -400,11 +388,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -436,7 +419,6 @@ 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@
> @@ -460,15 +442,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -476,13 +449,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/libzfs.h b/zfs/include/libzfs.h
> index 945bd5b86064..fea2fee45277 100644
> --- a/zfs/include/libzfs.h
> +++ b/zfs/include/libzfs.h
> @@ -296,6 +296,8 @@ int zfs_dev_is_whole_disk(char *dev_name);
>  char *zfs_get_underlying_path(char *dev_name);
>  char *zfs_get_enclosure_sysfs_path(char *dev_name);
>  
> +const char *zpool_get_state_str(zpool_handle_t *);
> +
>  /*
>   * Functions to manage pool properties
>   */
> diff --git a/zfs/include/linux/Makefile.in b/zfs/include/linux/Makefile.in
> index 9eb475b766f8..afa7b6f2a023 100644
> --- a/zfs/include/linux/Makefile.in
> +++ b/zfs/include/linux/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -294,8 +293,6 @@ 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@
> @@ -321,19 +318,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -346,11 +334,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -382,7 +365,6 @@ 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@
> @@ -406,15 +388,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -422,13 +395,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/linux/blkdev_compat.h b/zfs/include/linux/blkdev_compat.h
> index 27f056626626..c8cdf38ef4fe 100644
> --- a/zfs/include/linux/blkdev_compat.h
> +++ b/zfs/include/linux/blkdev_compat.h
> @@ -105,17 +105,6 @@ blk_queue_set_write_cache(struct request_queue *q, bool wc, bool fua)
>  #define	blk_fs_request(rq)	((rq)->cmd_type == REQ_TYPE_FS)
>  #endif
>  
> -/*
> - * 2.6.27 API change,
> - * The blk_queue_stackable() queue flag was added in 2.6.27 to handle dm
> - * stacking drivers.  Prior to this request stacking drivers were detected
> - * by checking (q->request_fn == NULL), for earlier kernels we revert to
> - * this legacy behavior.
> - */
> -#ifndef blk_queue_stackable
> -#define	blk_queue_stackable(q)	((q)->request_fn == NULL)
> -#endif
> -
>  /*
>   * 2.6.34 API change,
>   * The blk_queue_max_hw_sectors() function replaces blk_queue_max_sectors().
> diff --git a/zfs/include/linux/vfs_compat.h b/zfs/include/linux/vfs_compat.h
> index c8203bd55939..cca16d6cc7cd 100644
> --- a/zfs/include/linux/vfs_compat.h
> +++ b/zfs/include/linux/vfs_compat.h
> @@ -296,9 +296,6 @@ lseek_execute(
>   * This is several orders of magnitude larger than expected grace period.
>   * At 60 seconds the kernel will also begin issuing RCU stall warnings.
>   */
> -#ifdef refcount_t
> -#undef refcount_t
> -#endif
>  
>  #include <linux/posix_acl.h>
>  
> @@ -429,8 +426,6 @@ typedef mode_t zpl_equivmode_t;
>  #define	zpl_posix_acl_valid(ip, acl)  posix_acl_valid(acl)
>  #endif
>  
> -#define	refcount_t	zfs_refcount_t
> -
>  #endif /* CONFIG_FS_POSIX_ACL */
>  
>  /*
> diff --git a/zfs/include/sys/Makefile.in b/zfs/include/sys/Makefile.in
> index 204023f89f1b..c5f80d82be10 100644
> --- a/zfs/include/sys/Makefile.in
> +++ b/zfs/include/sys/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -554,8 +553,6 @@ am__relativize = \
>    done; \
>    reldir="$$dir2"
>  ACLOCAL = @ACLOCAL@
> -ALIEN = @ALIEN@
> -ALIEN_VERSION = @ALIEN_VERSION@
>  AMTAR = @AMTAR@
>  AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
>  AR = @AR@
> @@ -581,19 +578,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -606,11 +594,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -642,7 +625,6 @@ 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@
> @@ -666,15 +648,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -682,13 +655,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/abd.h b/zfs/include/sys/abd.h
> index cd7105013705..4898606a3f40 100644
> --- a/zfs/include/sys/abd.h
> +++ b/zfs/include/sys/abd.h
> @@ -52,7 +52,7 @@ typedef struct abd {
>  	abd_flags_t	abd_flags;
>  	uint_t		abd_size;	/* excludes scattered abd_offset */
>  	struct abd	*abd_parent;
> -	refcount_t	abd_children;
> +	zfs_refcount_t	abd_children;
>  	union {
>  		struct abd_scatter {
>  			uint_t		abd_offset;
> diff --git a/zfs/include/sys/arc.h b/zfs/include/sys/arc.h
> index 1ea4937bd451..943ebfb5b3a3 100644
> --- a/zfs/include/sys/arc.h
> +++ b/zfs/include/sys/arc.h
> @@ -76,7 +76,7 @@ struct arc_prune {
>  	void			*p_private;
>  	uint64_t		p_adjust;
>  	list_node_t		p_node;
> -	refcount_t		p_refcnt;
> +	zfs_refcount_t		p_refcnt;
>  };
>  
>  typedef enum arc_strategy {
> diff --git a/zfs/include/sys/arc_impl.h b/zfs/include/sys/arc_impl.h
> index c6363f2ab71a..ed2b0abe2051 100644
> --- a/zfs/include/sys/arc_impl.h
> +++ b/zfs/include/sys/arc_impl.h
> @@ -74,12 +74,12 @@ typedef struct arc_state {
>  	/*
>  	 * total amount of evictable data in this state
>  	 */
> -	refcount_t arcs_esize[ARC_BUFC_NUMTYPES];
> +	zfs_refcount_t arcs_esize[ARC_BUFC_NUMTYPES];
>  	/*
>  	 * total amount of data in this state; this includes: evictable,
>  	 * non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA.
>  	 */
> -	refcount_t arcs_size;
> +	zfs_refcount_t arcs_size;
>  	/*
>  	 * supports the "dbufs" kstat
>  	 */
> @@ -163,7 +163,7 @@ typedef struct l1arc_buf_hdr {
>  	uint32_t		b_l2_hits;
>  
>  	/* self protecting */
> -	refcount_t		b_refcnt;
> +	zfs_refcount_t		b_refcnt;
>  
>  	arc_callback_t		*b_acb;
>  	abd_t			*b_pabd;
> @@ -180,7 +180,7 @@ typedef struct l2arc_dev {
>  	kmutex_t		l2ad_mtx;	/* lock for buffer list */
>  	list_t			l2ad_buflist;	/* buffer list */
>  	list_node_t		l2ad_node;	/* device list node */
> -	refcount_t		l2ad_alloc;	/* allocated bytes */
> +	zfs_refcount_t		l2ad_alloc;	/* allocated bytes */
>  } l2arc_dev_t;
>  
>  typedef struct l2arc_buf_hdr {
> diff --git a/zfs/include/sys/crypto/Makefile.in b/zfs/include/sys/crypto/Makefile.in
> index d15c4b84e445..2d552e3d5dba 100644
> --- a/zfs/include/sys/crypto/Makefile.in
> +++ b/zfs/include/sys/crypto/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -290,8 +289,6 @@ 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@
> @@ -317,19 +314,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -342,11 +330,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -378,7 +361,6 @@ 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@
> @@ -402,15 +384,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -418,13 +391,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/dbuf.h b/zfs/include/sys/dbuf.h
> index f3f2007d5173..127acad33c71 100644
> --- a/zfs/include/sys/dbuf.h
> +++ b/zfs/include/sys/dbuf.h
> @@ -212,7 +212,7 @@ typedef struct dmu_buf_impl {
>  	 * If nonzero, the buffer can't be destroyed.
>  	 * Protected by db_mtx.
>  	 */
> -	refcount_t db_holds;
> +	zfs_refcount_t db_holds;
>  
>  	/* buffer holding our data */
>  	arc_buf_t *db_buf;
> diff --git a/zfs/include/sys/dmu.h b/zfs/include/sys/dmu.h
> index 755a90561ae5..5b355afb90bf 100644
> --- a/zfs/include/sys/dmu.h
> +++ b/zfs/include/sys/dmu.h
> @@ -227,11 +227,14 @@ typedef enum dmu_object_type {
>  	DMU_OTN_ZAP_METADATA = DMU_OT(DMU_BSWAP_ZAP, B_TRUE),
>  } dmu_object_type_t;
>  
> -typedef enum txg_how {
> -	TXG_WAIT = 1,
> -	TXG_NOWAIT,
> -	TXG_WAITED,
> -} txg_how_t;
> +/*
> + * These flags are intended to be used to specify the "txg_how"
> + * parameter when calling the dmu_tx_assign() function. See the comment
> + * above dmu_tx_assign() for more details on the meaning of these flags.
> + */
> +#define	TXG_NOWAIT	(0ULL)
> +#define	TXG_WAIT	(1ULL<<0)
> +#define	TXG_NOTHROTTLE	(1ULL<<1)
>  
>  void byteswap_uint64_array(void *buf, size_t size);
>  void byteswap_uint32_array(void *buf, size_t size);
> @@ -694,7 +697,7 @@ void dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t object);
>  void dmu_tx_hold_sa(dmu_tx_t *tx, struct sa_handle *hdl, boolean_t may_grow);
>  void dmu_tx_hold_sa_create(dmu_tx_t *tx, int total_size);
>  void dmu_tx_abort(dmu_tx_t *tx);
> -int dmu_tx_assign(dmu_tx_t *tx, enum txg_how txg_how);
> +int dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how);
>  void dmu_tx_wait(dmu_tx_t *tx);
>  void dmu_tx_commit(dmu_tx_t *tx);
>  void dmu_tx_mark_netfree(dmu_tx_t *tx);
> diff --git a/zfs/include/sys/dmu_tx.h b/zfs/include/sys/dmu_tx.h
> index d82a79310db6..96bbcb0545b7 100644
> --- a/zfs/include/sys/dmu_tx.h
> +++ b/zfs/include/sys/dmu_tx.h
> @@ -67,9 +67,6 @@ struct dmu_tx {
>  	/* placeholder for syncing context, doesn't need specific holds */
>  	boolean_t tx_anyobj;
>  
> -	/* has this transaction already been delayed? */
> -	boolean_t tx_waited;
> -
>  	/* transaction is marked as being a "net free" of space */
>  	boolean_t tx_netfree;
>  
> @@ -79,6 +76,9 @@ struct dmu_tx {
>  	/* need to wait for sufficient dirty space */
>  	boolean_t tx_wait_dirty;
>  
> +	/* has this transaction already been delayed? */
> +	boolean_t tx_dirty_delayed;
> +
>  	int tx_err;
>  };
>  
> @@ -97,8 +97,8 @@ typedef struct dmu_tx_hold {
>  	dmu_tx_t *txh_tx;
>  	list_node_t txh_node;
>  	struct dnode *txh_dnode;
> -	refcount_t txh_space_towrite;
> -	refcount_t txh_memory_tohold;
> +	zfs_refcount_t txh_space_towrite;
> +	zfs_refcount_t txh_memory_tohold;
>  	enum dmu_tx_hold_type txh_type;
>  	uint64_t txh_arg1;
>  	uint64_t txh_arg2;
> @@ -138,7 +138,7 @@ extern dmu_tx_stats_t dmu_tx_stats;
>   * These routines are defined in dmu.h, and are called by the user.
>   */
>  dmu_tx_t *dmu_tx_create(objset_t *dd);
> -int dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how);
> +int dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how);
>  void dmu_tx_commit(dmu_tx_t *tx);
>  void dmu_tx_abort(dmu_tx_t *tx);
>  uint64_t dmu_tx_get_txg(dmu_tx_t *tx);
> diff --git a/zfs/include/sys/dnode.h b/zfs/include/sys/dnode.h
> index c7efe5593566..cd7696a4b9a9 100644
> --- a/zfs/include/sys/dnode.h
> +++ b/zfs/include/sys/dnode.h
> @@ -265,8 +265,8 @@ struct dnode {
>  	uint8_t *dn_dirtyctx_firstset;		/* dbg: contents meaningless */
>  
>  	/* protected by own devices */
> -	refcount_t dn_tx_holds;
> -	refcount_t dn_holds;
> +	zfs_refcount_t dn_tx_holds;
> +	zfs_refcount_t dn_holds;
>  
>  	kmutex_t dn_dbufs_mtx;
>  	/*
> @@ -360,6 +360,7 @@ int dnode_next_offset(dnode_t *dn, int flags, uint64_t *off,
>      int minlvl, uint64_t blkfill, uint64_t txg);
>  void dnode_evict_dbufs(dnode_t *dn);
>  void dnode_evict_bonus(dnode_t *dn);
> +void dnode_free_interior_slots(dnode_t *dn);
>  
>  #define	DNODE_IS_CACHEABLE(_dn)						\
>  	((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL ||		\
> @@ -453,6 +454,11 @@ typedef struct dnode_stats {
>  	 * which had already been unlinked in an earlier txg.
>  	 */
>  	kstat_named_t dnode_hold_free_txg;
> +	/*
> +	 * Number of times dnode_free_interior_slots() needed to retry
> +	 * acquiring a slot zrl lock due to contention.
> +	 */
> +	kstat_named_t dnode_free_interior_lock_retry;
>  	/*
>  	 * Number of new dnodes allocated by dnode_allocate().
>  	 */
> diff --git a/zfs/include/sys/dsl_dataset.h b/zfs/include/sys/dsl_dataset.h
> index 1281674bbec2..d96f526dbfd6 100644
> --- a/zfs/include/sys/dsl_dataset.h
> +++ b/zfs/include/sys/dsl_dataset.h
> @@ -186,7 +186,7 @@ typedef struct dsl_dataset {
>  	 * Owning counts as a long hold.  See the comments above
>  	 * dsl_pool_hold() for details.
>  	 */
> -	refcount_t ds_longholds;
> +	zfs_refcount_t ds_longholds;
>  
>  	/* no locking; only for making guesses */
>  	uint64_t ds_trysnap_txg;
> diff --git a/zfs/include/sys/fm/Makefile.in b/zfs/include/sys/fm/Makefile.in
> index 5d9a9708e807..3af8772c9e4b 100644
> --- a/zfs/include/sys/fm/Makefile.in
> +++ b/zfs/include/sys/fm/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -330,8 +329,6 @@ am__relativize = \
>    done; \
>    reldir="$$dir2"
>  ACLOCAL = @ACLOCAL@
> -ALIEN = @ALIEN@
> -ALIEN_VERSION = @ALIEN_VERSION@
>  AMTAR = @AMTAR@
>  AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
>  AR = @AR@
> @@ -357,19 +354,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -382,11 +370,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -418,7 +401,6 @@ 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@
> @@ -442,15 +424,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -458,13 +431,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/fm/fs/Makefile.in b/zfs/include/sys/fm/fs/Makefile.in
> index d8b691873535..1f9c802a98d2 100644
> --- a/zfs/include/sys/fm/fs/Makefile.in
> +++ b/zfs/include/sys/fm/fs/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -286,8 +285,6 @@ 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@
> @@ -313,19 +310,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -338,11 +326,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -374,7 +357,6 @@ 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@
> @@ -398,15 +380,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -414,13 +387,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/fs/Makefile.in b/zfs/include/sys/fs/Makefile.in
> index 237def672376..f74759818a5d 100644
> --- a/zfs/include/sys/fs/Makefile.in
> +++ b/zfs/include/sys/fs/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -286,8 +285,6 @@ 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@
> @@ -313,19 +310,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -338,11 +326,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -374,7 +357,6 @@ 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@
> @@ -398,15 +380,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -414,13 +387,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/metaslab_impl.h b/zfs/include/sys/metaslab_impl.h
> index f8a713a4f1ff..d507fe04debf 100644
> --- a/zfs/include/sys/metaslab_impl.h
> +++ b/zfs/include/sys/metaslab_impl.h
> @@ -179,7 +179,7 @@ struct metaslab_class {
>  	 * number of allocations allowed.
>  	 */
>  	uint64_t		mc_alloc_max_slots;
> -	refcount_t		mc_alloc_slots;
> +	zfs_refcount_t		mc_alloc_slots;
>  
>  	uint64_t		mc_alloc_groups; /* # of allocatable groups */
>  
> @@ -230,7 +230,7 @@ struct metaslab_group {
>  	 * are unable to handle their share of allocations.
>  	 */
>  	uint64_t		mg_max_alloc_queue_depth;
> -	refcount_t		mg_alloc_queue_depth;
> +	zfs_refcount_t		mg_alloc_queue_depth;
>  
>  	/*
>  	 * A metalab group that can no longer allocate the minimum block
> diff --git a/zfs/include/sys/refcount.h b/zfs/include/sys/refcount.h
> index a96220b29ad0..5c5198d82cc5 100644
> --- a/zfs/include/sys/refcount.h
> +++ b/zfs/include/sys/refcount.h
> @@ -41,17 +41,6 @@ extern "C" {
>   */
>  #define	FTAG ((char *)__func__)
>  
> -/*
> - * Starting with 4.11, torvalds/linux at f405df5, the linux kernel defines a
> - * refcount_t type of its own.  The macro below effectively changes references
> - * in the ZFS code from refcount_t to zfs_refcount_t at compile time, so that
> - * existing code need not be altered, reducing conflicts when landing openZFS
> - * patches.
> - */
> -
> -#define	refcount_t	zfs_refcount_t
> -#define	refcount_add	zfs_refcount_add
> -
>  #ifdef	ZFS_DEBUG
>  typedef struct reference {
>  	list_node_t ref_link;
> @@ -69,23 +58,28 @@ typedef struct refcount {
>  	uint64_t rc_removed_count;
>  } zfs_refcount_t;
>  
> -/* Note: refcount_t must be initialized with refcount_create[_untracked]() */
> -
> -void refcount_create(refcount_t *rc);
> -void refcount_create_untracked(refcount_t *rc);
> -void refcount_create_tracked(refcount_t *rc);
> -void refcount_destroy(refcount_t *rc);
> -void refcount_destroy_many(refcount_t *rc, uint64_t number);
> -int refcount_is_zero(refcount_t *rc);
> -int64_t refcount_count(refcount_t *rc);
> -int64_t zfs_refcount_add(refcount_t *rc, void *holder_tag);
> -int64_t refcount_remove(refcount_t *rc, void *holder_tag);
> -int64_t refcount_add_many(refcount_t *rc, uint64_t number, void *holder_tag);
> -int64_t refcount_remove_many(refcount_t *rc, uint64_t number, void *holder_tag);
> -void refcount_transfer(refcount_t *dst, refcount_t *src);
> -void refcount_transfer_ownership(refcount_t *, void *, void *);
> -boolean_t refcount_held(refcount_t *, void *);
> -boolean_t refcount_not_held(refcount_t *, void *);
> +/*
> + * Note: zfs_refcount_t must be initialized with
> + * refcount_create[_untracked]()
> + */
> +
> +void refcount_create(zfs_refcount_t *rc);
> +void refcount_create_untracked(zfs_refcount_t *rc);
> +void refcount_create_tracked(zfs_refcount_t *rc);
> +void refcount_destroy(zfs_refcount_t *rc);
> +void refcount_destroy_many(zfs_refcount_t *rc, uint64_t number);
> +int refcount_is_zero(zfs_refcount_t *rc);
> +int64_t refcount_count(zfs_refcount_t *rc);
> +int64_t zfs_refcount_add(zfs_refcount_t *rc, void *holder_tag);
> +int64_t refcount_remove(zfs_refcount_t *rc, void *holder_tag);
> +int64_t refcount_add_many(zfs_refcount_t *rc, uint64_t number,
> +    void *holder_tag);
> +int64_t refcount_remove_many(zfs_refcount_t *rc, uint64_t number,
> +    void *holder_tag);
> +void refcount_transfer(zfs_refcount_t *dst, zfs_refcount_t *src);
> +void refcount_transfer_ownership(zfs_refcount_t *, void *, void *);
> +boolean_t refcount_held(zfs_refcount_t *, void *);
> +boolean_t refcount_not_held(zfs_refcount_t *, void *);
>  
>  void refcount_init(void);
>  void refcount_fini(void);
> @@ -94,7 +88,7 @@ void refcount_fini(void);
>  
>  typedef struct refcount {
>  	uint64_t rc_count;
> -} refcount_t;
> +} zfs_refcount_t;
>  
>  #define	refcount_create(rc) ((rc)->rc_count = 0)
>  #define	refcount_create_untracked(rc) ((rc)->rc_count = 0)
> diff --git a/zfs/include/sys/rrwlock.h b/zfs/include/sys/rrwlock.h
> index 7a328fd68030..e1c1756cf29a 100644
> --- a/zfs/include/sys/rrwlock.h
> +++ b/zfs/include/sys/rrwlock.h
> @@ -57,8 +57,8 @@ typedef struct rrwlock {
>  	kmutex_t	rr_lock;
>  	kcondvar_t	rr_cv;
>  	kthread_t	*rr_writer;
> -	refcount_t	rr_anon_rcount;
> -	refcount_t	rr_linked_rcount;
> +	zfs_refcount_t	rr_anon_rcount;
> +	zfs_refcount_t	rr_linked_rcount;
>  	boolean_t	rr_writer_wanted;
>  	boolean_t	rr_track_all;
>  } rrwlock_t;
> diff --git a/zfs/include/sys/sa_impl.h b/zfs/include/sys/sa_impl.h
> index b68b7610b25e..7eddd8750faa 100644
> --- a/zfs/include/sys/sa_impl.h
> +++ b/zfs/include/sys/sa_impl.h
> @@ -110,7 +110,7 @@ typedef struct sa_idx_tab {
>  	list_node_t	sa_next;
>  	sa_lot_t	*sa_layout;
>  	uint16_t	*sa_variable_lengths;
> -	refcount_t	sa_refcount;
> +	zfs_refcount_t	sa_refcount;
>  	uint32_t	*sa_idx_tab;	/* array of offsets */
>  } sa_idx_tab_t;
>  
> diff --git a/zfs/include/sys/spa.h b/zfs/include/sys/spa.h
> index 3b268419ab9c..810999c95055 100644
> --- a/zfs/include/sys/spa.h
> +++ b/zfs/include/sys/spa.h
> @@ -730,6 +730,7 @@ typedef struct spa_stats {
>  	spa_stats_history_t	tx_assign_histogram;
>  	spa_stats_history_t	io_history;
>  	spa_stats_history_t	mmp_history;
> +	spa_stats_history_t	state;		/* pool state */
>  } spa_stats_t;
>  
>  typedef enum txg_state {
> @@ -889,6 +890,8 @@ extern void spa_history_log_internal_ds(struct dsl_dataset *ds, const char *op,
>  extern void spa_history_log_internal_dd(dsl_dir_t *dd, const char *operation,
>      dmu_tx_t *tx, const char *fmt, ...);
>  
> +extern const char *spa_state_to_name(spa_t *spa);
> +
>  /* error handling */
>  struct zbookmark_phys;
>  extern void spa_log_error(spa_t *spa, zio_t *zio);
> diff --git a/zfs/include/sys/spa_impl.h b/zfs/include/sys/spa_impl.h
> index fa7490ace673..62ac8f67c1fa 100644
> --- a/zfs/include/sys/spa_impl.h
> +++ b/zfs/include/sys/spa_impl.h
> @@ -78,7 +78,7 @@ typedef struct spa_config_lock {
>  	kthread_t	*scl_writer;
>  	int		scl_write_wanted;
>  	kcondvar_t	scl_cv;
> -	refcount_t	scl_count;
> +	zfs_refcount_t	scl_count;
>  } spa_config_lock_t;
>  
>  typedef struct spa_config_dirent {
> @@ -281,12 +281,12 @@ struct spa {
>  
>  	/*
>  	 * spa_refcount & spa_config_lock must be the last elements
> -	 * because refcount_t changes size based on compilation options.
> +	 * because zfs_refcount_t changes size based on compilation options.
>  	 * In order for the MDB module to function correctly, the other
>  	 * fields must remain in the same location.
>  	 */
>  	spa_config_lock_t spa_config_lock[SCL_LOCKS]; /* config changes */
> -	refcount_t	spa_refcount;		/* number of opens */
> +	zfs_refcount_t	spa_refcount;		/* number of opens */
>  
>  	taskq_t		*spa_upgrade_taskq;	/* taskq for upgrade jobs */
>  };
> diff --git a/zfs/include/sys/sysevent/Makefile.in b/zfs/include/sys/sysevent/Makefile.in
> index 88fe520f9812..2d8f78ac1f53 100644
> --- a/zfs/include/sys/sysevent/Makefile.in
> +++ b/zfs/include/sys/sysevent/Makefile.in
> @@ -152,7 +152,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
>  	$(top_srcdir)/config/kernel-inode-getattr.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-flags.m4 \
>  	$(top_srcdir)/config/kernel-inode-set-iversion.m4 \
> -	$(top_srcdir)/config/kernel-inode-times.m4 \
>  	$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
>  	$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
>  	$(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
> @@ -290,8 +289,6 @@ 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@
> @@ -317,19 +314,10 @@ CYGPATH_W = @CYGPATH_W@
>  DEBUG_CFLAGS = @DEBUG_CFLAGS@
>  DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
>  DEBUG_ZFS = @DEBUG_ZFS@
> -DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
> -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@
> -DPKG = @DPKG@
> -DPKGBUILD = @DPKGBUILD@
> -DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
> -DPKG_VERSION = @DPKG_VERSION@
>  DSYMUTIL = @DSYMUTIL@
>  DUMPBIN = @DUMPBIN@
>  ECHO_C = @ECHO_C@
> @@ -342,11 +330,6 @@ FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
>  GCOV = @GCOV@
>  GENHTML = @GENHTML@
>  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@
> @@ -378,7 +361,6 @@ 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@
> @@ -402,15 +384,6 @@ QAT_SYMBOLS = @QAT_SYMBOLS@
>  RANLIB = @RANLIB@
>  RELEASE = @RELEASE@
>  RM = @RM@
> -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@
> @@ -418,13 +391,8 @@ SPL = @SPL@
>  SPL_OBJ = @SPL_OBJ@
>  SPL_SYMBOLS = @SPL_SYMBOLS@
>  SPL_VERSION = @SPL_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@
>  TARGET_ASM_DIR = @TARGET_ASM_DIR@
> -VENDOR = @VENDOR@
>  VERSION = @VERSION@
>  ZFS_CONFIG = @ZFS_CONFIG@
>  ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
> diff --git a/zfs/include/sys/zap.h b/zfs/include/sys/zap.h
> index 43b7fbd263c2..7acc3becb5a1 100644
> --- a/zfs/include/sys/zap.h
> +++ b/zfs/include/sys/zap.h
> @@ -226,7 +226,7 @@ int zap_lookup_norm_by_dnode(dnode_t *dn, const char *name,
>      boolean_t *ncp);
>  
>  int zap_count_write_by_dnode(dnode_t *dn, const char *name,
> -    int add, refcount_t *towrite, refcount_t *tooverwrite);
> +    int add, zfs_refcount_t *towrite, zfs_refcount_t *tooverwrite);
>  
>  /*
>   * Create an attribute with the given name and value.
> diff --git a/zfs/include/sys/zap_leaf.h b/zfs/include/sys/zap_leaf.h
> index e784c5963b2e..a3da1036a5ee 100644
> --- a/zfs/include/sys/zap_leaf.h
> +++ b/zfs/include/sys/zap_leaf.h
> @@ -46,10 +46,15 @@ struct zap_stats;
>   * block size (1<<l->l_bs) - hash entry size (2) * number of hash
>   * entries - header space (2*chunksize)
>   */
> -#define	ZAP_LEAF_NUMCHUNKS(l) \
> -	(((1<<(l)->l_bs) - 2*ZAP_LEAF_HASH_NUMENTRIES(l)) / \
> +#define	ZAP_LEAF_NUMCHUNKS_BS(bs) \
> +	(((1<<(bs)) - 2*ZAP_LEAF_HASH_NUMENTRIES_BS(bs)) / \
>  	ZAP_LEAF_CHUNKSIZE - 2)
>  
> +#define	ZAP_LEAF_NUMCHUNKS(l) (ZAP_LEAF_NUMCHUNKS_BS(((l)->l_bs)))
> +
> +#define	ZAP_LEAF_NUMCHUNKS_DEF \
> +	(ZAP_LEAF_NUMCHUNKS_BS(fzap_default_block_shift))
> +
>  /*
>   * The amount of space within the chunk available for the array is:
>   * chunk size - space for type (1) - space for next pointer (2)
> @@ -74,8 +79,10 @@ struct zap_stats;
>   * which is less than block size / CHUNKSIZE (24) / minimum number of
>   * chunks per entry (3).
>   */
> -#define	ZAP_LEAF_HASH_SHIFT(l) ((l)->l_bs - 5)
> -#define	ZAP_LEAF_HASH_NUMENTRIES(l) (1 << ZAP_LEAF_HASH_SHIFT(l))
> +#define	ZAP_LEAF_HASH_SHIFT_BS(bs) ((bs) - 5)
> +#define	ZAP_LEAF_HASH_NUMENTRIES_BS(bs) (1 << ZAP_LEAF_HASH_SHIFT_BS(bs))
> +#define	ZAP_LEAF_HASH_SHIFT(l) (ZAP_LEAF_HASH_SHIFT_BS(((l)->l_bs)))
> +#define	ZAP_LEAF_HASH_NUMENTRIES(l) (ZAP_LEAF_HASH_NUMENTRIES_BS(((l)->l_bs)))
>  
>  /*
>   * The chunks start immediately after the hash table.  The end of the
> diff --git a/zfs/include/sys/zfs_znode.h b/zfs/include/sys/zfs_znode.h
> index 26d1eb37557c..33bc20d11566 100644
> --- a/zfs/include/sys/zfs_znode.h
> +++ b/zfs/include/sys/zfs_znode.h
> @@ -209,7 +209,7 @@ typedef struct znode_hold {
>  	uint64_t	zh_obj;		/* object id */
>  	kmutex_t	zh_lock;	/* lock serializing object access */
>  	avl_node_t	zh_node;	/* avl tree linkage */
> -	refcount_t	zh_refcount;	/* active consumer reference count */
> +	zfs_refcount_t	zh_refcount;	/* active consumer reference count */
>  } znode_hold_t;
>  
>  /*
> diff --git a/zfs/module/icp/algs/modes/ccm.c b/zfs/module/icp/algs/modes/ccm.c
> index 22aeb0a6aa47..fb41194f8175 100644
> --- a/zfs/module/icp/algs/modes/ccm.c
> +++ b/zfs/module/icp/algs/modes/ccm.c
> @@ -28,7 +28,7 @@
>  #include <sys/crypto/common.h>
>  #include <sys/crypto/impl.h>
>  
> -#if defined(__i386) || defined(__amd64)
> +#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
>  #include <sys/byteorder.h>
>  #define	UNALIGNED_POINTERS_PERMITTED
>  #endif
> diff --git a/zfs/module/icp/core/kcf_mech_tabs.c b/zfs/module/icp/core/kcf_mech_tabs.c
> index 723bfdb601a4..741dae7a748e 100644
> --- a/zfs/module/icp/core/kcf_mech_tabs.c
> +++ b/zfs/module/icp/core/kcf_mech_tabs.c
> @@ -321,7 +321,7 @@ kcf_create_mech_entry(kcf_ops_class_t class, char *mechname)
>  		mutex_enter(&(me_tab[i].me_mutex));
>  		if (me_tab[i].me_name[0] == 0) {
>  			/* Found an empty spot */
> -			(void) strncpy(me_tab[i].me_name, mechname,
> +			(void) strlcpy(me_tab[i].me_name, mechname,
>  			    CRYPTO_MAX_MECH_NAME);
>  			me_tab[i].me_name[CRYPTO_MAX_MECH_NAME-1] = '\0';
>  			me_tab[i].me_mechid = KCF_MECHID(class, i);
> diff --git a/zfs/module/zfs/arc.c b/zfs/module/zfs/arc.c
> index bcf74dd6ea45..7518d5c86756 100644
> --- a/zfs/module/zfs/arc.c
> +++ b/zfs/module/zfs/arc.c
> @@ -1966,7 +1966,7 @@ add_reference(arc_buf_hdr_t *hdr, void *tag)
>  
>  	state = hdr->b_l1hdr.b_state;
>  
> -	if ((refcount_add(&hdr->b_l1hdr.b_refcnt, tag) == 1) &&
> +	if ((zfs_refcount_add(&hdr->b_l1hdr.b_refcnt, tag) == 1) &&
>  	    (state != arc_anon)) {
>  		/* We don't use the L2-only state list. */
>  		if (state != arc_l2c_only) {
> @@ -2505,7 +2505,7 @@ arc_return_buf(arc_buf_t *buf, void *tag)
>  
>  	ASSERT3P(buf->b_data, !=, NULL);
>  	ASSERT(HDR_HAS_L1HDR(hdr));
> -	(void) refcount_add(&hdr->b_l1hdr.b_refcnt, tag);
> +	(void) zfs_refcount_add(&hdr->b_l1hdr.b_refcnt, tag);
>  	(void) refcount_remove(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag);
>  
>  	arc_loaned_bytes_update(-arc_buf_size(buf));
> @@ -2519,7 +2519,7 @@ arc_loan_inuse_buf(arc_buf_t *buf, void *tag)
>  
>  	ASSERT3P(buf->b_data, !=, NULL);
>  	ASSERT(HDR_HAS_L1HDR(hdr));
> -	(void) refcount_add(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag);
> +	(void) zfs_refcount_add(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag);
>  	(void) refcount_remove(&hdr->b_l1hdr.b_refcnt, tag);
>  
>  	arc_loaned_bytes_update(arc_buf_size(buf));
> @@ -3533,7 +3533,7 @@ arc_prune_async(int64_t adjust)
>  		if (refcount_count(&ap->p_refcnt) >= 2)
>  			continue;
>  
> -		refcount_add(&ap->p_refcnt, ap->p_pfunc);
> +		zfs_refcount_add(&ap->p_refcnt, ap->p_pfunc);
>  		ap->p_adjust = adjust;
>  		if (taskq_dispatch(arc_prune_taskq, arc_prune_task,
>  		    ap, TQ_SLEEP) == TASKQID_INVALID) {
> @@ -5549,7 +5549,7 @@ arc_add_prune_callback(arc_prune_func_t *func, void *private)
>  	refcount_create(&p->p_refcnt);
>  
>  	mutex_enter(&arc_prune_mtx);
> -	refcount_add(&p->p_refcnt, &arc_prune_list);
> +	zfs_refcount_add(&p->p_refcnt, &arc_prune_list);
>  	list_insert_head(&arc_prune_list, p);
>  	mutex_exit(&arc_prune_mtx);
>  
> @@ -5815,7 +5815,7 @@ arc_release(arc_buf_t *buf, void *tag)
>  		nhdr->b_l1hdr.b_mfu_hits = 0;
>  		nhdr->b_l1hdr.b_mfu_ghost_hits = 0;
>  		nhdr->b_l1hdr.b_l2_hits = 0;
> -		(void) refcount_add(&nhdr->b_l1hdr.b_refcnt, tag);
> +		(void) zfs_refcount_add(&nhdr->b_l1hdr.b_refcnt, tag);
>  		buf->b_hdr = nhdr;
>  
>  		mutex_exit(&buf->b_evict_lock);
> diff --git a/zfs/module/zfs/dbuf.c b/zfs/module/zfs/dbuf.c
> index 4ee121f5a5fb..c6e72d2c3c81 100644
> --- a/zfs/module/zfs/dbuf.c
> +++ b/zfs/module/zfs/dbuf.c
> @@ -104,7 +104,7 @@ static boolean_t dbuf_evict_thread_exit;
>   * become eligible for arc eviction.
>   */
>  static multilist_t *dbuf_cache;
> -static refcount_t dbuf_cache_size;
> +static zfs_refcount_t dbuf_cache_size;
>  unsigned long  dbuf_cache_max_bytes = 100 * 1024 * 1024;
>  
>  /* Cap the size of the dbuf cache to log2 fraction of arc size. */
> @@ -2381,7 +2381,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid,
>  
>  	ASSERT(dn->dn_object == DMU_META_DNODE_OBJECT ||
>  	    refcount_count(&dn->dn_holds) > 0);
> -	(void) refcount_add(&dn->dn_holds, db);
> +	(void) zfs_refcount_add(&dn->dn_holds, db);
>  	atomic_inc_32(&dn->dn_dbufs_count);
>  
>  	dprintf_dbuf(db, "db=%p\n", db);
> @@ -2746,7 +2746,7 @@ __dbuf_hold_impl(struct dbuf_hold_impl_data *dh)
>  		(void) refcount_remove_many(&dbuf_cache_size,
>  		    dh->dh_db->db.db_size, dh->dh_db);
>  	}
> -	(void) refcount_add(&dh->dh_db->db_holds, dh->dh_tag);
> +	(void) zfs_refcount_add(&dh->dh_db->db_holds, dh->dh_tag);
>  	DBUF_VERIFY(dh->dh_db);
>  	mutex_exit(&dh->dh_db->db_mtx);
>  
> @@ -2870,7 +2870,7 @@ dbuf_rm_spill(dnode_t *dn, dmu_tx_t *tx)
>  void
>  dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
>  {
> -	int64_t holds = refcount_add(&db->db_holds, tag);
> +	int64_t holds = zfs_refcount_add(&db->db_holds, tag);
>  	VERIFY3S(holds, >, 1);
>  }
>  
> @@ -2890,7 +2890,7 @@ dbuf_try_add_ref(dmu_buf_t *db_fake, objset_t *os, uint64_t obj, uint64_t blkid,
>  
>  	if (found_db != NULL) {
>  		if (db == found_db && dbuf_refcount(db) > db->db_dirtycnt) {
> -			(void) refcount_add(&db->db_holds, tag);
> +			(void) zfs_refcount_add(&db->db_holds, tag);
>  			result = B_TRUE;
>  		}
>  		mutex_exit(&found_db->db_mtx);
> diff --git a/zfs/module/zfs/dmu.c b/zfs/module/zfs/dmu.c
> index 05c9fc31fa5f..fdb707bf676d 100644
> --- a/zfs/module/zfs/dmu.c
> +++ b/zfs/module/zfs/dmu.c
> @@ -342,7 +342,7 @@ dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **dbp)
>  	db = dn->dn_bonus;
>  
>  	/* as long as the bonus buf is held, the dnode will be held */
> -	if (refcount_add(&db->db_holds, tag) == 1) {
> +	if (zfs_refcount_add(&db->db_holds, tag) == 1) {
>  		VERIFY(dnode_add_ref(dn, db));
>  		atomic_inc_32(&dn->dn_dbufs_count);
>  	}
> diff --git a/zfs/module/zfs/dmu_object.c b/zfs/module/zfs/dmu_object.c
> index e7412b7509f4..40c25362ae4f 100644
> --- a/zfs/module/zfs/dmu_object.c
> +++ b/zfs/module/zfs/dmu_object.c
> @@ -249,7 +249,7 @@ dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot,
>      int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx)
>  {
>  	return (dmu_object_reclaim_dnsize(os, object, ot, blocksize, bonustype,
> -	    bonuslen, 0, tx));
> +	    bonuslen, DNODE_MIN_SIZE, tx));
>  }
>  
>  int
> @@ -261,6 +261,9 @@ dmu_object_reclaim_dnsize(objset_t *os, uint64_t object, dmu_object_type_t ot,
>  	int dn_slots = dnodesize >> DNODE_SHIFT;
>  	int err;
>  
> +	if (dn_slots == 0)
> +		dn_slots = DNODE_MIN_SLOTS;
> +
>  	if (object == DMU_META_DNODE_OBJECT)
>  		return (SET_ERROR(EBADF));
>  
> @@ -275,7 +278,6 @@ dmu_object_reclaim_dnsize(objset_t *os, uint64_t object, dmu_object_type_t ot,
>  	return (err);
>  }
>  
> -
>  int
>  dmu_object_free(objset_t *os, uint64_t object, dmu_tx_t *tx)
>  {
> diff --git a/zfs/module/zfs/dmu_send.c b/zfs/module/zfs/dmu_send.c
> index a678adf6b8ec..47bf869bf40a 100644
> --- a/zfs/module/zfs/dmu_send.c
> +++ b/zfs/module/zfs/dmu_send.c
> @@ -2144,6 +2144,8 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
>  	dmu_tx_t *tx;
>  	uint64_t object;
>  	int err;
> +	uint8_t dn_slots = drro->drr_dn_slots != 0 ?
> +	    drro->drr_dn_slots : DNODE_MIN_SLOTS;
>  
>  	if (drro->drr_type == DMU_OT_NONE ||
>  	    !DMU_OT_IS_VALID(drro->drr_type) ||
> @@ -2155,16 +2157,14 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
>  	    drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(rwa->os)) ||
>  	    drro->drr_bonuslen >
>  	    DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os))) ||
> -	    drro->drr_dn_slots >
> +	    dn_slots >
>  	    (spa_maxdnodesize(dmu_objset_spa(rwa->os)) >> DNODE_SHIFT))  {
>  		return (SET_ERROR(EINVAL));
>  	}
>  
>  	err = dmu_object_info(rwa->os, drro->drr_object, &doi);
> -
> -	if (err != 0 && err != ENOENT)
> +	if (err != 0 && err != ENOENT && err != EEXIST)
>  		return (SET_ERROR(EINVAL));
> -	object = err == 0 ? drro->drr_object : DMU_NEW_OBJECT;
>  
>  	if (drro->drr_object > rwa->max_object)
>  		rwa->max_object = drro->drr_object;
> @@ -2180,13 +2180,75 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
>  		nblkptr = deduce_nblkptr(drro->drr_bonustype,
>  		    drro->drr_bonuslen);
>  
> +		object = drro->drr_object;
> +
>  		if (drro->drr_blksz != doi.doi_data_block_size ||
> -		    nblkptr < doi.doi_nblkptr) {
> +		    nblkptr < doi.doi_nblkptr ||
> +		    dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) {
>  			err = dmu_free_long_range(rwa->os, drro->drr_object,
>  			    0, DMU_OBJECT_END);
>  			if (err != 0)
>  				return (SET_ERROR(EINVAL));
>  		}
> +
> +		/*
> +		 * The dmu does not currently support decreasing nlevels
> +		 * on an object. For non-raw sends, this does not matter
> +		 * and the new object can just use the previous one's nlevels.
> +		 * For raw sends, however, the structure of the received dnode
> +		 * (including nlevels) must match that of the send side.
> +		 * Therefore, instead of using dmu_object_reclaim(), we must
> +		 * free the object completely and call dmu_object_claim_dnsize()
> +		 * instead.
> +		 */
> +		if (dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) {
> +			err = dmu_free_long_object(rwa->os, drro->drr_object);
> +			if (err != 0)
> +				return (SET_ERROR(EINVAL));
> +
> +			txg_wait_synced(dmu_objset_pool(rwa->os), 0);
> +			object = DMU_NEW_OBJECT;
> +		}
> +	} else if (err == EEXIST) {
> +		/*
> +		 * The object requested is currently an interior slot of a
> +		 * multi-slot dnode. This will be resolved when the next txg
> +		 * is synced out, since the send stream will have told us
> +		 * to free this slot when we freed the associated dnode
> +		 * earlier in the stream.
> +		 */
> +		txg_wait_synced(dmu_objset_pool(rwa->os), 0);
> +		object = drro->drr_object;
> +	} else {
> +		/* object is free and we are about to allocate a new one */
> +		object = DMU_NEW_OBJECT;
> +	}
> +
> +	/*
> +	 * If this is a multi-slot dnode there is a chance that this
> +	 * object will expand into a slot that is already used by
> +	 * another object from the previous snapshot. We must free
> +	 * these objects before we attempt to allocate the new dnode.
> +	 */
> +	if (dn_slots > 1) {
> +		for (uint64_t slot = drro->drr_object + 1;
> +		    slot < drro->drr_object + dn_slots;
> +		    slot++) {
> +			dmu_object_info_t slot_doi;
> +
> +			err = dmu_object_info(rwa->os, slot, &slot_doi);
> +			if (err == ENOENT || err == EEXIST)
> +				continue;
> +			else if (err != 0)
> +				return (err);
> +
> +			err = dmu_free_long_object(rwa->os, slot);
> +
> +			if (err != 0)
> +				return (err);
> +		}
> +
> +		txg_wait_synced(dmu_objset_pool(rwa->os), 0);
>  	}
>  
>  	tx = dmu_tx_create(rwa->os);
> @@ -2202,15 +2264,16 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
>  		err = dmu_object_claim_dnsize(rwa->os, drro->drr_object,
>  		    drro->drr_type, drro->drr_blksz,
>  		    drro->drr_bonustype, drro->drr_bonuslen,
> -		    drro->drr_dn_slots << DNODE_SHIFT, tx);
> +		    dn_slots << DNODE_SHIFT, tx);
>  	} else if (drro->drr_type != doi.doi_type ||
>  	    drro->drr_blksz != doi.doi_data_block_size ||
>  	    drro->drr_bonustype != doi.doi_bonus_type ||
>  	    drro->drr_bonuslen != doi.doi_bonus_size) {
>  		/* currently allocated, but with different properties */
> -		err = dmu_object_reclaim(rwa->os, drro->drr_object,
> +		err = dmu_object_reclaim_dnsize(rwa->os, drro->drr_object,
>  		    drro->drr_type, drro->drr_blksz,
> -		    drro->drr_bonustype, drro->drr_bonuslen, tx);
> +		    drro->drr_bonustype, drro->drr_bonuslen,
> +		    dn_slots << DNODE_SHIFT, tx);
>  	}
>  	if (err != 0) {
>  		dmu_tx_commit(tx);
> @@ -2737,7 +2800,7 @@ receive_read_record(struct receive_arg *ra)
>  		 * See receive_read_prefetch for an explanation why we're
>  		 * storing this object in the ignore_obj_list.
>  		 */
> -		if (err == ENOENT ||
> +		if (err == ENOENT || err == EEXIST ||
>  		    (err == 0 && doi.doi_data_block_size != drro->drr_blksz)) {
>  			objlist_insert(&ra->ignore_objlist, drro->drr_object);
>  			err = 0;
> diff --git a/zfs/module/zfs/dmu_tx.c b/zfs/module/zfs/dmu_tx.c
> index c3cc03a691a7..b1508ffac7df 100644
> --- a/zfs/module/zfs/dmu_tx.c
> +++ b/zfs/module/zfs/dmu_tx.c
> @@ -114,7 +114,7 @@ dmu_tx_hold_dnode_impl(dmu_tx_t *tx, dnode_t *dn, enum dmu_tx_hold_type type,
>  	dmu_tx_hold_t *txh;
>  
>  	if (dn != NULL) {
> -		(void) refcount_add(&dn->dn_holds, tx);
> +		(void) zfs_refcount_add(&dn->dn_holds, tx);
>  		if (tx->tx_txg != 0) {
>  			mutex_enter(&dn->dn_mtx);
>  			/*
> @@ -124,7 +124,7 @@ dmu_tx_hold_dnode_impl(dmu_tx_t *tx, dnode_t *dn, enum dmu_tx_hold_type type,
>  			 */
>  			ASSERT(dn->dn_assigned_txg == 0);
>  			dn->dn_assigned_txg = tx->tx_txg;
> -			(void) refcount_add(&dn->dn_tx_holds, tx);
> +			(void) zfs_refcount_add(&dn->dn_tx_holds, tx);
>  			mutex_exit(&dn->dn_mtx);
>  		}
>  	}
> @@ -854,7 +854,7 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
>   * decreasing performance.
>   */
>  static int
> -dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
> +dmu_tx_try_assign(dmu_tx_t *tx, uint64_t txg_how)
>  {
>  	spa_t *spa = tx->tx_pool->dp_spa;
>  
> @@ -878,13 +878,13 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
>  		 * of the failuremode setting.
>  		 */
>  		if (spa_get_failmode(spa) == ZIO_FAILURE_MODE_CONTINUE &&
> -		    txg_how != TXG_WAIT)
> +		    !(txg_how & TXG_WAIT))
>  			return (SET_ERROR(EIO));
>  
>  		return (SET_ERROR(ERESTART));
>  	}
>  
> -	if (!tx->tx_waited &&
> +	if (!tx->tx_dirty_delayed &&
>  	    dsl_pool_need_dirty_delay(tx->tx_pool)) {
>  		tx->tx_wait_dirty = B_TRUE;
>  		DMU_TX_STAT_BUMP(dmu_tx_dirty_delay);
> @@ -916,7 +916,7 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
>  			if (dn->dn_assigned_txg == 0)
>  				dn->dn_assigned_txg = tx->tx_txg;
>  			ASSERT3U(dn->dn_assigned_txg, ==, tx->tx_txg);
> -			(void) refcount_add(&dn->dn_tx_holds, tx);
> +			(void) zfs_refcount_add(&dn->dn_tx_holds, tx);
>  			mutex_exit(&dn->dn_mtx);
>  		}
>  		towrite += refcount_count(&txh->txh_space_towrite);
> @@ -976,41 +976,44 @@ dmu_tx_unassign(dmu_tx_t *tx)
>  }
>  
>  /*
> - * Assign tx to a transaction group.  txg_how can be one of:
> + * Assign tx to a transaction group; txg_how is a bitmask:
>   *
> - * (1)	TXG_WAIT.  If the current open txg is full, waits until there's
> - *	a new one.  This should be used when you're not holding locks.
> - *	It will only fail if we're truly out of space (or over quota).
> + * If TXG_WAIT is set and the currently open txg is full, this function
> + * will wait until there's a new txg. This should be used when no locks
> + * are being held. With this bit set, this function will only fail if
> + * we're truly out of space (or over quota).
>   *
> - * (2)	TXG_NOWAIT.  If we can't assign into the current open txg without
> - *	blocking, returns immediately with ERESTART.  This should be used
> - *	whenever you're holding locks.  On an ERESTART error, the caller
> - *	should drop locks, do a dmu_tx_wait(tx), and try again.
> + * If TXG_WAIT is *not* set and we can't assign into the currently open
> + * txg without blocking, this function will return immediately with
> + * ERESTART. This should be used whenever locks are being held.  On an
> + * ERESTART error, the caller should drop all locks, call dmu_tx_wait(),
> + * and try again.
>   *
> - * (3)	TXG_WAITED.  Like TXG_NOWAIT, but indicates that dmu_tx_wait()
> - *	has already been called on behalf of this operation (though
> - *	most likely on a different tx).
> + * If TXG_NOTHROTTLE is set, this indicates that this tx should not be
> + * delayed due on the ZFS Write Throttle (see comments in dsl_pool.c for
> + * details on the throttle). This is used by the VFS operations, after
> + * they have already called dmu_tx_wait() (though most likely on a
> + * different tx).
>   */
>  int
> -dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
> +dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how)
>  {
>  	int err;
>  
>  	ASSERT(tx->tx_txg == 0);
> -	ASSERT(txg_how == TXG_WAIT || txg_how == TXG_NOWAIT ||
> -	    txg_how == TXG_WAITED);
> +	ASSERT0(txg_how & ~(TXG_WAIT | TXG_NOTHROTTLE));
>  	ASSERT(!dsl_pool_sync_context(tx->tx_pool));
>  
> -	if (txg_how == TXG_WAITED)
> -		tx->tx_waited = B_TRUE;
> -
>  	/* If we might wait, we must not hold the config lock. */
> -	ASSERT(txg_how != TXG_WAIT || !dsl_pool_config_held(tx->tx_pool));
> +	IMPLY((txg_how & TXG_WAIT), !dsl_pool_config_held(tx->tx_pool));
> +
> +	if ((txg_how & TXG_NOTHROTTLE))
> +		tx->tx_dirty_delayed = B_TRUE;
>  
>  	while ((err = dmu_tx_try_assign(tx, txg_how)) != 0) {
>  		dmu_tx_unassign(tx);
>  
> -		if (err != ERESTART || txg_how != TXG_WAIT)
> +		if (err != ERESTART || !(txg_how & TXG_WAIT))
>  			return (err);
>  
>  		dmu_tx_wait(tx);
> @@ -1054,12 +1057,12 @@ dmu_tx_wait(dmu_tx_t *tx)
>  		tx->tx_wait_dirty = B_FALSE;
>  
>  		/*
> -		 * Note: setting tx_waited only has effect if the caller
> -		 * used TX_WAIT.  Otherwise they are going to destroy
> -		 * this tx and try again.  The common case, zfs_write(),
> -		 * uses TX_WAIT.
> +		 * Note: setting tx_dirty_delayed only has effect if the
> +		 * caller used TX_WAIT.  Otherwise they are going to
> +		 * destroy this tx and try again.  The common case,
> +		 * zfs_write(), uses TX_WAIT.
>  		 */
> -		tx->tx_waited = B_TRUE;
> +		tx->tx_dirty_delayed = B_TRUE;
>  	} else if (spa_suspended(spa) || tx->tx_lasttried_txg == 0) {
>  		/*
>  		 * If the pool is suspended we need to wait until it
> diff --git a/zfs/module/zfs/dnode.c b/zfs/module/zfs/dnode.c
> index e05a4d0a5538..1360ea1681d8 100644
> --- a/zfs/module/zfs/dnode.c
> +++ b/zfs/module/zfs/dnode.c
> @@ -55,6 +55,7 @@ dnode_stats_t dnode_stats = {
>  	{ "dnode_hold_free_overflow",		KSTAT_DATA_UINT64 },
>  	{ "dnode_hold_free_refcount",		KSTAT_DATA_UINT64 },
>  	{ "dnode_hold_free_txg",		KSTAT_DATA_UINT64 },
> +	{ "dnode_free_interior_lock_retry",	KSTAT_DATA_UINT64 },
>  	{ "dnode_allocate",			KSTAT_DATA_UINT64 },
>  	{ "dnode_reallocate",			KSTAT_DATA_UINT64 },
>  	{ "dnode_buf_evict",			KSTAT_DATA_UINT64 },
> @@ -516,7 +517,8 @@ dnode_destroy(dnode_t *dn)
>  	mutex_exit(&os->os_lock);
>  
>  	/* the dnode can no longer move, so we can release the handle */
> -	zrl_remove(&dn->dn_handle->dnh_zrlock);
> +	if (!zrl_is_locked(&dn->dn_handle->dnh_zrlock))
> +		zrl_remove(&dn->dn_handle->dnh_zrlock);
>  
>  	dn->dn_allocated_txg = 0;
>  	dn->dn_free_txg = 0;
> @@ -660,8 +662,9 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
>  	ASSERT(DMU_OT_IS_VALID(bonustype));
>  	ASSERT3U(bonuslen, <=,
>  	    DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(dn->dn_objset))));
> +	ASSERT3U(bonuslen, <=, DN_BONUS_SIZE(dn_slots << DNODE_SHIFT));
>  
> -	dn_slots = dn_slots > 0 ? dn_slots : DNODE_MIN_SLOTS;
> +	dnode_free_interior_slots(dn);
>  	DNODE_STAT_BUMP(dnode_reallocate);
>  
>  	/* clean up any unreferenced dbufs */
> @@ -1062,19 +1065,73 @@ dnode_set_slots(dnode_children_t *children, int idx, int slots, void *ptr)
>  }
>  
>  static boolean_t
> -dnode_check_slots(dnode_children_t *children, int idx, int slots, void *ptr)
> +dnode_check_slots_free(dnode_children_t *children, int idx, int slots)
>  {
>  	ASSERT3S(idx + slots, <=, DNODES_PER_BLOCK);
>  
>  	for (int i = idx; i < idx + slots; i++) {
>  		dnode_handle_t *dnh = &children->dnc_children[i];
> -		if (dnh->dnh_dnode != ptr)
> +		dnode_t *dn = dnh->dnh_dnode;
> +
> +		if (dn == DN_SLOT_FREE) {
> +			continue;
> +		} else if (DN_SLOT_IS_PTR(dn)) {
> +			mutex_enter(&dn->dn_mtx);
> +			dmu_object_type_t type = dn->dn_type;
> +			mutex_exit(&dn->dn_mtx);
> +
> +			if (type != DMU_OT_NONE)
> +				return (B_FALSE);
> +
> +			continue;
> +		} else {
>  			return (B_FALSE);
> +		}
> +
> +		return (B_FALSE);
>  	}
>  
>  	return (B_TRUE);
>  }
>  
> +static void
> +dnode_reclaim_slots(dnode_children_t *children, int idx, int slots)
> +{
> +	ASSERT3S(idx + slots, <=, DNODES_PER_BLOCK);
> +
> +	for (int i = idx; i < idx + slots; i++) {
> +		dnode_handle_t *dnh = &children->dnc_children[i];
> +
> +		ASSERT(zrl_is_locked(&dnh->dnh_zrlock));
> +
> +		if (DN_SLOT_IS_PTR(dnh->dnh_dnode)) {
> +			ASSERT3S(dnh->dnh_dnode->dn_type, ==, DMU_OT_NONE);
> +			dnode_destroy(dnh->dnh_dnode);
> +			dnh->dnh_dnode = DN_SLOT_FREE;
> +		}
> +	}
> +}
> +
> +void
> +dnode_free_interior_slots(dnode_t *dn)
> +{
> +	dnode_children_t *children = dmu_buf_get_user(&dn->dn_dbuf->db);
> +	int epb = dn->dn_dbuf->db.db_size >> DNODE_SHIFT;
> +	int idx = (dn->dn_object & (epb - 1)) + 1;
> +	int slots = dn->dn_num_slots - 1;
> +
> +	if (slots == 0)
> +		return;
> +
> +	ASSERT3S(idx + slots, <=, DNODES_PER_BLOCK);
> +
> +	while (!dnode_slots_tryenter(children, idx, slots))
> +		DNODE_STAT_BUMP(dnode_free_interior_lock_retry);
> +
> +	dnode_set_slots(children, idx, slots, DN_SLOT_FREE);
> +	dnode_slots_rele(children, idx, slots);
> +}
> +
>  void
>  dnode_special_close(dnode_handle_t *dnh)
>  {
> @@ -1201,7 +1258,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots,
>  		if ((flag & DNODE_MUST_BE_FREE) && type != DMU_OT_NONE)
>  			return (SET_ERROR(EEXIST));
>  		DNODE_VERIFY(dn);
> -		(void) refcount_add(&dn->dn_holds, tag);
> +		(void) zfs_refcount_add(&dn->dn_holds, tag);
>  		*dnp = dn;
>  		return (0);
>  	}
> @@ -1355,7 +1412,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots,
>  		while (dn == DN_SLOT_UNINIT) {
>  			dnode_slots_hold(dnc, idx, slots);
>  
> -			if (!dnode_check_slots(dnc, idx, slots, DN_SLOT_FREE)) {
> +			if (!dnode_check_slots_free(dnc, idx, slots)) {
>  				DNODE_STAT_BUMP(dnode_hold_free_misses);
>  				dnode_slots_rele(dnc, idx, slots);
>  				dbuf_rele(db, FTAG);
> @@ -1368,15 +1425,29 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots,
>  				continue;
>  			}
>  
> -			if (!dnode_check_slots(dnc, idx, slots, DN_SLOT_FREE)) {
> +			if (!dnode_check_slots_free(dnc, idx, slots)) {
>  				DNODE_STAT_BUMP(dnode_hold_free_lock_misses);
>  				dnode_slots_rele(dnc, idx, slots);
>  				dbuf_rele(db, FTAG);
>  				return (SET_ERROR(ENOSPC));
>  			}
>  
> +			/*
> +			 * Allocated but otherwise free dnodes which would
> +			 * be in the interior of a multi-slot dnodes need
> +			 * to be freed.  Single slot dnodes can be safely
> +			 * re-purposed as a performance optimization.
> +			 */
> +			if (slots > 1)
> +				dnode_reclaim_slots(dnc, idx + 1, slots - 1);
> +
>  			dnh = &dnc->dnc_children[idx];
> -			dn = dnode_create(os, dn_block + idx, db, object, dnh);
> +			if (DN_SLOT_IS_PTR(dnh->dnh_dnode)) {
> +				dn = dnh->dnh_dnode;
> +			} else {
> +				dn = dnode_create(os, dn_block + idx, db,
> +				    object, dnh);
> +			}
>  		}
>  
>  		mutex_enter(&dn->dn_mtx);
> @@ -1404,7 +1475,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots,
>  		return (type == DMU_OT_NONE ? ENOENT : EEXIST);
>  	}
>  
> -	if (refcount_add(&dn->dn_holds, tag) == 1)
> +	if (zfs_refcount_add(&dn->dn_holds, tag) == 1)
>  		dbuf_add_ref(db, dnh);
>  
>  	mutex_exit(&dn->dn_mtx);
> @@ -1444,7 +1515,7 @@ dnode_add_ref(dnode_t *dn, void *tag)
>  		mutex_exit(&dn->dn_mtx);
>  		return (FALSE);
>  	}
> -	VERIFY(1 < refcount_add(&dn->dn_holds, tag));
> +	VERIFY(1 < zfs_refcount_add(&dn->dn_holds, tag));
>  	mutex_exit(&dn->dn_mtx);
>  	return (TRUE);
>  }
> diff --git a/zfs/module/zfs/dnode_sync.c b/zfs/module/zfs/dnode_sync.c
> index 742d962bc232..8d65e3856492 100644
> --- a/zfs/module/zfs/dnode_sync.c
> +++ b/zfs/module/zfs/dnode_sync.c
> @@ -533,6 +533,7 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *tx)
>  	if (dn->dn_allocated_txg != dn->dn_free_txg)
>  		dmu_buf_will_dirty(&dn->dn_dbuf->db, tx);
>  	bzero(dn->dn_phys, sizeof (dnode_phys_t) * dn->dn_num_slots);
> +	dnode_free_interior_slots(dn);
>  
>  	mutex_enter(&dn->dn_mtx);
>  	dn->dn_type = DMU_OT_NONE;
> @@ -540,6 +541,7 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *tx)
>  	dn->dn_allocated_txg = 0;
>  	dn->dn_free_txg = 0;
>  	dn->dn_have_spill = B_FALSE;
> +	dn->dn_num_slots = 1;
>  	mutex_exit(&dn->dn_mtx);
>  
>  	ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT);
> diff --git a/zfs/module/zfs/dsl_dataset.c b/zfs/module/zfs/dsl_dataset.c
> index bd03b486858b..b7562bcda47b 100644
> --- a/zfs/module/zfs/dsl_dataset.c
> +++ b/zfs/module/zfs/dsl_dataset.c
> @@ -645,7 +645,7 @@ void
>  dsl_dataset_long_hold(dsl_dataset_t *ds, void *tag)
>  {
>  	ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
> -	(void) refcount_add(&ds->ds_longholds, tag);
> +	(void) zfs_refcount_add(&ds->ds_longholds, tag);
>  }
>  
>  void
> diff --git a/zfs/module/zfs/metaslab.c b/zfs/module/zfs/metaslab.c
> index 5e413c06518b..40658d516842 100644
> --- a/zfs/module/zfs/metaslab.c
> +++ b/zfs/module/zfs/metaslab.c
> @@ -1049,11 +1049,11 @@ metaslab_rt_vacate(range_tree_t *rt, void *arg)
>  }
>  
>  static range_tree_ops_t metaslab_rt_ops = {
> -	metaslab_rt_create,
> -	metaslab_rt_destroy,
> -	metaslab_rt_add,
> -	metaslab_rt_remove,
> -	metaslab_rt_vacate
> +	.rtop_create = metaslab_rt_create,
> +	.rtop_destroy = metaslab_rt_destroy,
> +	.rtop_add = metaslab_rt_add,
> +	.rtop_remove = metaslab_rt_remove,
> +	.rtop_vacate = metaslab_rt_vacate
>  };
>  
>  /*
> @@ -2663,7 +2663,7 @@ metaslab_group_alloc_increment(spa_t *spa, uint64_t vdev, void *tag, int flags)
>  	if (!mg->mg_class->mc_alloc_throttle_enabled)
>  		return;
>  
> -	(void) refcount_add(&mg->mg_alloc_queue_depth, tag);
> +	(void) zfs_refcount_add(&mg->mg_alloc_queue_depth, tag);
>  }
>  
>  void
> @@ -3360,7 +3360,7 @@ metaslab_class_throttle_reserve(metaslab_class_t *mc, int slots, zio_t *zio,
>  		 * them individually when an I/O completes.
>  		 */
>  		for (d = 0; d < slots; d++) {
> -			reserved_slots = refcount_add(&mc->mc_alloc_slots, zio);
> +			reserved_slots = zfs_refcount_add(&mc->mc_alloc_slots, zio);
>  		}
>  		zio->io_flags |= ZIO_FLAG_IO_ALLOCATING;
>  		slot_reserved = B_TRUE;
> diff --git a/zfs/module/zfs/mmp.c b/zfs/module/zfs/mmp.c
> index 1ae5f31fd62b..7523310cd7bd 100644
> --- a/zfs/module/zfs/mmp.c
> +++ b/zfs/module/zfs/mmp.c
> @@ -327,7 +327,7 @@ mmp_delay_update(spa_t *spa, boolean_t write_completed)
>  	 */
>  	if (delay < mts->mmp_delay) {
>  		hrtime_t min_delay = MSEC2NSEC(zfs_multihost_interval) /
> -		    vdev_count_leaves(spa);
> +		    MAX(1, vdev_count_leaves(spa));
>  		mts->mmp_delay = MAX(((delay + mts->mmp_delay * 127) / 128),
>  		    min_delay);
>  	}
> @@ -607,7 +607,8 @@ param_set_multihost_interval(const char *val, zfs_kernel_param_t *kp)
>  	if (ret < 0)
>  		return (ret);
>  
> -	mmp_signal_all_threads();
> +	if (spa_mode_global != 0)
> +		mmp_signal_all_threads();
>  
>  	return (ret);
>  }
> diff --git a/zfs/module/zfs/refcount.c b/zfs/module/zfs/refcount.c
> index a151aceaecfb..13f9bb6b76e3 100644
> --- a/zfs/module/zfs/refcount.c
> +++ b/zfs/module/zfs/refcount.c
> @@ -55,7 +55,7 @@ refcount_fini(void)
>  }
>  
>  void
> -refcount_create(refcount_t *rc)
> +refcount_create(zfs_refcount_t *rc)
>  {
>  	mutex_init(&rc->rc_mtx, NULL, MUTEX_DEFAULT, NULL);
>  	list_create(&rc->rc_list, sizeof (reference_t),
> @@ -68,21 +68,21 @@ refcount_create(refcount_t *rc)
>  }
>  
>  void
> -refcount_create_tracked(refcount_t *rc)
> +refcount_create_tracked(zfs_refcount_t *rc)
>  {
>  	refcount_create(rc);
>  	rc->rc_tracked = B_TRUE;
>  }
>  
>  void
> -refcount_create_untracked(refcount_t *rc)
> +refcount_create_untracked(zfs_refcount_t *rc)
>  {
>  	refcount_create(rc);
>  	rc->rc_tracked = B_FALSE;
>  }
>  
>  void
> -refcount_destroy_many(refcount_t *rc, uint64_t number)
> +refcount_destroy_many(zfs_refcount_t *rc, uint64_t number)
>  {
>  	reference_t *ref;
>  
> @@ -103,25 +103,25 @@ refcount_destroy_many(refcount_t *rc, uint64_t number)
>  }
>  
>  void
> -refcount_destroy(refcount_t *rc)
> +refcount_destroy(zfs_refcount_t *rc)
>  {
>  	refcount_destroy_many(rc, 0);
>  }
>  
>  int
> -refcount_is_zero(refcount_t *rc)
> +refcount_is_zero(zfs_refcount_t *rc)
>  {
>  	return (rc->rc_count == 0);
>  }
>  
>  int64_t
> -refcount_count(refcount_t *rc)
> +refcount_count(zfs_refcount_t *rc)
>  {
>  	return (rc->rc_count);
>  }
>  
>  int64_t
> -refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
> +refcount_add_many(zfs_refcount_t *rc, uint64_t number, void *holder)
>  {
>  	reference_t *ref = NULL;
>  	int64_t count;
> @@ -143,13 +143,13 @@ refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
>  }
>  
>  int64_t
> -zfs_refcount_add(refcount_t *rc, void *holder)
> +zfs_refcount_add(zfs_refcount_t *rc, void *holder)
>  {
>  	return (refcount_add_many(rc, 1, holder));
>  }
>  
>  int64_t
> -refcount_remove_many(refcount_t *rc, uint64_t number, void *holder)
> +refcount_remove_many(zfs_refcount_t *rc, uint64_t number, void *holder)
>  {
>  	reference_t *ref;
>  	int64_t count;
> @@ -197,13 +197,13 @@ refcount_remove_many(refcount_t *rc, uint64_t number, void *holder)
>  }
>  
>  int64_t
> -refcount_remove(refcount_t *rc, void *holder)
> +refcount_remove(zfs_refcount_t *rc, void *holder)
>  {
>  	return (refcount_remove_many(rc, 1, holder));
>  }
>  
>  void
> -refcount_transfer(refcount_t *dst, refcount_t *src)
> +refcount_transfer(zfs_refcount_t *dst, zfs_refcount_t *src)
>  {
>  	int64_t count, removed_count;
>  	list_t list, removed;
> @@ -234,7 +234,7 @@ refcount_transfer(refcount_t *dst, refcount_t *src)
>  }
>  
>  void
> -refcount_transfer_ownership(refcount_t *rc, void *current_holder,
> +refcount_transfer_ownership(zfs_refcount_t *rc, void *current_holder,
>      void *new_holder)
>  {
>  	reference_t *ref;
> @@ -264,7 +264,7 @@ refcount_transfer_ownership(refcount_t *rc, void *current_holder,
>   * might be held.
>   */
>  boolean_t
> -refcount_held(refcount_t *rc, void *holder)
> +refcount_held(zfs_refcount_t *rc, void *holder)
>  {
>  	reference_t *ref;
>  
> @@ -292,7 +292,7 @@ refcount_held(refcount_t *rc, void *holder)
>   * since the reference might not be held.
>   */
>  boolean_t
> -refcount_not_held(refcount_t *rc, void *holder)
> +refcount_not_held(zfs_refcount_t *rc, void *holder)
>  {
>  	reference_t *ref;
>  
> diff --git a/zfs/module/zfs/rrwlock.c b/zfs/module/zfs/rrwlock.c
> index 704f76067bf0..effff3305224 100644
> --- a/zfs/module/zfs/rrwlock.c
> +++ b/zfs/module/zfs/rrwlock.c
> @@ -183,9 +183,9 @@ rrw_enter_read_impl(rrwlock_t *rrl, boolean_t prio, void *tag)
>  	if (rrl->rr_writer_wanted || rrl->rr_track_all) {
>  		/* may or may not be a re-entrant enter */
>  		rrn_add(rrl, tag);
> -		(void) refcount_add(&rrl->rr_linked_rcount, tag);
> +		(void) zfs_refcount_add(&rrl->rr_linked_rcount, tag);
>  	} else {
> -		(void) refcount_add(&rrl->rr_anon_rcount, tag);
> +		(void) zfs_refcount_add(&rrl->rr_anon_rcount, tag);
>  	}
>  	ASSERT(rrl->rr_writer == NULL);
>  	mutex_exit(&rrl->rr_lock);
> diff --git a/zfs/module/zfs/sa.c b/zfs/module/zfs/sa.c
> index 8046dbde28ad..df4f6fd8529c 100644
> --- a/zfs/module/zfs/sa.c
> +++ b/zfs/module/zfs/sa.c
> @@ -147,21 +147,26 @@ arc_byteswap_func_t sa_bswap_table[] = {
>  	zfs_acl_byteswap,
>  };
>  
> -#define	SA_COPY_DATA(f, s, t, l) \
> -	{ \
> -		if (f == NULL) { \
> -			if (l == 8) { \
> -				*(uint64_t *)t = *(uint64_t *)s; \
> -			} else if (l == 16) { \
> -				*(uint64_t *)t = *(uint64_t *)s; \
> -				*(uint64_t *)((uintptr_t)t + 8) = \
> -				    *(uint64_t *)((uintptr_t)s + 8); \
> -			} else { \
> -				bcopy(s, t, l); \
> -			} \
> -		} else \
> -			sa_copy_data(f, s, t, l); \
> -	}
> +#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
> +#define	SA_COPY_DATA(f, s, t, l)				\
> +do {								\
> +	if (f == NULL) {					\
> +		if (l == 8) {					\
> +			*(uint64_t *)t = *(uint64_t *)s;	\
> +		} else if (l == 16) {				\
> +			*(uint64_t *)t = *(uint64_t *)s;	\
> +			*(uint64_t *)((uintptr_t)t + 8) =	\
> +			    *(uint64_t *)((uintptr_t)s + 8);	\
> +		} else {					\
> +			bcopy(s, t, l);				\
> +		}						\
> +	} else {						\
> +		sa_copy_data(f, s, t, l);			\
> +	}							\
> +} while (0)
> +#else
> +#define	SA_COPY_DATA(f, s, t, l)	sa_copy_data(f, s, t, l)
> +#endif
>  
>  /*
>   * This table is fixed and cannot be changed.  Its purpose is to
> @@ -1332,7 +1337,7 @@ sa_idx_tab_hold(objset_t *os, sa_idx_tab_t *idx_tab)
>  	ASSERTV(sa_os_t *sa = os->os_sa);
>  
>  	ASSERT(MUTEX_HELD(&sa->sa_lock));
> -	(void) refcount_add(&idx_tab->sa_refcount, NULL);
> +	(void) zfs_refcount_add(&idx_tab->sa_refcount, NULL);
>  }
>  
>  void
> diff --git a/zfs/module/zfs/spa_misc.c b/zfs/module/zfs/spa_misc.c
> index e92c39482455..f6c9b40bd337 100644
> --- a/zfs/module/zfs/spa_misc.c
> +++ b/zfs/module/zfs/spa_misc.c
> @@ -80,7 +80,7 @@
>   *	definition they must have an existing reference, and will never need
>   *	to lookup a spa_t by name.
>   *
> - * spa_refcount (per-spa refcount_t protected by mutex)
> + * spa_refcount (per-spa zfs_refcount_t protected by mutex)
>   *
>   *	This reference count keep track of any active users of the spa_t.  The
>   *	spa_t cannot be destroyed or freed while this is non-zero.  Internally,
> @@ -414,7 +414,7 @@ spa_config_tryenter(spa_t *spa, int locks, void *tag, krw_t rw)
>  			}
>  			scl->scl_writer = curthread;
>  		}
> -		(void) refcount_add(&scl->scl_count, tag);
> +		(void) zfs_refcount_add(&scl->scl_count, tag);
>  		mutex_exit(&scl->scl_lock);
>  	}
>  	return (1);
> @@ -448,7 +448,7 @@ spa_config_enter(spa_t *spa, int locks, void *tag, krw_t rw)
>  			}
>  			scl->scl_writer = curthread;
>  		}
> -		(void) refcount_add(&scl->scl_count, tag);
> +		(void) zfs_refcount_add(&scl->scl_count, tag);
>  		mutex_exit(&scl->scl_lock);
>  	}
>  	ASSERT(wlocks_held <= locks);
> @@ -768,7 +768,7 @@ spa_open_ref(spa_t *spa, void *tag)
>  {
>  	ASSERT(refcount_count(&spa->spa_refcount) >= spa->spa_minref ||
>  	    MUTEX_HELD(&spa_namespace_lock));
> -	(void) refcount_add(&spa->spa_refcount, tag);
> +	(void) zfs_refcount_add(&spa->spa_refcount, tag);
>  }
>  
>  /*
> @@ -2100,6 +2100,45 @@ spa_get_hostid(void)
>  	return (myhostid);
>  }
>  
> +/*
> + * Return the pool state string ("ONLINE", "DEGRADED", "SUSPENDED", etc).
> + */
> +const char *
> +spa_state_to_name(spa_t *spa)
> +{
> +	vdev_state_t state = spa->spa_root_vdev->vdev_state;
> +	vdev_aux_t aux = spa->spa_root_vdev->vdev_stat.vs_aux;
> +
> +	if (spa_suspended(spa) &&
> +	    (spa_get_failmode(spa) != ZIO_FAILURE_MODE_CONTINUE))
> +		return ("SUSPENDED");
> +
> +	switch (state) {
> +	case VDEV_STATE_CLOSED:
> +	case VDEV_STATE_OFFLINE:
> +		return ("OFFLINE");
> +	case VDEV_STATE_REMOVED:
> +		return ("REMOVED");
> +	case VDEV_STATE_CANT_OPEN:
> +		if (aux == VDEV_AUX_CORRUPT_DATA || aux == VDEV_AUX_BAD_LOG)
> +			return ("FAULTED");
> +		else if (aux == VDEV_AUX_SPLIT_POOL)
> +			return ("SPLIT");
> +		else
> +			return ("UNAVAIL");
> +	case VDEV_STATE_FAULTED:
> +		return ("FAULTED");
> +	case VDEV_STATE_DEGRADED:
> +		return ("DEGRADED");
> +	case VDEV_STATE_HEALTHY:
> +		return ("ONLINE");
> +	default:
> +		break;
> +	}
> +
> +	return ("UNKNOWN");
> +}
> +
>  #if defined(_KERNEL) && defined(HAVE_SPL)
>  /* Namespace manipulation */
>  EXPORT_SYMBOL(spa_lookup);
> @@ -2178,6 +2217,7 @@ EXPORT_SYMBOL(spa_is_root);
>  EXPORT_SYMBOL(spa_writeable);
>  EXPORT_SYMBOL(spa_mode);
>  EXPORT_SYMBOL(spa_namespace_lock);
> +EXPORT_SYMBOL(spa_state_to_name);
>  
>  /* BEGIN CSTYLED */
>  module_param(zfs_flags, uint, 0644);
> diff --git a/zfs/module/zfs/spa_stats.c b/zfs/module/zfs/spa_stats.c
> index b726f7f44e19..c349668e8503 100644
> --- a/zfs/module/zfs/spa_stats.c
> +++ b/zfs/module/zfs/spa_stats.c
> @@ -22,6 +22,8 @@
>  #include <sys/zfs_context.h>
>  #include <sys/spa_impl.h>
>  #include <sys/vdev_impl.h>
> +#include <sys/spa.h>
> +#include <zfs_comutil.h>
>  
>  /*
>   * Keeps stats on last N reads per spa_t, disabled by default.
> @@ -997,6 +999,64 @@ spa_mmp_history_add(spa_t *spa, uint64_t txg, uint64_t timestamp,
>  	return ((void *)smh);
>  }
>  
> +static void *
> +spa_state_addr(kstat_t *ksp, loff_t n)
> +{
> +	return (ksp->ks_private);	/* return the spa_t */
> +}
> +
> +static int
> +spa_state_data(char *buf, size_t size, void *data)
> +{
> +	spa_t *spa = (spa_t *)data;
> +	(void) snprintf(buf, size, "%s\n", spa_state_to_name(spa));
> +	return (0);
> +}
> +
> +/*
> + * Return the state of the pool in /proc/spl/kstat/zfs/<pool>/state.
> + *
> + * This is a lock-less read of the pool's state (unlike using 'zpool', which
> + * can potentially block for seconds).  Because it doesn't block, it can useful
> + * as a pool heartbeat value.
> + */
> +static void
> +spa_state_init(spa_t *spa)
> +{
> +	spa_stats_history_t *ssh = &spa->spa_stats.state;
> +	char *name;
> +	kstat_t *ksp;
> +
> +	mutex_init(&ssh->lock, NULL, MUTEX_DEFAULT, NULL);
> +
> +	name = kmem_asprintf("zfs/%s", spa_name(spa));
> +	ksp = kstat_create(name, 0, "state", "misc",
> +	    KSTAT_TYPE_RAW, 0, KSTAT_FLAG_VIRTUAL);
> +
> +	ssh->kstat = ksp;
> +	if (ksp) {
> +		ksp->ks_lock = &ssh->lock;
> +		ksp->ks_data = NULL;
> +		ksp->ks_private = spa;
> +		ksp->ks_flags |= KSTAT_FLAG_NO_HEADERS;
> +		kstat_set_raw_ops(ksp, NULL, spa_state_data, spa_state_addr);
> +		kstat_install(ksp);
> +	}
> +
> +	strfree(name);
> +}
> +
> +static void
> +spa_health_destroy(spa_t *spa)
> +{
> +	spa_stats_history_t *ssh = &spa->spa_stats.state;
> +	kstat_t *ksp = ssh->kstat;
> +	if (ksp)
> +		kstat_delete(ksp);
> +
> +	mutex_destroy(&ssh->lock);
> +}
> +
>  void
>  spa_stats_init(spa_t *spa)
>  {
> @@ -1005,11 +1065,13 @@ spa_stats_init(spa_t *spa)
>  	spa_tx_assign_init(spa);
>  	spa_io_history_init(spa);
>  	spa_mmp_history_init(spa);
> +	spa_state_init(spa);
>  }
>  
>  void
>  spa_stats_destroy(spa_t *spa)
>  {
> +	spa_health_destroy(spa);
>  	spa_tx_assign_destroy(spa);
>  	spa_txg_history_destroy(spa);
>  	spa_read_history_destroy(spa);
> diff --git a/zfs/module/zfs/vdev_disk.c b/zfs/module/zfs/vdev_disk.c
> index aecc3515deab..d4cefc7e1433 100644
> --- a/zfs/module/zfs/vdev_disk.c
> +++ b/zfs/module/zfs/vdev_disk.c
> @@ -27,13 +27,14 @@
>   */
>  
>  #include <sys/zfs_context.h>
> -#include <sys/spa.h>
> +#include <sys/spa_impl.h>
>  #include <sys/vdev_disk.h>
>  #include <sys/vdev_impl.h>
>  #include <sys/abd.h>
>  #include <sys/fs/zfs.h>
>  #include <sys/zio.h>
>  #include <sys/sunldi.h>
> +#include <linux/mod_compat.h>
>  
>  char *zfs_vdev_scheduler = VDEV_SCHEDULER;
>  static void *zfs_vdev_holder = VDEV_HOLDER;
> @@ -113,15 +114,23 @@ vdev_disk_error(zio_t *zio)
>   * physical device.  This yields the largest possible requests for
>   * the device with the lowest total overhead.
>   */
> -static int
> +static void
>  vdev_elevator_switch(vdev_t *v, char *elevator)
>  {
>  	vdev_disk_t *vd = v->vdev_tsd;
> -	struct block_device *bdev = vd->vd_bdev;
> -	struct request_queue *q = bdev_get_queue(bdev);
> -	char *device = bdev->bd_disk->disk_name;
> +	struct request_queue *q;
> +	char *device;
>  	int error;
>  
> +	for (int c = 0; c < v->vdev_children; c++)
> +		vdev_elevator_switch(v->vdev_child[c], elevator);
> +
> +	if (!v->vdev_ops->vdev_op_leaf || vd->vd_bdev == NULL)
> +		return;
> +
> +	q = bdev_get_queue(vd->vd_bdev);
> +	device = vd->vd_bdev->bd_disk->disk_name;
> +
>  	/*
>  	 * Skip devices which are not whole disks (partitions).
>  	 * Device-mapper devices are excepted since they may be whole
> @@ -131,45 +140,39 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
>  	 * "Skip devices without schedulers" check below will fail.
>  	 */
>  	if (!v->vdev_wholedisk && strncmp(device, "dm-", 3) != 0)
> -		return (0);
> -
> -	/* Skip devices without schedulers (loop, ram, dm, etc) */
> -	if (!q->elevator || !blk_queue_stackable(q))
> -		return (0);
> +		return;
>  
>  	/* Leave existing scheduler when set to "none" */
>  	if ((strncmp(elevator, "none", 4) == 0) && (strlen(elevator) == 4))
> -		return (0);
> +		return;
>  
> +	/*
> +	 * The elevator_change() function was available in kernels from
> +	 * 2.6.36 to 4.11.  When not available fall back to using the user
> +	 * mode helper functionality to set the elevator via sysfs.  This
> +	 * requires /bin/echo and sysfs to be mounted which may not be true
> +	 * early in the boot process.
> +	 */
>  #ifdef HAVE_ELEVATOR_CHANGE
>  	error = elevator_change(q, elevator);
>  #else
> -	/*
> -	 * For pre-2.6.36 kernels elevator_change() is not available.
> -	 * Therefore we fall back to using a usermodehelper to echo the
> -	 * elevator into sysfs;  This requires /bin/echo and sysfs to be
> -	 * mounted which may not be true early in the boot process.
> -	 */
>  #define	SET_SCHEDULER_CMD \
>  	"exec 0</dev/null " \
>  	"     1>/sys/block/%s/queue/scheduler " \
>  	"     2>/dev/null; " \
>  	"echo %s"
>  
> -	{
> -		char *argv[] = { "/bin/sh", "-c", NULL, NULL };
> -		char *envp[] = { NULL };
> +	char *argv[] = { "/bin/sh", "-c", NULL, NULL };
> +	char *envp[] = { NULL };
>  
> -		argv[2] = kmem_asprintf(SET_SCHEDULER_CMD, device, elevator);
> -		error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
> -		strfree(argv[2]);
> -	}
> +	argv[2] = kmem_asprintf(SET_SCHEDULER_CMD, device, elevator);
> +	error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
> +	strfree(argv[2]);
>  #endif /* HAVE_ELEVATOR_CHANGE */
> -	if (error)
> -		printk("ZFS: Unable to set \"%s\" scheduler for %s (%s): %d\n",
> +	if (error) {
> +		zfs_dbgmsg("Unable to set \"%s\" scheduler for %s (%s): %d\n",
>  		    elevator, v->vdev_path, device, error);
> -
> -	return (error);
> +	}
>  }
>  
>  /*
> @@ -798,6 +801,37 @@ vdev_disk_rele(vdev_t *vd)
>  	/* XXX: Implement me as a vnode rele for the device */
>  }
>  
> +static int
> +param_set_vdev_scheduler(const char *val, zfs_kernel_param_t *kp)
> +{
> +	spa_t *spa = NULL;
> +	char *p;
> +
> +	if (val == NULL)
> +		return (SET_ERROR(-EINVAL));
> +
> +	if ((p = strchr(val, '\n')) != NULL)
> +		*p = '\0';
> +
> +	if (spa_mode_global != 0) {
> +		mutex_enter(&spa_namespace_lock);
> +		while ((spa = spa_next(spa)) != NULL) {
> +			if (spa_state(spa) != POOL_STATE_ACTIVE ||
> +			    !spa_writeable(spa) || spa_suspended(spa))
> +				continue;
> +
> +			spa_open_ref(spa, FTAG);
> +			mutex_exit(&spa_namespace_lock);
> +			vdev_elevator_switch(spa->spa_root_vdev, (char *)val);
> +			mutex_enter(&spa_namespace_lock);
> +			spa_close(spa, FTAG);
> +		}
> +		mutex_exit(&spa_namespace_lock);
> +	}
> +
> +	return (param_set_charp(val, kp));
> +}
> +
>  vdev_ops_t vdev_disk_ops = {
>  	vdev_disk_open,
>  	vdev_disk_close,
> @@ -812,5 +846,6 @@ vdev_ops_t vdev_disk_ops = {
>  	B_TRUE			/* leaf vdev */
>  };
>  
> -module_param(zfs_vdev_scheduler, charp, 0644);
> +module_param_call(zfs_vdev_scheduler, param_set_vdev_scheduler,
> +    param_get_charp, &zfs_vdev_scheduler, 0644);
>  MODULE_PARM_DESC(zfs_vdev_scheduler, "I/O scheduler");
> diff --git a/zfs/module/zfs/zap.c b/zfs/module/zfs/zap.c
> index ee9962bff394..47b4c1abab95 100644
> --- a/zfs/module/zfs/zap.c
> +++ b/zfs/module/zfs/zap.c
> @@ -853,8 +853,16 @@ fzap_add_cd(zap_name_t *zn,
>  	} else if (err == EAGAIN) {
>  		err = zap_expand_leaf(zn, l, tag, tx, &l);
>  		zap = zn->zn_zap;	/* zap_expand_leaf() may change zap */
> -		if (err == 0)
> +		if (err == 0) {
>  			goto retry;
> +		} else if (err == ENOSPC) {
> +			/*
> +			 * If we failed to expand the leaf, then bailout
> +			 * as there is no point trying
> +			 * zap_put_leaf_maybe_grow_ptrtbl().
> +			 */
> +			return (err);
> +		}
>  	}
>  
>  out:
> diff --git a/zfs/module/zfs/zap_leaf.c b/zfs/module/zfs/zap_leaf.c
> index c342695c7f42..526e4660651f 100644
> --- a/zfs/module/zfs/zap_leaf.c
> +++ b/zfs/module/zfs/zap_leaf.c
> @@ -53,7 +53,7 @@ static uint16_t *zap_leaf_rehash_entry(zap_leaf_t *l, uint16_t entry);
>  	((h) >> \
>  	(64 - ZAP_LEAF_HASH_SHIFT(l) - zap_leaf_phys(l)->l_hdr.lh_prefix_len)))
>  
> -#define	LEAF_HASH_ENTPTR(l, h) (&zap_leaf_phys(l)->l_hash[LEAF_HASH(l, h)])
> +#define	LEAF_HASH_ENTPTR(l, h)	(&zap_leaf_phys(l)->l_hash[LEAF_HASH(l, h)])
>  
>  extern inline zap_leaf_phys_t *zap_leaf_phys(zap_leaf_t *l);
>  
> diff --git a/zfs/module/zfs/zap_micro.c b/zfs/module/zfs/zap_micro.c
> index 3ebf995c6780..60e193efa753 100644
> --- a/zfs/module/zfs/zap_micro.c
> +++ b/zfs/module/zfs/zap_micro.c
> @@ -363,6 +363,41 @@ mze_find_unused_cd(zap_t *zap, uint64_t hash)
>  	return (cd);
>  }
>  
> +/*
> + * Each mzap entry requires at max : 4 chunks
> + * 3 chunks for names + 1 chunk for value.
> + */
> +#define	MZAP_ENT_CHUNKS	(1 + ZAP_LEAF_ARRAY_NCHUNKS(MZAP_NAME_LEN) + \
> +	ZAP_LEAF_ARRAY_NCHUNKS(sizeof (uint64_t)))
> +
> +/*
> + * Check if the current entry keeps the colliding entries under the fatzap leaf
> + * size.
> + */
> +static boolean_t
> +mze_canfit_fzap_leaf(zap_name_t *zn, uint64_t hash)
> +{
> +	zap_t *zap = zn->zn_zap;
> +	mzap_ent_t mze_tofind;
> +	mzap_ent_t *mze;
> +	avl_index_t idx;
> +	avl_tree_t *avl = &zap->zap_m.zap_avl;
> +	uint32_t mzap_ents = 0;
> +
> +	mze_tofind.mze_hash = hash;
> +	mze_tofind.mze_cd = 0;
> +
> +	for (mze = avl_find(avl, &mze_tofind, &idx);
> +	    mze && mze->mze_hash == hash; mze = AVL_NEXT(avl, mze)) {
> +		mzap_ents++;
> +	}
> +
> +	/* Include the new entry being added */
> +	mzap_ents++;
> +
> +	return (ZAP_LEAF_NUMCHUNKS_DEF > (mzap_ents * MZAP_ENT_CHUNKS));
> +}
> +
>  static void
>  mze_remove(zap_t *zap, mzap_ent_t *mze)
>  {
> @@ -639,16 +674,15 @@ mzap_upgrade(zap_t **zapp, void *tag, dmu_tx_t *tx, zap_flags_t flags)
>  		dprintf("adding %s=%llu\n",
>  		    mze->mze_name, mze->mze_value);
>  		zn = zap_name_alloc(zap, mze->mze_name, 0);
> -		err = fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd,
> -		    tag, tx);
> +		/* If we fail here, we would end up losing entries */
> +		VERIFY0(fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd,
> +		    tag, tx));
>  		zap = zn->zn_zap;	/* fzap_add_cd() may change zap */
>  		zap_name_free(zn);
> -		if (err)
> -			break;
>  	}
>  	vmem_free(mzp, sz);
>  	*zapp = zap;
> -	return (err);
> +	return (0);
>  }
>  
>  /*
> @@ -1191,7 +1225,8 @@ zap_add_impl(zap_t *zap, const char *key,
>  		err = fzap_add(zn, integer_size, num_integers, val, tag, tx);
>  		zap = zn->zn_zap;	/* fzap_add() may change zap */
>  	} else if (integer_size != 8 || num_integers != 1 ||
> -	    strlen(key) >= MZAP_NAME_LEN) {
> +	    strlen(key) >= MZAP_NAME_LEN ||
> +	    !mze_canfit_fzap_leaf(zn, zn->zn_hash)) {
>  		err = mzap_upgrade(&zn->zn_zap, tag, tx, 0);
>  		if (err == 0) {
>  			err = fzap_add(zn, integer_size, num_integers, val,
> diff --git a/zfs/module/zfs/zfs_ctldir.c b/zfs/module/zfs/zfs_ctldir.c
> index 3ff2c101b67b..579f1fbfb9a7 100644
> --- a/zfs/module/zfs/zfs_ctldir.c
> +++ b/zfs/module/zfs/zfs_ctldir.c
> @@ -120,7 +120,7 @@ typedef struct {
>  	taskqid_t	se_taskqid;	/* scheduled unmount taskqid */
>  	avl_node_t	se_node_name;	/* zfs_snapshots_by_name link */
>  	avl_node_t	se_node_objsetid; /* zfs_snapshots_by_objsetid link */
> -	refcount_t	se_refcount;	/* reference count */
> +	zfs_refcount_t	se_refcount;	/* reference count */
>  } zfs_snapentry_t;
>  
>  static void zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay);
> @@ -169,7 +169,7 @@ zfsctl_snapshot_free(zfs_snapentry_t *se)
>  static void
>  zfsctl_snapshot_hold(zfs_snapentry_t *se)
>  {
> -	refcount_add(&se->se_refcount, NULL);
> +	zfs_refcount_add(&se->se_refcount, NULL);
>  }
>  
>  /*
> @@ -192,7 +192,7 @@ static void
>  zfsctl_snapshot_add(zfs_snapentry_t *se)
>  {
>  	ASSERT(RW_WRITE_HELD(&zfs_snapshot_lock));
> -	refcount_add(&se->se_refcount, NULL);
> +	zfs_refcount_add(&se->se_refcount, NULL);
>  	avl_add(&zfs_snapshots_by_name, se);
>  	avl_add(&zfs_snapshots_by_objsetid, se);
>  }
> @@ -269,7 +269,7 @@ zfsctl_snapshot_find_by_name(char *snapname)
>  	search.se_name = snapname;
>  	se = avl_find(&zfs_snapshots_by_name, &search, NULL);
>  	if (se)
> -		refcount_add(&se->se_refcount, NULL);
> +		zfs_refcount_add(&se->se_refcount, NULL);
>  
>  	return (se);
>  }
> @@ -290,7 +290,7 @@ zfsctl_snapshot_find_by_objsetid(spa_t *spa, uint64_t objsetid)
>  	search.se_objsetid = objsetid;
>  	se = avl_find(&zfs_snapshots_by_objsetid, &search, NULL);
>  	if (se)
> -		refcount_add(&se->se_refcount, NULL);
> +		zfs_refcount_add(&se->se_refcount, NULL);
>  
>  	return (se);
>  }
> @@ -1181,7 +1181,7 @@ zfsctl_snapdir_vget(struct super_block *sb, uint64_t objsetid, int gen,
>  		goto out;
>  
>  	/* Trigger automount */
> -	error = kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
> +	error = -kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
>  	if (error)
>  		goto out;
>  
> diff --git a/zfs/module/zfs/zfs_dir.c b/zfs/module/zfs/zfs_dir.c
> index 9a8bbccd92d7..6398a1d155e2 100644
> --- a/zfs/module/zfs/zfs_dir.c
> +++ b/zfs/module/zfs/zfs_dir.c
> @@ -742,7 +742,11 @@ zfs_dirent(znode_t *zp, uint64_t mode)
>  }
>  
>  /*
> - * Link zp into dl.  Can only fail if zp has been unlinked.
> + * Link zp into dl.  Can fail in the following cases :
> + * - if zp has been unlinked.
> + * - if the number of entries with the same hash (aka. colliding entries)
> + *    exceed the capacity of a leaf-block of fatzap and splitting of the
> + *    leaf-block does not help.
>   */
>  int
>  zfs_link_create(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag)
> @@ -776,6 +780,24 @@ zfs_link_create(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag)
>  			    NULL, &links, sizeof (links));
>  		}
>  	}
> +
> +	value = zfs_dirent(zp, zp->z_mode);
> +	error = zap_add(ZTOZSB(zp)->z_os, dzp->z_id, dl->dl_name, 8, 1,
> +	    &value, tx);
> +
> +	/*
> +	 * zap_add could fail to add the entry if it exceeds the capacity of the
> +	 * leaf-block and zap_leaf_split() failed to help.
> +	 * The caller of this routine is responsible for failing the transaction
> +	 * which will rollback the SA updates done above.
> +	 */
> +	if (error != 0) {
> +		if (!(flag & ZRENAMING) && !(flag & ZNEW))
> +			drop_nlink(ZTOI(zp));
> +		mutex_exit(&zp->z_lock);
> +		return (error);
> +	}
> +
>  	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_PARENT(zfsvfs), NULL,
>  	    &dzp->z_id, sizeof (dzp->z_id));
>  	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_FLAGS(zfsvfs), NULL,
> @@ -813,11 +835,6 @@ zfs_link_create(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag)
>  	ASSERT(error == 0);
>  	mutex_exit(&dzp->z_lock);
>  
> -	value = zfs_dirent(zp, zp->z_mode);
> -	error = zap_add(ZTOZSB(zp)->z_os, dzp->z_id, dl->dl_name,
> -	    8, 1, &value, tx);
> -	ASSERT(error == 0);
> -
>  	return (0);
>  }
>  
> diff --git a/zfs/module/zfs/zfs_ioctl.c b/zfs/module/zfs/zfs_ioctl.c
> index c6d180cdae61..f03212b0d233 100644
> --- a/zfs/module/zfs/zfs_ioctl.c
> +++ b/zfs/module/zfs/zfs_ioctl.c
> @@ -3976,7 +3976,6 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
>  	{
>  		spa_feature_t feature;
>  		spa_t *spa;
> -		uint64_t intval;
>  		int err;
>  
>  		/* dedup feature version checks */
> @@ -3984,31 +3983,23 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
>  		    zfs_earlier_version(dsname, SPA_VERSION_DEDUP))
>  			return (SET_ERROR(ENOTSUP));
>  
> -		if (nvpair_value_uint64(pair, &intval) != 0)
> -			return (SET_ERROR(EINVAL));
> +		if (nvpair_type(pair) == DATA_TYPE_UINT64 &&
> +		    nvpair_value_uint64(pair, &intval) == 0) {
> +			/* check prop value is enabled in features */
> +			feature = zio_checksum_to_feature(
> +			    intval & ZIO_CHECKSUM_MASK);
> +			if (feature == SPA_FEATURE_NONE)
> +				break;
>  
> -		/* check prop value is enabled in features */
> -		feature = zio_checksum_to_feature(intval & ZIO_CHECKSUM_MASK);
> -		if (feature == SPA_FEATURE_NONE)
> -			break;
> +			if ((err = spa_open(dsname, &spa, FTAG)) != 0)
> +				return (err);
>  
> -		if ((err = spa_open(dsname, &spa, FTAG)) != 0)
> -			return (err);
> -		/*
> -		 * Salted checksums are not supported on root pools.
> -		 */
> -		if (spa_bootfs(spa) != 0 &&
> -		    intval < ZIO_CHECKSUM_FUNCTIONS &&
> -		    (zio_checksum_table[intval].ci_flags &
> -		    ZCHECKSUM_FLAG_SALTED)) {
> -			spa_close(spa, FTAG);
> -			return (SET_ERROR(ERANGE));
> -		}
> -		if (!spa_feature_is_enabled(spa, feature)) {
> +			if (!spa_feature_is_enabled(spa, feature)) {
> +				spa_close(spa, FTAG);
> +				return (SET_ERROR(ENOTSUP));
> +			}
>  			spa_close(spa, FTAG);
> -			return (SET_ERROR(ENOTSUP));
>  		}
> -		spa_close(spa, FTAG);
>  		break;
>  	}
>  
> diff --git a/zfs/module/zfs/zfs_vnops.c b/zfs/module/zfs/zfs_vnops.c
> index 34ea751c3207..5a2e55eb19af 100644
> --- a/zfs/module/zfs/zfs_vnops.c
> +++ b/zfs/module/zfs/zfs_vnops.c
> @@ -129,7 +129,7 @@
>   *
>   *	If dmu_tx_assign() returns ERESTART and zfsvfs->z_assign is TXG_NOWAIT,
>   *	then drop all locks, call dmu_tx_wait(), and try again.  On subsequent
> - *	calls to dmu_tx_assign(), pass TXG_WAITED rather than TXG_NOWAIT,
> + *	calls to dmu_tx_assign(), pass TXG_NOTHROTTLE in addition to TXG_NOWAIT,
>   *	to indicate that this operation has already called dmu_tx_wait().
>   *	This will ensure that we don't retry forever, waiting a short bit
>   *	each time.
> @@ -154,7 +154,7 @@
>   *	rw_enter(...);			// grab any other locks you need
>   *	tx = dmu_tx_create(...);	// get DMU tx
>   *	dmu_tx_hold_*();		// hold each object you might modify
> - *	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> + *	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>   *	if (error) {
>   *		rw_exit(...);		// drop locks
>   *		zfs_dirent_unlock(dl);	// unlock directory entry
> @@ -1427,7 +1427,9 @@ zfs_create(struct inode *dip, char *name, vattr_t *vap, int excl,
>  			dmu_tx_hold_write(tx, DMU_NEW_OBJECT,
>  			    0, acl_ids.z_aclp->z_acl_bytes);
>  		}
> -		error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +
> +		error = dmu_tx_assign(tx,
> +		    (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  		if (error) {
>  			zfs_dirent_unlock(dl);
>  			if (error == ERESTART) {
> @@ -1443,10 +1445,22 @@ zfs_create(struct inode *dip, char *name, vattr_t *vap, int excl,
>  		}
>  		zfs_mknode(dzp, vap, tx, cr, 0, &zp, &acl_ids);
>  
> +		error = zfs_link_create(dl, zp, tx, ZNEW);
> +		if (error != 0) {
> +			/*
> +			 * Since, we failed to add the directory entry for it,
> +			 * delete the newly created dnode.
> +			 */
> +			zfs_znode_delete(zp, tx);
> +			remove_inode_hash(ZTOI(zp));
> +			zfs_acl_ids_free(&acl_ids);
> +			dmu_tx_commit(tx);
> +			goto out;
> +		}
> +
>  		if (fuid_dirtied)
>  			zfs_fuid_sync(zfsvfs, tx);
>  
> -		(void) zfs_link_create(dl, zp, tx, ZNEW);
>  		txtype = zfs_log_create_txtype(Z_FILE, vsecp, vap);
>  		if (flag & FIGNORECASE)
>  			txtype |= TX_CI;
> @@ -1602,7 +1616,7 @@ zfs_tmpfile(struct inode *dip, vattr_t *vap, int excl,
>  		dmu_tx_hold_write(tx, DMU_NEW_OBJECT,
>  		    0, acl_ids.z_aclp->z_acl_bytes);
>  	}
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		if (error == ERESTART) {
>  			waited = B_TRUE;
> @@ -1775,7 +1789,7 @@ zfs_remove(struct inode *dip, char *name, cred_t *cr, int flags)
>  	 */
>  	dmu_tx_mark_netfree(tx);
>  
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		zfs_dirent_unlock(dl);
>  		if (error == ERESTART) {
> @@ -2017,7 +2031,7 @@ zfs_mkdir(struct inode *dip, char *dirname, vattr_t *vap, struct inode **ipp,
>  	dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes +
>  	    ZFS_SA_BASE_ATTR_SIZE);
>  
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		zfs_dirent_unlock(dl);
>  		if (error == ERESTART) {
> @@ -2037,13 +2051,18 @@ zfs_mkdir(struct inode *dip, char *dirname, vattr_t *vap, struct inode **ipp,
>  	 */
>  	zfs_mknode(dzp, vap, tx, cr, 0, &zp, &acl_ids);
>  
> -	if (fuid_dirtied)
> -		zfs_fuid_sync(zfsvfs, tx);
> -
>  	/*
>  	 * Now put new name in parent dir.
>  	 */
> -	(void) zfs_link_create(dl, zp, tx, ZNEW);
> +	error = zfs_link_create(dl, zp, tx, ZNEW);
> +	if (error != 0) {
> +		zfs_znode_delete(zp, tx);
> +		remove_inode_hash(ZTOI(zp));
> +		goto out;
> +	}
> +
> +	if (fuid_dirtied)
> +		zfs_fuid_sync(zfsvfs, tx);
>  
>  	*ipp = ZTOI(zp);
>  
> @@ -2053,6 +2072,7 @@ zfs_mkdir(struct inode *dip, char *dirname, vattr_t *vap, struct inode **ipp,
>  	zfs_log_create(zilog, tx, txtype, dzp, zp, dirname, vsecp,
>  	    acl_ids.z_fuidp, vap);
>  
> +out:
>  	zfs_acl_ids_free(&acl_ids);
>  
>  	dmu_tx_commit(tx);
> @@ -2062,10 +2082,14 @@ zfs_mkdir(struct inode *dip, char *dirname, vattr_t *vap, struct inode **ipp,
>  	if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
>  		zil_commit(zilog, 0);
>  
> -	zfs_inode_update(dzp);
> -	zfs_inode_update(zp);
> +	if (error != 0) {
> +		iput(ZTOI(zp));
> +	} else {
> +		zfs_inode_update(dzp);
> +		zfs_inode_update(zp);
> +	}
>  	ZFS_EXIT(zfsvfs);
> -	return (0);
> +	return (error);
>  }
>  
>  /*
> @@ -2156,7 +2180,7 @@ zfs_rmdir(struct inode *dip, char *name, struct inode *cwd, cred_t *cr,
>  	zfs_sa_upgrade_txholds(tx, zp);
>  	zfs_sa_upgrade_txholds(tx, dzp);
>  	dmu_tx_mark_netfree(tx);
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		rw_exit(&zp->z_parent_lock);
>  		rw_exit(&zp->z_name_lock);
> @@ -3623,7 +3647,7 @@ zfs_rename(struct inode *sdip, char *snm, struct inode *tdip, char *tnm,
>  
>  	zfs_sa_upgrade_txholds(tx, szp);
>  	dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL);
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		if (zl != NULL)
>  			zfs_rename_unlock(&zl);
> @@ -3683,6 +3707,13 @@ zfs_rename(struct inode *sdip, char *snm, struct inode *tdip, char *tnm,
>  				VERIFY3U(zfs_link_destroy(tdl, szp, tx,
>  				    ZRENAMING, NULL), ==, 0);
>  			}
> +		} else {
> +			/*
> +			 * If we had removed the existing target, subsequent
> +			 * call to zfs_link_create() to add back the same entry
> +			 * but, the new dnode (szp) should not fail.
> +			 */
> +			ASSERT(tzp == NULL);
>  		}
>  	}
>  
> @@ -3815,7 +3846,7 @@ zfs_symlink(struct inode *dip, char *name, vattr_t *vap, char *link,
>  	}
>  	if (fuid_dirtied)
>  		zfs_fuid_txhold(zfsvfs, tx);
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		zfs_dirent_unlock(dl);
>  		if (error == ERESTART) {
> @@ -3853,14 +3884,18 @@ zfs_symlink(struct inode *dip, char *name, vattr_t *vap, char *link,
>  	/*
>  	 * Insert the new object into the directory.
>  	 */
> -	(void) zfs_link_create(dl, zp, tx, ZNEW);
> -
> -	if (flags & FIGNORECASE)
> -		txtype |= TX_CI;
> -	zfs_log_symlink(zilog, tx, txtype, dzp, zp, name, link);
> +	error = zfs_link_create(dl, zp, tx, ZNEW);
> +	if (error != 0) {
> +		zfs_znode_delete(zp, tx);
> +		remove_inode_hash(ZTOI(zp));
> +	} else {
> +		if (flags & FIGNORECASE)
> +			txtype |= TX_CI;
> +		zfs_log_symlink(zilog, tx, txtype, dzp, zp, name, link);
>  
> -	zfs_inode_update(dzp);
> -	zfs_inode_update(zp);
> +		zfs_inode_update(dzp);
> +		zfs_inode_update(zp);
> +	}
>  
>  	zfs_acl_ids_free(&acl_ids);
>  
> @@ -3868,10 +3903,14 @@ zfs_symlink(struct inode *dip, char *name, vattr_t *vap, char *link,
>  
>  	zfs_dirent_unlock(dl);
>  
> -	*ipp = ZTOI(zp);
> +	if (error == 0) {
> +		*ipp = ZTOI(zp);
>  
> -	if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
> -		zil_commit(zilog, 0);
> +		if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
> +			zil_commit(zilog, 0);
> +	} else {
> +		iput(ZTOI(zp));
> +	}
>  
>  	ZFS_EXIT(zfsvfs);
>  	return (error);
> @@ -4041,7 +4080,7 @@ zfs_link(struct inode *tdip, struct inode *sip, char *name, cred_t *cr,
>  
>  	zfs_sa_upgrade_txholds(tx, szp);
>  	zfs_sa_upgrade_txholds(tx, dzp);
> -	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
> +	error = dmu_tx_assign(tx, (waited ? TXG_NOTHROTTLE : 0) | TXG_NOWAIT);
>  	if (error) {
>  		zfs_dirent_unlock(dl);
>  		if (error == ERESTART) {
> diff --git a/zfs/module/zfs/zfs_znode.c b/zfs/module/zfs/zfs_znode.c
> index e222c7911834..0ca10f82e757 100644
> --- a/zfs/module/zfs/zfs_znode.c
> +++ b/zfs/module/zfs/zfs_znode.c
> @@ -272,7 +272,7 @@ zfs_znode_hold_enter(zfsvfs_t *zfsvfs, uint64_t obj)
>  		ASSERT3U(zh->zh_obj, ==, obj);
>  		found = B_TRUE;
>  	}
> -	refcount_add(&zh->zh_refcount, NULL);
> +	zfs_refcount_add(&zh->zh_refcount, NULL);
>  	mutex_exit(&zfsvfs->z_hold_locks[i]);
>  
>  	if (found == B_TRUE)
> diff --git a/zfs/module/zfs/zil.c b/zfs/module/zfs/zil.c
> index 614ed7d37ea5..77e3825836fa 100644
> --- a/zfs/module/zfs/zil.c
> +++ b/zfs/module/zfs/zil.c
> @@ -1011,22 +1011,13 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
>  	tx = dmu_tx_create(zilog->zl_os);
>  
>  	/*
> -	 * Since we are not going to create any new dirty data and we can even
> -	 * help with clearing the existing dirty data, we should not be subject
> -	 * to the dirty data based delays.
> -	 * We (ab)use TXG_WAITED to bypass the delay mechanism.
> -	 * One side effect from using TXG_WAITED is that dmu_tx_assign() can
> -	 * fail if the pool is suspended.  Those are dramatic circumstances,
> -	 * so we return NULL to signal that the normal ZIL processing is not
> -	 * possible and txg_wait_synced() should be used to ensure that the data
> -	 * is on disk.
> +	 * Since we are not going to create any new dirty data, and we
> +	 * can even help with clearing the existing dirty data, we
> +	 * should not be subject to the dirty data based delays. We
> +	 * use TXG_NOTHROTTLE to bypass the delay mechanism.
>  	 */
> -	error = dmu_tx_assign(tx, TXG_WAITED);
> -	if (error != 0) {
> -		ASSERT3S(error, ==, EIO);
> -		dmu_tx_abort(tx);
> -		return (NULL);
> -	}
> +	VERIFY0(dmu_tx_assign(tx, TXG_WAIT | TXG_NOTHROTTLE));
> +
>  	dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
>  	txg = dmu_tx_get_txg(tx);
>  
> diff --git a/zfs/scripts/dkms.postbuild b/zfs/scripts/dkms.postbuild
> new file mode 100755
> index 000000000000..3cbc7c7ce6eb
> --- /dev/null
> +++ b/zfs/scripts/dkms.postbuild
> @@ -0,0 +1,24 @@
> +#!/bin/bash
> +
> +PROG=$0
> +
> +while getopts "a:k:n:t:v:" opt; do
> +	case $opt in
> +		a) arch=$OPTARG    ;;
> +		k) kver=$OPTARG    ;;
> +		n) pkgname=$OPTARG ;;
> +		t) tree=$OPTARG    ;;
> +		v) pkgver=$OPTARG  ;;
> +	esac
> +done
> +
> +if [ -z "${arch}" -o -z "${kver}" -o -z "${pkgname}" -o \
> +     -z "${tree}" -o -z "${pkgver}" ]; then
> +	echo "Usage: $PROG -a <arch> -k <kver> -n <pkgname>" \
> +	     "-t <tree> -v <pkgver>"
> +	exit 1
> +fi
> +
> +cp ${tree}/${pkgname}/${pkgver}/build/zfs_config.h          \
> +   ${tree}/${pkgname}/${pkgver}/build/module/Module.symvers \
> +   ${tree}/${pkgname}/${pkgver}/${kver}/${arch}/
> diff --git a/zfs/zfs_config.h.in b/zfs/zfs_config.h.in
> index 6ec914fb9673..4fa766de5832 100644
> --- a/zfs/zfs_config.h.in
> +++ b/zfs/zfs_config.h.in
> @@ -303,9 +303,6 @@
>  /* inode_set_iversion() exists */
>  #undef HAVE_INODE_SET_IVERSION
>  
> -/* inode->i_*time's are timespec64 */
> -#undef HAVE_INODE_TIMESPEC64_TIMES
> -
>  /* iops->truncate_range() exists */
>  #undef HAVE_INODE_TRUNCATE_RANGE
>  
> 




More information about the kernel-team mailing list