summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2012-07-11 13:20:31 +0000
committerRichard Yao <ryao@gentoo.org>2012-07-11 13:20:31 +0000
commit9f7c57bad40bb5494a93e38951ca0f9a26b1882d (patch)
treed4b4eb71f7cd239112b4db4266d8982f4dc74397
parentVersion bump. (diff)
downloadgentoo-2-9f7c57bad40bb5494a93e38951ca0f9a26b1882d.tar.gz
gentoo-2-9f7c57bad40bb5494a93e38951ca0f9a26b1882d.tar.bz2
gentoo-2-9f7c57bad40bb5494a93e38951ca0f9a26b1882d.zip
Linux 3.5 support, Change LICENSE variable and remove patch that had been mistakenly reintroduced in -r4 and caused regressions
(Portage version: 2.1.10.65/cvs/Linux x86_64)
-rw-r--r--sys-fs/zfs/ChangeLog13
-rw-r--r--sys-fs/zfs/files/zfs-0.6.0_rc9-bsd-init.patch39
-rw-r--r--sys-fs/zfs/files/zfs-0.6.0_rc9-linux-3.5-support.patch183
-rw-r--r--sys-fs/zfs/files/zfs-0.6.0_rc9-range-lock-caller-allocate.patch589
-rw-r--r--sys-fs/zfs/files/zfs-0.6.0_rc9-use-pushpage.patch1100
-rw-r--r--sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild148
-rw-r--r--sys-fs/zfs/zfs-0.6.0_rc9-r5.ebuild (renamed from sys-fs/zfs/zfs-0.6.0_rc9-r4.ebuild)12
-rw-r--r--sys-fs/zfs/zfs-0.6.0_rc9.ebuild145
-rw-r--r--sys-fs/zfs/zfs-9999.ebuild17
9 files changed, 254 insertions, 1992 deletions
diff --git a/sys-fs/zfs/ChangeLog b/sys-fs/zfs/ChangeLog
index a0ffa05152a9..ab93e0026e24 100644
--- a/sys-fs/zfs/ChangeLog
+++ b/sys-fs/zfs/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for sys-fs/zfs
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/ChangeLog,v 1.35 2012/07/10 00:31:39 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/ChangeLog,v 1.36 2012/07/11 13:20:31 ryao Exp $
+
+*zfs-0.6.0_rc9-r5 (11 Jul 2012)
+
+ 11 Jul 2012; Richard Yao <ryao@gentoo.org>
+ +files/zfs-0.6.0_rc9-bsd-init.patch,
+ +files/zfs-0.6.0_rc9-linux-3.5-support.patch, +zfs-0.6.0_rc9-r5.ebuild,
+ -files/zfs-0.6.0_rc9-range-lock-caller-allocate.patch,
+ -files/zfs-0.6.0_rc9-use-pushpage.patch, -zfs-0.6.0_rc9-r3.ebuild,
+ -zfs-0.6.0_rc9-r4.ebuild, -zfs-0.6.0_rc9.ebuild, zfs-9999.ebuild:
+ Linux 3.5 support, Change LICENSE variable and remove patch that had been
+ mistakenly reintroduced in -r4 and caused regressions
*zfs-0.6.0_rc9-r4 (10 Jul 2012)
diff --git a/sys-fs/zfs/files/zfs-0.6.0_rc9-bsd-init.patch b/sys-fs/zfs/files/zfs-0.6.0_rc9-bsd-init.patch
new file mode 100644
index 000000000000..5376bfd9bab6
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.0_rc9-bsd-init.patch
@@ -0,0 +1,39 @@
+commit 0ac83722a09ccb15067cad91217103474b58dadf
+Author: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue Jul 10 09:27:09 2012 -0400
+
+ Relicense zfs.gentoo.in from GPLv2 to 2-clause BSD
+
+ As the Gentoo sys-fs/zfs maintainer, I receive license compatibility
+ questions and at times, those questions can be harassing. I feel that
+ the presence of the GPL in Gentoo's package metadata promotes such
+ questions. zfs.gentoo.in is the only GPLv2 licensed file in ZFS, so I
+ have taken the liberty of contacting all contributors to this file to
+ request permission to relicense it.
+
+ All of the contributors to this file have agreed to relicense it under
+ the 2-clause BSD license. I have added their Signed-offs to this commit,
+ in order of first contribution. Thankyou everyone for being so
+ understanding.
+
+ Signed-off-by: devsk <devsku@gmail.com>
+ Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+ Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+ Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>
+ Signed-off-by: Zachary Bedell <zac@thebedells.org>
+ Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
+ Signed-off-by: Kyle Fuller <inbox@kylefuller.co.uk>
+ Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+
+diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in
+index 957be99..df883cf 100644
+--- a/etc/init.d/zfs.gentoo.in
++++ b/etc/init.d/zfs.gentoo.in
+@@ -1,6 +1,6 @@
+ #!/sbin/runscript
+ # Copyright 1999-2011 Gentoo Foundation
+-# Distributed under the terms of the GNU General Public License v2
++# Released under the 2-clause BSD license.
+ # $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/files/zfs,v 0.9 2011/04/30 10:13:43 devsk Exp $
+
+ depend()
diff --git a/sys-fs/zfs/files/zfs-0.6.0_rc9-linux-3.5-support.patch b/sys-fs/zfs/files/zfs-0.6.0_rc9-linux-3.5-support.patch
new file mode 100644
index 000000000000..c337bcf804a1
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.0_rc9-linux-3.5-support.patch
@@ -0,0 +1,183 @@
+commit c414d98b9f99aaa68abd418c93fad6e9bb3adca6
+Author: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue Jul 10 07:34:53 2012 -0400
+
+ Linux 3.5 compatibility: miscellaneous changes
+
+ torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed
+ export_operations->encode_fn() to use struct inode * instead of struct
+ dentry *
+
+ torvalds/linux@17cf28afea2a1112f240a3a2da8af883be024811 renamed
+ end_writeback() to clear_inode()
+
+ torvalds/linux@17cf28afea2a1112f240a3a2da8af883be024811 removed
+ inode_operations->truncate_range(). The file hole punching functionality
+ is provided by inode_operations->fallocate()
+
+ Closes zfsonlinux/zfs#784
+
+ Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+
+diff --git a/config/kernel-clear-inode.m4 b/config/kernel-clear-inode.m4
+new file mode 100644
+index 0000000..bedfc51
+--- /dev/null
++++ b/config/kernel-clear-inode.m4
+@@ -0,0 +1,13 @@
++dnl #
++dnl # 3.5.0 API change
++dnl # torvalds/linux@90324cc1b11a211e37eabd8cb863e1a1561d6b1d renamed
++dnl # end_writeback() to clear_inode().
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [
++ ZFS_CHECK_SYMBOL_EXPORT(
++ [clear_inode],
++ [fs/inode.c],
++ [AC_DEFINE(HAVE_CLEAR_INODE, 1,
++ [clear_inode() is available])],
++ [])
++])
+diff --git a/config/kernel-encode_fh-inode.m4 b/config/kernel-encode_fh-inode.m4
+new file mode 100644
+index 0000000..e4d448d
+--- /dev/null
++++ b/config/kernel-encode_fh-inode.m4
+@@ -0,0 +1,23 @@
++dnl #
++dnl # 3.5.0 API change #
++dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the header
++dnl # to use struct inode * instead of struct dentry *
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER], [
++ AC_MSG_CHECKING([export_operations->encodefh()])
++ ZFS_LINUX_TRY_COMPILE([
++ #include <linux/exportfs.h>
++ ],[
++ int (*encode_fh)(struct inode *, __u32 *fh, int *, struct inode *) = NULL;
++ struct export_operations export_ops = {
++ .encode_fh = encode_fh,
++ };
++ export_ops.encode_fh(0, 0, 0, 0);
++ ],[
++ AC_MSG_RESULT(uses struct inode * as first parameter)
++ AC_DEFINE(HAVE_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER, 1,
++ [fhfn() uses struct inode *])
++ ],[
++ AC_MSG_RESULT(does not use struct inode * as first parameter)
++ ])
++])
+diff --git a/config/kernel-truncate-range.m4 b/config/kernel-truncate-range.m4
+new file mode 100644
+index 0000000..1f23d6a
+--- /dev/null
++++ b/config/kernel-truncate-range.m4
+@@ -0,0 +1,26 @@
++dnl #
++dnl # 3.5.0 API change #
++dnl # torvalds/linux@17cf28afea2a1112f240a3a2da8af883be024811 removed
++dnl # truncate_range(). The file hole punching functionality is provided by
++dnl # fallocate()
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_INODE_TRUNCATE_RANGE], [
++ AC_MSG_CHECKING([inode_operations->truncate_range() exists])
++ ZFS_LINUX_TRY_COMPILE([
++ #include <linux/fs.h>
++ ],[
++ void (*tr)(struct inode *, loff_t, loff_t) = NULL;
++ struct inode_operations inode_ops = {
++ .truncate_range = tr,
++ };
++ inode_ops.truncate_range(0, 0, 0);
++
++
++ ],[
++ AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1,
++ [inode_operations->truncate_range() exists])
++ ],[
++ AC_MSG_RESULT(no)
++ ])
++])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 7f07c90..752a7df 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -59,6 +59,9 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ ZFS_AC_KERNEL_BDI
+ ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
+ ZFS_AC_KERNEL_SET_NLINK
++ ZFS_AC_KERNEL_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER
++ ZFS_AC_KERNEL_INODE_TRUNCATE_RANGE
++ ZFS_AC_KERNEL_CLEAR_INODE
+
+ AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
+ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+diff --git a/module/zfs/zpl_export.c b/module/zfs/zpl_export.c
+index f82ee30..ab6e6d2 100644
+--- a/module/zfs/zpl_export.c
++++ b/module/zfs/zpl_export.c
+@@ -30,10 +30,15 @@
+
+
+ static int
++#ifdef HAVE_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER
++zpl_encode_fh(struct inode *ip, __u32 *fh, int *max_len, struct inode *parent)
++{
++#else
+ zpl_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, int connectable)
+ {
+- fid_t *fid = (fid_t *)fh;
+ struct inode *ip = dentry->d_inode;
++#endif
++ fid_t *fid = (fid_t *)fh;
+ int len_bytes, rc;
+
+ len_bytes = *max_len * sizeof (__u32);
+diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
+index 1f6169b..51202e7 100644
+--- a/module/zfs/zpl_inode.c
++++ b/module/zfs/zpl_inode.c
+@@ -329,6 +329,7 @@ out:
+ return (error);
+ }
+
++#ifdef HAVE_INODE_TRUNCATE_RANGE
+ static void
+ zpl_truncate_range(struct inode* ip, loff_t start, loff_t end)
+ {
+@@ -355,6 +356,7 @@ zpl_truncate_range(struct inode* ip, loff_t start, loff_t end)
+
+ crfree(cr);
+ }
++#endif
+
+ #ifdef HAVE_INODE_FALLOCATE
+ static long
+@@ -380,7 +382,9 @@ const struct inode_operations zpl_inode_operations = {
+ .getxattr = generic_getxattr,
+ .removexattr = generic_removexattr,
+ .listxattr = zpl_xattr_list,
++#ifdef HAVE_INODE_TRUNCATE_RANGE
+ .truncate_range = zpl_truncate_range,
++#endif /* HAVE_INODE_TRUNCATE_RANGE */
+ #ifdef HAVE_INODE_FALLOCATE
+ .fallocate = zpl_fallocate,
+ #endif /* HAVE_INODE_FALLOCATE */
+diff --git a/module/zfs/zpl_super.c b/module/zfs/zpl_super.c
+index 98d0a03..c2aac35 100644
+--- a/module/zfs/zpl_super.c
++++ b/module/zfs/zpl_super.c
+@@ -75,7 +75,12 @@ static void
+ zpl_evict_inode(struct inode *ip)
+ {
+ truncate_setsize(ip, 0);
++#ifdef HAVE_CLEAR_INODE
++ clear_inode(ip);
++#else
+ end_writeback(ip);
++
++#endif
+ zfs_inactive(ip);
+ }
+
diff --git a/sys-fs/zfs/files/zfs-0.6.0_rc9-range-lock-caller-allocate.patch b/sys-fs/zfs/files/zfs-0.6.0_rc9-range-lock-caller-allocate.patch
deleted file mode 100644
index 465e72740f67..000000000000
--- a/sys-fs/zfs/files/zfs-0.6.0_rc9-range-lock-caller-allocate.patch
+++ /dev/null
@@ -1,589 +0,0 @@
-commit e7deab3edf6940f13013ca147c91472577223923
-Author: Richard Yao <ryao@cs.stonybrook.edu>
-Date: Mon Jun 25 14:41:30 2012 -0400
-
- Make callers responsible for memory allocation in zfs_range_lock()
-
- zfs_range_lock() is used in zvols, and previously, it could deadlock due
- to an allocation using KM_SLEEP. We avoid this by moving responsibility
- the memory allocation from zfs_range_lock() to the caller. This enables
- us to avoid such deadlocks and use stack allocations, which are more
- efficient and prevents deadlocks. The contexts in which stack
- allocations are done do not appear to be stack heavy, so we do not risk
- overflowing the stack from doing this.
-
- Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
-
- Conflicts:
-
- module/zfs/zvol.c
-
-diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
-index 72d511b..c5dd0c2 100644
---- a/cmd/ztest/ztest.c
-+++ b/cmd/ztest/ztest.c
-@@ -973,12 +973,11 @@ ztest_object_unlock(ztest_ds_t *zd, uint64_t object)
- }
-
- static rl_t *
--ztest_range_lock(ztest_ds_t *zd, uint64_t object, uint64_t offset,
-+ztest_range_lock(rl_t *rl, ztest_ds_t *zd, uint64_t object, uint64_t offset,
- uint64_t size, rl_type_t type)
- {
- uint64_t hash = object ^ (offset % (ZTEST_RANGE_LOCKS + 1));
- rll_t *rll = &zd->zd_range_lock[hash & (ZTEST_RANGE_LOCKS - 1)];
-- rl_t *rl;
-
- rl = umem_alloc(sizeof (*rl), UMEM_NOFAIL);
- rl->rl_object = object;
-@@ -1389,7 +1388,7 @@ ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
- dmu_tx_t *tx;
- dmu_buf_t *db;
- arc_buf_t *abuf = NULL;
-- rl_t *rl;
-+ rl_t rl;
-
- if (byteswap)
- byteswap_uint64_array(lr, sizeof (*lr));
-@@ -1413,7 +1412,7 @@ ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
- bt = NULL;
-
- ztest_object_lock(zd, lr->lr_foid, RL_READER);
-- rl = ztest_range_lock(zd, lr->lr_foid, offset, length, RL_WRITER);
-+ ztest_range_lock(&rl, zd, lr->lr_foid, offset, length, RL_WRITER);
-
- VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db));
-
-@@ -1438,7 +1437,7 @@ ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
- if (abuf != NULL)
- dmu_return_arcbuf(abuf);
- dmu_buf_rele(db, FTAG);
-- ztest_range_unlock(rl);
-+ ztest_range_unlock(&rl);
- ztest_object_unlock(zd, lr->lr_foid);
- return (ENOSPC);
- }
-@@ -1495,7 +1494,7 @@ ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
-
- dmu_tx_commit(tx);
-
-- ztest_range_unlock(rl);
-+ ztest_range_unlock(&rl);
- ztest_object_unlock(zd, lr->lr_foid);
-
- return (0);
-@@ -1507,13 +1506,13 @@ ztest_replay_truncate(ztest_ds_t *zd, lr_truncate_t *lr, boolean_t byteswap)
- objset_t *os = zd->zd_os;
- dmu_tx_t *tx;
- uint64_t txg;
-- rl_t *rl;
-+ rl_t rl;
-
- if (byteswap)
- byteswap_uint64_array(lr, sizeof (*lr));
-
- ztest_object_lock(zd, lr->lr_foid, RL_READER);
-- rl = ztest_range_lock(zd, lr->lr_foid, lr->lr_offset, lr->lr_length,
-+ ztest_range_lock(&rl, zd, lr->lr_foid, lr->lr_offset, lr->lr_length,
- RL_WRITER);
-
- tx = dmu_tx_create(os);
-@@ -1522,7 +1521,7 @@ ztest_replay_truncate(ztest_ds_t *zd, lr_truncate_t *lr, boolean_t byteswap)
-
- txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
- if (txg == 0) {
-- ztest_range_unlock(rl);
-+ ztest_range_unlock(&rl);
- ztest_object_unlock(zd, lr->lr_foid);
- return (ENOSPC);
- }
-@@ -1534,7 +1533,7 @@ ztest_replay_truncate(ztest_ds_t *zd, lr_truncate_t *lr, boolean_t byteswap)
-
- dmu_tx_commit(tx);
-
-- ztest_range_unlock(rl);
-+ ztest_range_unlock(&rl);
- ztest_object_unlock(zd, lr->lr_foid);
-
- return (0);
-@@ -1670,6 +1669,8 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- dmu_object_info_t doi;
- dmu_buf_t *db;
- zgd_t *zgd;
-+ rl_t rl;
-+
- int error;
-
- ztest_object_lock(zd, object, RL_READER);
-@@ -1694,9 +1695,10 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- zgd = umem_zalloc(sizeof (*zgd), UMEM_NOFAIL);
- zgd->zgd_zilog = zd->zd_zilog;
- zgd->zgd_private = zd;
-+ zgd->zgd_rl = &rl;
-
- if (buf != NULL) { /* immediate write */
-- zgd->zgd_rl = ztest_range_lock(zd, object, offset, size,
-+ ztest_range_lock(zgd->zgd_rl, zd, object, offset, size,
- RL_READER);
-
- error = dmu_read(os, object, offset, size, buf,
-@@ -1711,7 +1713,7 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- offset = 0;
- }
-
-- zgd->zgd_rl = ztest_range_lock(zd, object, offset, size,
-+ ztest_range_lock(zgd->zgd_rl, zd, object, offset, size,
- RL_READER);
-
- error = dmu_buf_hold(os, object, offset, zgd, &db,
-@@ -1953,12 +1955,12 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)
- objset_t *os = zd->zd_os;
- dmu_tx_t *tx;
- uint64_t txg;
-- rl_t *rl;
-+ rl_t rl;
-
- txg_wait_synced(dmu_objset_pool(os), 0);
-
- ztest_object_lock(zd, object, RL_READER);
-- rl = ztest_range_lock(zd, object, offset, size, RL_WRITER);
-+ ztest_range_lock(&rl, zd, object, offset, size, RL_WRITER);
-
- tx = dmu_tx_create(os);
-
-@@ -1974,7 +1976,7 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)
- (void) dmu_free_long_range(os, object, offset, size);
- }
-
-- ztest_range_unlock(rl);
-+ ztest_range_unlock(&rl);
- ztest_object_unlock(zd, object);
- }
-
-diff --git a/include/sys/zfs_rlock.h b/include/sys/zfs_rlock.h
-index da18b1f..85dc16a 100644
---- a/include/sys/zfs_rlock.h
-+++ b/include/sys/zfs_rlock.h
-@@ -63,7 +63,7 @@ typedef struct rl {
- * is converted to WRITER that specified to lock from the start of the
- * end of file. zfs_range_lock() returns the range lock structure.
- */
--rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type);
-+rl_t *zfs_range_lock(rl_t *rl, znode_t *zp, uint64_t off, uint64_t len, rl_type_t type);
-
- /*
- * Unlock range and destroy range lock structure.
-diff --git a/module/zfs/zfs_rlock.c b/module/zfs/zfs_rlock.c
-index f3ada17..eb81777 100644
---- a/module/zfs/zfs_rlock.c
-+++ b/module/zfs/zfs_rlock.c
-@@ -31,9 +31,9 @@
- * Interface
- * ---------
- * Defined in zfs_rlock.h but essentially:
-- * rl = zfs_range_lock(zp, off, len, lock_type);
-- * zfs_range_unlock(rl);
-- * zfs_range_reduce(rl, off, len);
-+ * zfs_range_lock(&rl, zp, off, len, lock_type);
-+ * zfs_range_unlock(&rl);
-+ * zfs_range_reduce(&rl, off, len);
- *
- * AVL tree
- * --------
-@@ -420,13 +420,11 @@ got_lock:
- * previously locked as RL_WRITER).
- */
- rl_t *
--zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type)
-+zfs_range_lock(rl_t *new, znode_t *zp, uint64_t off, uint64_t len, rl_type_t type)
- {
-- rl_t *new;
-
- ASSERT(type == RL_READER || type == RL_WRITER || type == RL_APPEND);
-
-- new = kmem_alloc(sizeof (rl_t), KM_SLEEP);
- new->r_zp = zp;
- new->r_off = off;
- if (len + off < off) /* overflow */
-@@ -531,7 +529,6 @@ zfs_range_unlock_reader(znode_t *zp, rl_t *remove, list_t *free_list)
- }
-
- mutex_exit(&zp->z_range_lock);
-- kmem_free(remove, sizeof (rl_t));
- }
- }
-
-@@ -572,7 +569,9 @@ zfs_range_unlock(rl_t *rl)
-
- while ((free_rl = list_head(&free_list)) != NULL) {
- list_remove(&free_list, free_rl);
-- zfs_range_free(free_rl);
-+ /* Freeing rl is the caller's responsibility */
-+ if (free_rl != rl)
-+ zfs_range_free(free_rl);
- }
-
- list_destroy(&free_list);
-diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
-index 2da5fec..1ef5299 100644
---- a/module/zfs/zfs_vnops.c
-+++ b/module/zfs/zfs_vnops.c
-@@ -370,7 +370,7 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- objset_t *os;
- ssize_t n, nbytes;
- int error = 0;
-- rl_t *rl;
-+ rl_t rl;
- #ifdef HAVE_UIO_ZEROCOPY
- xuio_t *xuio = NULL;
- #endif /* HAVE_UIO_ZEROCOPY */
-@@ -418,7 +418,7 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- /*
- * Lock the range against changes.
- */
-- rl = zfs_range_lock(zp, uio->uio_loffset, uio->uio_resid, RL_READER);
-+ zfs_range_lock(&rl, zp, uio->uio_loffset, uio->uio_resid, RL_READER);
-
- /*
- * If we are reading past end-of-file we can skip
-@@ -482,7 +482,7 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- n -= nbytes;
- }
- out:
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- ZFS_ACCESSTIME_STAMP(zsb, zp);
- zfs_inode_update(zp);
-@@ -524,7 +524,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- zilog_t *zilog;
- offset_t woff;
- ssize_t n, nbytes;
-- rl_t *rl;
-+ rl_t rl;
- int max_blksz = zsb->z_max_blksz;
- int error = 0;
- arc_buf_t *abuf;
-@@ -608,9 +608,9 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- * Obtain an appending range lock to guarantee file append
- * semantics. We reset the write offset once we have the lock.
- */
-- rl = zfs_range_lock(zp, 0, n, RL_APPEND);
-- woff = rl->r_off;
-- if (rl->r_len == UINT64_MAX) {
-+ zfs_range_lock(&rl, zp, 0, n, RL_APPEND);
-+ woff = rl.r_off;
-+ if (rl.r_len == UINT64_MAX) {
- /*
- * We overlocked the file because this write will cause
- * the file block size to increase.
-@@ -625,11 +625,11 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- * this write, then this range lock will lock the entire file
- * so that we can re-write the block safely.
- */
-- rl = zfs_range_lock(zp, woff, n, RL_WRITER);
-+ zfs_range_lock(&rl, zp, woff, n, RL_WRITER);
- }
-
- if (woff >= limit) {
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- ZFS_EXIT(zsb);
- return (EFBIG);
- }
-@@ -719,7 +719,7 @@ again:
- * on the first iteration since zfs_range_reduce() will
- * shrink down r_len to the appropriate size.
- */
-- if (rl->r_len == UINT64_MAX) {
-+ if (rl.r_len == UINT64_MAX) {
- uint64_t new_blksz;
-
- if (zp->z_blksz > max_blksz) {
-@@ -729,7 +729,7 @@ again:
- new_blksz = MIN(end_size, max_blksz);
- }
- zfs_grow_blocksize(zp, new_blksz, tx);
-- zfs_range_reduce(rl, woff, n);
-+ zfs_range_reduce(&rl, woff, n);
- }
-
- /*
-@@ -842,7 +842,7 @@ again:
- uio_prefaultpages(MIN(n, max_blksz), uio);
- }
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- /*
- * If we're in replay mode, or we made no progress, return error.
-@@ -893,6 +893,7 @@ zfs_get_done(zgd_t *zgd, int error)
- if (error == 0 && zgd->zgd_bp)
- zil_add_block(zgd->zgd_zilog, zgd->zgd_bp);
-
-+ kmem_free(zgd->zgd_rl, sizeof (rl_t));
- kmem_free(zgd, sizeof (zgd_t));
- }
-
-@@ -935,6 +936,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- }
-
- zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
-+ zgd->zgd_rl = (rl_t *)kmem_zalloc(sizeof (rl_t), KM_SLEEP);
- zgd->zgd_zilog = zsb->z_log;
- zgd->zgd_private = zp;
-
-@@ -946,7 +948,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- * we don't have to write the data twice.
- */
- if (buf != NULL) { /* immediate write */
-- zgd->zgd_rl = zfs_range_lock(zp, offset, size, RL_READER);
-+ zfs_range_lock(zgd->zgd_rl, zp, offset, size, RL_READER);
- /* test for truncation needs to be done while range locked */
- if (offset >= zp->z_size) {
- error = ENOENT;
-@@ -967,7 +969,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
- size = zp->z_blksz;
- blkoff = ISP2(size) ? P2PHASE(offset, size) : offset;
- offset -= blkoff;
-- zgd->zgd_rl = zfs_range_lock(zp, offset, size,
-+ zfs_range_lock(zgd->zgd_rl, zp, offset, size,
- RL_READER);
- if (zp->z_blksz == size)
- break;
-diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
-index 3a6872f..e363839 100644
---- a/module/zfs/zfs_znode.c
-+++ b/module/zfs/zfs_znode.c
-@@ -1158,20 +1158,20 @@ zfs_extend(znode_t *zp, uint64_t end)
- {
- zfs_sb_t *zsb = ZTOZSB(zp);
- dmu_tx_t *tx;
-- rl_t *rl;
-+ rl_t rl;
- uint64_t newblksz;
- int error;
-
- /*
- * We will change zp_size, lock the whole file.
- */
-- rl = zfs_range_lock(zp, 0, UINT64_MAX, RL_WRITER);
-+ zfs_range_lock(&rl, zp, 0, UINT64_MAX, RL_WRITER);
-
- /*
- * Nothing to do if file already at desired length.
- */
- if (end <= zp->z_size) {
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (0);
- }
- top:
-@@ -1202,7 +1202,7 @@ top:
- goto top;
- }
- dmu_tx_abort(tx);
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (error);
- }
-
-@@ -1214,7 +1214,7 @@ top:
- VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_SIZE(ZTOZSB(zp)),
- &zp->z_size, sizeof (zp->z_size), tx));
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- dmu_tx_commit(tx);
-
-@@ -1235,19 +1235,19 @@ static int
- zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
- {
- zfs_sb_t *zsb = ZTOZSB(zp);
-- rl_t *rl;
-+ rl_t rl;
- int error;
-
- /*
- * Lock the range being freed.
- */
-- rl = zfs_range_lock(zp, off, len, RL_WRITER);
-+ zfs_range_lock(&rl, zp, off, len, RL_WRITER);
-
- /*
- * Nothing to do if file already at desired length.
- */
- if (off >= zp->z_size) {
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (0);
- }
-
-@@ -1256,7 +1256,7 @@ zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
-
- error = dmu_free_long_range(zsb->z_os, zp->z_id, off, len);
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- return (error);
- }
-@@ -1275,7 +1275,7 @@ zfs_trunc(znode_t *zp, uint64_t end)
- {
- zfs_sb_t *zsb = ZTOZSB(zp);
- dmu_tx_t *tx;
-- rl_t *rl;
-+ rl_t rl;
- int error;
- sa_bulk_attr_t bulk[2];
- int count = 0;
-@@ -1283,19 +1283,19 @@ zfs_trunc(znode_t *zp, uint64_t end)
- /*
- * We will change zp_size, lock the whole file.
- */
-- rl = zfs_range_lock(zp, 0, UINT64_MAX, RL_WRITER);
-+ zfs_range_lock(&rl, zp, 0, UINT64_MAX, RL_WRITER);
-
- /*
- * Nothing to do if file already at desired length.
- */
- if (end >= zp->z_size) {
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (0);
- }
-
- error = dmu_free_long_range(zsb->z_os, zp->z_id, end, -1);
- if (error) {
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (error);
- }
- top:
-@@ -1310,7 +1310,7 @@ top:
- goto top;
- }
- dmu_tx_abort(tx);
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- return (error);
- }
-
-@@ -1327,7 +1327,7 @@ top:
-
- dmu_tx_commit(tx);
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- return (0);
- }
-diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
-index 125d58d..bbe53d9 100644
---- a/module/zfs/zvol.c
-+++ b/module/zfs/zvol.c
-@@ -537,7 +537,7 @@ zvol_write(void *arg)
- uint64_t size = blk_rq_bytes(req);
- int error = 0;
- dmu_tx_t *tx;
-- rl_t *rl;
-+ rl_t rl;
-
- if (req->cmd_flags & VDEV_REQ_FLUSH)
- zil_commit(zv->zv_zilog, ZVOL_OBJ);
-@@ -550,7 +550,7 @@ zvol_write(void *arg)
- return;
- }
-
-- rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_WRITER);
-+ zfs_range_lock(&rl, &zv->zv_znode, offset, size, RL_WRITER);
-
- tx = dmu_tx_create(zv->zv_objset);
- dmu_tx_hold_write(tx, ZVOL_OBJ, offset, size);
-@@ -559,7 +559,7 @@ zvol_write(void *arg)
- error = dmu_tx_assign(tx, TXG_WAIT);
- if (error) {
- dmu_tx_abort(tx);
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
- blk_end_request(req, -error, size);
- return;
- }
-@@ -570,7 +570,7 @@ zvol_write(void *arg)
- req->cmd_flags & VDEV_REQ_FUA);
-
- dmu_tx_commit(tx);
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- if ((req->cmd_flags & VDEV_REQ_FUA) ||
- zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS)
-@@ -589,7 +589,7 @@ zvol_discard(void *arg)
- uint64_t offset = blk_rq_pos(req) << 9;
- uint64_t size = blk_rq_bytes(req);
- int error;
-- rl_t *rl;
-+ rl_t rl;
-
- if (offset + size > zv->zv_volsize) {
- blk_end_request(req, -EIO, size);
-@@ -601,7 +601,7 @@ zvol_discard(void *arg)
- return;
- }
-
-- rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_WRITER);
-+ zfs_range_lock(&rl, &zv->zv_znode, offset, size, RL_WRITER);
-
- error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, offset, size);
-
-@@ -609,7 +609,7 @@ zvol_discard(void *arg)
- * TODO: maybe we should add the operation to the log.
- */
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- blk_end_request(req, -error, size);
- }
-@@ -630,18 +630,18 @@ zvol_read(void *arg)
- uint64_t offset = blk_rq_pos(req) << 9;
- uint64_t size = blk_rq_bytes(req);
- int error;
-- rl_t *rl;
-+ rl_t rl;
-
- if (size == 0) {
- blk_end_request(req, 0, size);
- return;
- }
-
-- rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_READER);
-+ zfs_range_lock(&rl, &zv->zv_znode, offset, size, RL_READER);
-
- error = dmu_read_req(zv->zv_objset, ZVOL_OBJ, req);
-
-- zfs_range_unlock(rl);
-+ zfs_range_unlock(&rl);
-
- /* convert checksum errors into IO errors */
- if (error == ECKSUM)
-@@ -744,6 +744,7 @@ zvol_get_done(zgd_t *zgd, int error)
- if (error == 0 && zgd->zgd_bp)
- zil_add_block(zgd->zgd_zilog, zgd->zgd_bp);
-
-+ kmem_free(zgd->zgd_rl, sizeof (rl_t));
- kmem_free(zgd, sizeof (zgd_t));
- }
-
-@@ -766,7 +767,8 @@ zvol_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
-
- zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
- zgd->zgd_zilog = zv->zv_zilog;
-- zgd->zgd_rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_READER);
-+ zgd->zgd_rl = kmem_alloc(sizeof (rl_t), KM_SLEEP);
-+ zfs_range_lock(zgd->zgd_rl, &zv->zv_znode, offset, size, RL_READER);
-
- /*
- * Write records come in two flavors: immediate and indirect.
diff --git a/sys-fs/zfs/files/zfs-0.6.0_rc9-use-pushpage.patch b/sys-fs/zfs/files/zfs-0.6.0_rc9-use-pushpage.patch
deleted file mode 100644
index 129894bb10f0..000000000000
--- a/sys-fs/zfs/files/zfs-0.6.0_rc9-use-pushpage.patch
+++ /dev/null
@@ -1,1100 +0,0 @@
-ab8aba2 Switch KM_SLEEP to KM_PUSHPAGE
-diff --git a/module/zfs/bplist.c b/module/zfs/bplist.c
-index 5d1cf7e..d196351 100644
---- a/module/zfs/bplist.c
-+++ b/module/zfs/bplist.c
-@@ -44,7 +44,7 @@
- void
- bplist_append(bplist_t *bpl, const blkptr_t *bp)
- {
-- bplist_entry_t *bpe = kmem_alloc(sizeof (*bpe), KM_SLEEP);
-+ bplist_entry_t *bpe = kmem_alloc(sizeof (*bpe), KM_PUSHPAGE);
-
- mutex_enter(&bpl->bpl_lock);
- bpe->bpe_blk = *bp;
-diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
-index 34ce2f6..d5b469f 100644
---- a/module/zfs/dbuf.c
-+++ b/module/zfs/dbuf.c
-@@ -298,7 +298,7 @@ static void __dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh,
- #if defined(_KERNEL) && defined(HAVE_SPL)
- /* Large allocations which do not require contiguous pages
- * should be using vmem_alloc() in the linux kernel */
-- h->hash_table = vmem_zalloc(hsize * sizeof (void *), KM_SLEEP);
-+ h->hash_table = vmem_zalloc(hsize * sizeof (void *), KM_PUSHPAGE);
- #else
- h->hash_table = kmem_zalloc(hsize * sizeof (void *), KM_NOSLEEP);
- #endif
-@@ -1719,7 +1719,7 @@ static void __dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh,
- ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock));
- ASSERT(dn->dn_type != DMU_OT_NONE);
-
-- db = kmem_cache_alloc(dbuf_cache, KM_SLEEP);
-+ db = kmem_cache_alloc(dbuf_cache, KM_PUSHPAGE);
-
- db->db_objset = os;
- db->db.db_object = dn->dn_object;
-@@ -2019,7 +2019,7 @@ static void __dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh,
- int error;
-
- dh = kmem_zalloc(sizeof(struct dbuf_hold_impl_data) *
-- DBUF_HOLD_IMPL_MAX_DEPTH, KM_SLEEP);
-+ DBUF_HOLD_IMPL_MAX_DEPTH, KM_PUSHPAGE);
- __dbuf_hold_impl_init(dh, dn, level, blkid, fail_sparse, tag, dbp, 0);
-
- error = __dbuf_hold_impl(dh);
-diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
-index cda4f84..1d4d125 100644
---- a/module/zfs/dmu.c
-+++ b/module/zfs/dmu.c
-@@ -381,7 +381,7 @@
- }
- nblks = 1;
- }
-- dbp = kmem_zalloc(sizeof (dmu_buf_t *) * nblks, KM_SLEEP | KM_NODEBUG);
-+ dbp = kmem_zalloc(sizeof (dmu_buf_t *) * nblks, KM_PUSHPAGE | KM_NODEBUG);
-
- if (dn->dn_objset->os_dsl_dataset)
- dp = dn->dn_objset->os_dsl_dataset->ds_dir->dd_pool;
-@@ -863,11 +863,11 @@
- uio_t *uio = &xuio->xu_uio;
-
- uio->uio_iovcnt = nblk;
-- uio->uio_iov = kmem_zalloc(nblk * sizeof (iovec_t), KM_SLEEP);
-+ uio->uio_iov = kmem_zalloc(nblk * sizeof (iovec_t), KM_PUSHPAGE);
-
-- priv = kmem_zalloc(sizeof (dmu_xuio_t), KM_SLEEP);
-+ priv = kmem_zalloc(sizeof (dmu_xuio_t), KM_PUSHPAGE);
- priv->cnt = nblk;
-- priv->bufs = kmem_zalloc(nblk * sizeof (arc_buf_t *), KM_SLEEP);
-+ priv->bufs = kmem_zalloc(nblk * sizeof (arc_buf_t *), KM_PUSHPAGE);
- priv->iovp = uio->uio_iov;
- XUIO_XUZC_PRIV(xuio) = priv;
-
-@@ -1431,7 +1431,7 @@
- return (EIO); /* Make zl_get_data do txg_waited_synced() */
- }
-
-- dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_SLEEP);
-+ dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_PUSHPAGE);
- dsa->dsa_dr = NULL;
- dsa->dsa_done = done;
- dsa->dsa_zgd = zgd;
-@@ -1555,7 +1555,7 @@
- dr->dt.dl.dr_override_state = DR_IN_DMU_SYNC;
- mutex_exit(&db->db_mtx);
-
-- dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_SLEEP);
-+ dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_PUSHPAGE);
- dsa->dsa_dr = dr;
- dsa->dsa_done = done;
- dsa->dsa_zgd = zgd;
-diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c
-index ead0f3e..81c6dfe 100644
---- a/module/zfs/dmu_tx.c
-+++ b/module/zfs/dmu_tx.c
-@@ -63,7 +63,7 @@ typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
- dmu_tx_t *
- dmu_tx_create_dd(dsl_dir_t *dd)
- {
-- dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_SLEEP);
-+ dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_PUSHPAGE);
- tx->tx_dir = dd;
- if (dd)
- tx->tx_pool = dd->dd_pool;
-@@ -141,7 +141,7 @@ typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
- }
- }
-
-- txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP);
-+ txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_PUSHPAGE);
- txh->txh_tx = tx;
- txh->txh_dnode = dn;
- #ifdef DEBUG_DMU_TX
-@@ -1241,7 +1241,7 @@ typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
- {
- dmu_tx_callback_t *dcb;
-
-- dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_SLEEP);
-+ dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_PUSHPAGE);
-
- dcb->dcb_func = func;
- dcb->dcb_data = data;
-diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c
-index 897ea8a..1763bae 100644
---- a/module/zfs/dmu_zfetch.c
-+++ b/module/zfs/dmu_zfetch.c
-@@ -699,7 +699,7 @@
- if (cur_streams >= max_streams) {
- return;
- }
-- newstream = kmem_zalloc(sizeof (zstream_t), KM_SLEEP);
-+ newstream = kmem_zalloc(sizeof (zstream_t), KM_PUSHPAGE);
- }
-
- newstream->zst_offset = zst.zst_offset;
-diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
-index 5438f60..99ac625 100644
---- a/module/zfs/dnode.c
-+++ b/module/zfs/dnode.c
-@@ -372,7 +372,7 @@
- dnode_create(objset_t *os, dnode_phys_t *dnp, dmu_buf_impl_t *db,
- uint64_t object, dnode_handle_t *dnh)
- {
-- dnode_t *dn = kmem_cache_alloc(dnode_cache, KM_SLEEP);
-+ dnode_t *dn = kmem_cache_alloc(dnode_cache, KM_PUSHPAGE);
-
- ASSERT(!POINTER_IS_VALID(dn->dn_objset));
- dn->dn_moved = 0;
-@@ -1491,7 +1491,7 @@
- } else if (blkid > rp->fr_blkid && endblk < fr_endblk) {
- /* clear a chunk out of this range */
- free_range_t *new_rp =
-- kmem_alloc(sizeof (free_range_t), KM_SLEEP);
-+ kmem_alloc(sizeof (free_range_t), KM_PUSHPAGE);
-
- new_rp->fr_blkid = endblk;
- new_rp->fr_nblks = fr_endblk - endblk;
-@@ -1669,7 +1669,7 @@
- avl_tree_t *tree = &dn->dn_ranges[tx->tx_txg&TXG_MASK];
-
- /* Add new range to dn_ranges */
-- rp = kmem_alloc(sizeof (free_range_t), KM_SLEEP);
-+ rp = kmem_alloc(sizeof (free_range_t), KM_PUSHPAGE);
- rp->fr_blkid = blkid;
- rp->fr_nblks = nblks;
- found = avl_find(tree, rp, &where);
-diff --git a/module/zfs/lzjb.c b/module/zfs/lzjb.c
-index 4da30cf..43d0df0 100644
---- a/module/zfs/lzjb.c
-+++ b/module/zfs/lzjb.c
-@@ -56,7 +56,7 @@
- uint16_t *hp;
- uint16_t *lempel;
-
-- lempel = kmem_zalloc(LEMPEL_SIZE * sizeof (uint16_t), KM_SLEEP);
-+ lempel = kmem_zalloc(LEMPEL_SIZE * sizeof (uint16_t), KM_PUSHPAGE);
- while (src < (uchar_t *)s_start + s_len) {
- if ((copymask <<= 1) == (1 << NBBY)) {
- if (dst >= (uchar_t *)d_start + d_len - 1 - 2 * NBBY) {
-diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
-index c33c5e8..d06012f 100644
---- a/module/zfs/metaslab.c
-+++ b/module/zfs/metaslab.c
-@@ -102,7 +102,7 @@
- {
- metaslab_class_t *mc;
-
-- mc = kmem_zalloc(sizeof (metaslab_class_t), KM_SLEEP);
-+ mc = kmem_zalloc(sizeof (metaslab_class_t), KM_PUSHPAGE);
-
- mc->mc_spa = spa;
- mc->mc_rotor = NULL;
-@@ -217,7 +217,7 @@
- {
- metaslab_group_t *mg;
-
-- mg = kmem_zalloc(sizeof (metaslab_group_t), KM_SLEEP);
-+ mg = kmem_zalloc(sizeof (metaslab_group_t), KM_PUSHPAGE);
- mutex_init(&mg->mg_lock, NULL, MUTEX_DEFAULT, NULL);
- avl_create(&mg->mg_metaslab_tree, metaslab_compare,
- sizeof (metaslab_t), offsetof(struct metaslab, ms_group_node));
-@@ -422,9 +422,9 @@
- space_seg_t *ss;
-
- ASSERT(sm->sm_ppd == NULL);
-- sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP);
-+ sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_PUSHPAGE);
-
-- sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP);
-+ sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_PUSHPAGE);
- avl_create(sm->sm_pp_root, metaslab_segsize_compare,
- sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node));
-
-@@ -725,7 +725,7 @@
- vdev_t *vd = mg->mg_vd;
- metaslab_t *msp;
-
-- msp = kmem_zalloc(sizeof (metaslab_t), KM_SLEEP);
-+ msp = kmem_zalloc(sizeof (metaslab_t), KM_PUSHPAGE);
- mutex_init(&msp->ms_lock, NULL, MUTEX_DEFAULT, NULL);
-
- msp->ms_smo_syncing = *smo;
-diff --git a/module/zfs/spa.c b/module/zfs/spa.c
-index a43b883..c33a33a 100644
---- a/module/zfs/spa.c
-+++ b/module/zfs/spa.c
-@@ -151,7 +151,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- const char *propname = zpool_prop_to_name(prop);
- nvlist_t *propval;
-
-- VERIFY(nvlist_alloc(&propval, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&propval, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_uint64(propval, ZPROP_SOURCE, src) == 0);
-
- if (strval != NULL)
-@@ -233,7 +233,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- zap_attribute_t za;
- int err;
-
-- err = nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_SLEEP);
-+ err = nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_PUSHPAGE);
- if (err)
- return err;
-
-@@ -285,7 +285,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
-
- strval = kmem_alloc(
- MAXNAMELEN + strlen(MOS_DIR_NAME) + 1,
-- KM_SLEEP);
-+ KM_PUSHPAGE);
- dsl_dataset_name(ds, strval);
- dsl_dataset_rele(ds, FTAG);
- rw_exit(&dp->dp_config_rwlock);
-@@ -304,7 +304,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
-
- case 1:
- /* string property */
-- strval = kmem_alloc(za.za_num_integers, KM_SLEEP);
-+ strval = kmem_alloc(za.za_num_integers, KM_PUSHPAGE);
- err = zap_lookup(mos, spa->spa_pool_props_object,
- za.za_name, 1, za.za_num_integers, strval);
- if (err) {
-@@ -510,7 +510,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- return;
-
- dp = kmem_alloc(sizeof (spa_config_dirent_t),
-- KM_SLEEP);
-+ KM_PUSHPAGE);
-
- if (cachefile[0] == '\0')
- dp->scd_path = spa_strdup(spa_config_path);
-@@ -1083,7 +1083,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- * active configuration, then we also mark this vdev as an active spare.
- */
- spa->spa_spares.sav_vdevs = kmem_alloc(nspares * sizeof (void *),
-- KM_SLEEP);
-+ KM_PUSHPAGE);
- for (i = 0; i < spa->spa_spares.sav_count; i++) {
- VERIFY(spa_config_parse(spa, &vd, spares[i], NULL, 0,
- VDEV_ALLOC_SPARE) == 0);
-@@ -1131,7 +1131,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- DATA_TYPE_NVLIST_ARRAY) == 0);
-
- spares = kmem_alloc(spa->spa_spares.sav_count * sizeof (void *),
-- KM_SLEEP);
-+ KM_PUSHPAGE);
- for (i = 0; i < spa->spa_spares.sav_count; i++)
- spares[i] = vdev_config_generate(spa,
- spa->spa_spares.sav_vdevs[i], B_TRUE, VDEV_CONFIG_SPARE);
-@@ -1165,7 +1165,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (sav->sav_config != NULL) {
- VERIFY(nvlist_lookup_nvlist_array(sav->sav_config,
- ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0);
-- newvdevs = kmem_alloc(nl2cache * sizeof (void *), KM_SLEEP);
-+ newvdevs = kmem_alloc(nl2cache * sizeof (void *), KM_PUSHPAGE);
- } else {
- nl2cache = 0;
- }
-@@ -1259,7 +1259,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- VERIFY(nvlist_remove(sav->sav_config, ZPOOL_CONFIG_L2CACHE,
- DATA_TYPE_NVLIST_ARRAY) == 0);
-
-- l2cache = kmem_alloc(sav->sav_count * sizeof (void *), KM_SLEEP);
-+ l2cache = kmem_alloc(sav->sav_count * sizeof (void *), KM_PUSHPAGE);
- for (i = 0; i < sav->sav_count; i++)
- l2cache[i] = vdev_config_generate(spa,
- sav->sav_vdevs[i], B_TRUE, VDEV_CONFIG_L2CACHE);
-@@ -1285,7 +1285,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- nvsize = *(uint64_t *)db->db_data;
- dmu_buf_rele(db, FTAG);
-
-- packed = kmem_alloc(nvsize, KM_SLEEP | KM_NODEBUG);
-+ packed = kmem_alloc(nvsize, KM_PUSHPAGE | KM_NODEBUG);
- error = dmu_read(spa->spa_meta_objset, obj, 0, nvsize, packed,
- DMU_READ_PREFETCH);
- if (error == 0)
-@@ -1341,8 +1341,8 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- uint64_t idx = 0;
-
- child = kmem_alloc(rvd->vdev_children * sizeof (nvlist_t **),
-- KM_SLEEP);
-- VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ KM_PUSHPAGE);
-+ VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- for (c = 0; c < rvd->vdev_children; c++) {
- vdev_t *tvd = rvd->vdev_child[c];
-@@ -1697,7 +1697,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- &glist, &gcount) != 0)
- return;
-
-- vd = kmem_zalloc(gcount * sizeof (vdev_t *), KM_SLEEP);
-+ vd = kmem_zalloc(gcount * sizeof (vdev_t *), KM_PUSHPAGE);
-
- /* attempt to online all the vdevs & validate */
- attempt_reopen = B_TRUE;
-@@ -1778,7 +1778,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_SPLIT,
- &nvl) == 0) {
- VERIFY(nvlist_dup(nvl, &spa->spa_config_splitting,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- }
-
- gethrestime(&spa->spa_loaded_ts);
-@@ -2435,7 +2435,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- */
- if (config != NULL && spa->spa_config) {
- VERIFY(nvlist_dup(spa->spa_config, config,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist(*config,
- ZPOOL_CONFIG_LOAD_INFO,
- spa->spa_load_info) == 0);
-@@ -2811,13 +2811,13 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- &olddevs, &oldndevs) == 0);
-
- newdevs = kmem_alloc(sizeof (void *) *
-- (ndevs + oldndevs), KM_SLEEP);
-+ (ndevs + oldndevs), KM_PUSHPAGE);
- for (i = 0; i < oldndevs; i++)
- VERIFY(nvlist_dup(olddevs[i], &newdevs[i],
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- for (i = 0; i < ndevs; i++)
- VERIFY(nvlist_dup(devs[i], &newdevs[i + oldndevs],
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_remove(sav->sav_config, config,
- DATA_TYPE_NVLIST_ARRAY) == 0);
-@@ -2832,7 +2832,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- * Generate a new dev list.
- */
- VERIFY(nvlist_alloc(&sav->sav_config, NV_UNIQUE_NAME,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist_array(sav->sav_config, config,
- devs, ndevs) == 0);
- }
-@@ -2958,7 +2958,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
- &spares, &nspares) == 0) {
- VERIFY(nvlist_alloc(&spa->spa_spares.sav_config, NV_UNIQUE_NAME,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist_array(spa->spa_spares.sav_config,
- ZPOOL_CONFIG_SPARES, spares, nspares) == 0);
- spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
-@@ -2973,7 +2973,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
- &l2cache, &nl2cache) == 0) {
- VERIFY(nvlist_alloc(&spa->spa_l2cache.sav_config,
-- NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
- ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache) == 0);
- spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
-@@ -3111,7 +3111,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- /*
- * Put this pool's top-level vdevs into a root vdev.
- */
-- VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE,
- VDEV_TYPE_ROOT) == 0);
- VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) == 0);
-@@ -3422,7 +3422,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- ZPOOL_CONFIG_SPARES, DATA_TYPE_NVLIST_ARRAY) == 0);
- else
- VERIFY(nvlist_alloc(&spa->spa_spares.sav_config,
-- NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist_array(spa->spa_spares.sav_config,
- ZPOOL_CONFIG_SPARES, spares, nspares) == 0);
- spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
-@@ -3437,7 +3437,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- ZPOOL_CONFIG_L2CACHE, DATA_TYPE_NVLIST_ARRAY) == 0);
- else
- VERIFY(nvlist_alloc(&spa->spa_l2cache.sav_config,
-- NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
- ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache) == 0);
- spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
-@@ -3520,7 +3520,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- * pools are bootable.
- */
- if ((!error || error == EEXIST) && spa->spa_bootfs) {
-- char *tmpname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
-+ char *tmpname = kmem_alloc(MAXPATHLEN, KM_PUSHPAGE);
-
- /*
- * We have to play games with the name since the
-@@ -3529,7 +3529,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (dsl_dsobj_to_dsname(spa_name(spa),
- spa->spa_bootfs, tmpname) == 0) {
- char *cp;
-- char *dsname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
-+ char *dsname = kmem_alloc(MAXPATHLEN, KM_PUSHPAGE);
-
- cp = strchr(tmpname, '/');
- if (cp == NULL) {
-@@ -3934,7 +3934,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- if (strcmp(oldvd->vdev_path, newvd->vdev_path) == 0) {
- spa_strfree(oldvd->vdev_path);
- oldvd->vdev_path = kmem_alloc(strlen(newvd->vdev_path) + 5,
-- KM_SLEEP);
-+ KM_PUSHPAGE);
- (void) sprintf(oldvd->vdev_path, "%s/%s",
- newvd->vdev_path, "old");
- if (oldvd->vdev_devid != NULL) {
-@@ -4329,8 +4329,8 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- nvlist_lookup_nvlist(nvl, ZPOOL_CONFIG_L2CACHE, &tmp) == 0)
- return (spa_vdev_exit(spa, NULL, txg, EINVAL));
-
-- vml = kmem_zalloc(children * sizeof (vdev_t *), KM_SLEEP);
-- glist = kmem_zalloc(children * sizeof (uint64_t), KM_SLEEP);
-+ vml = kmem_zalloc(children * sizeof (vdev_t *), KM_PUSHPAGE);
-+ glist = kmem_zalloc(children * sizeof (uint64_t), KM_PUSHPAGE);
-
- /* then, loop over each vdev and validate it */
- for (c = 0; c < children; c++) {
-@@ -4410,7 +4410,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- * Temporarily record the splitting vdevs in the spa config. This
- * will disappear once the config is regenerated.
- */
-- VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_uint64_array(nvl, ZPOOL_CONFIG_SPLIT_LIST,
- glist, children) == 0);
- kmem_free(glist, children * sizeof (uint64_t));
-@@ -4457,7 +4457,7 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- /* if that worked, generate a real config for the new pool */
- if (newspa->spa_root_vdev != NULL) {
- VERIFY(nvlist_alloc(&newspa->spa_config_splitting,
-- NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_uint64(newspa->spa_config_splitting,
- ZPOOL_CONFIG_SPLIT_GUID, spa_guid(spa)) == 0);
- spa_config_set(newspa, spa_config_generate(newspa, NULL, -1ULL,
-@@ -4569,12 +4569,12 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- int i, j;
-
- if (count > 1)
-- newdev = kmem_alloc((count - 1) * sizeof (void *), KM_SLEEP);
-+ newdev = kmem_alloc((count - 1) * sizeof (void *), KM_PUSHPAGE);
-
- for (i = 0, j = 0; i < count; i++) {
- if (dev[i] == dev_to_remove)
- continue;
-- VERIFY(nvlist_dup(dev[i], &newdev[j++], KM_SLEEP) == 0);
-+ VERIFY(nvlist_dup(dev[i], &newdev[j++], KM_PUSHPAGE) == 0);
- }
-
- VERIFY(nvlist_remove(config, name, DATA_TYPE_NVLIST_ARRAY) == 0);
-@@ -5229,10 +5229,10 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- * saves us a pre-read to get data we don't actually care about.
- */
- bufsize = P2ROUNDUP(nvsize, SPA_CONFIG_BLOCKSIZE);
-- packed = vmem_alloc(bufsize, KM_SLEEP);
-+ packed = vmem_alloc(bufsize, KM_PUSHPAGE);
-
- VERIFY(nvlist_pack(nv, &packed, &nvsize, NV_ENCODE_XDR,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
- bzero(packed + nvsize, bufsize - nvsize);
-
- dmu_write(spa->spa_meta_objset, obj, 0, bufsize, packed, tx);
-@@ -5270,11 +5270,11 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
- &sav->sav_object, tx) == 0);
- }
-
-- VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- if (sav->sav_count == 0) {
- VERIFY(nvlist_add_nvlist_array(nvroot, config, NULL, 0) == 0);
- } else {
-- list = kmem_alloc(sav->sav_count * sizeof (void *), KM_SLEEP);
-+ list = kmem_alloc(sav->sav_count * sizeof (void *), KM_PUSHPAGE);
- for (i = 0; i < sav->sav_count; i++)
- list[i] = vdev_config_generate(spa, sav->sav_vdevs[i],
- B_FALSE, VDEV_CONFIG_L2CACHE);
-diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
-index d84d6b0..eca2328 100644
---- a/module/zfs/spa_config.c
-+++ b/module/zfs/spa_config.c
-@@ -81,7 +81,7 @@
- /*
- * Open the configuration file.
- */
-- pathname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
-+ pathname = kmem_alloc(MAXPATHLEN, KM_PUSHPAGE);
-
- (void) snprintf(pathname, MAXPATHLEN, "%s%s",
- (rootdir != NULL) ? "./" : "", spa_config_path);
-@@ -96,7 +96,7 @@
- if (kobj_get_filesize(file, &fsize) != 0)
- goto out;
-
-- buf = kmem_alloc(fsize, KM_SLEEP | KM_NODEBUG);
-+ buf = kmem_alloc(fsize, KM_PUSHPAGE | KM_NODEBUG);
-
- /*
- * Read the nvlist from the file.
-@@ -107,7 +107,7 @@
- /*
- * Unpack the nvlist.
- */
-- if (nvlist_unpack(buf, fsize, &nvlist, KM_SLEEP) != 0)
-+ if (nvlist_unpack(buf, fsize, &nvlist, KM_PUSHPAGE) != 0)
- goto out;
-
- /*
-@@ -159,11 +159,11 @@
- */
- VERIFY(nvlist_size(nvl, &buflen, NV_ENCODE_XDR) == 0);
-
-- buf = kmem_alloc(buflen, KM_SLEEP | KM_NODEBUG);
-- temp = kmem_zalloc(MAXPATHLEN, KM_SLEEP);
-+ buf = kmem_alloc(buflen, KM_PUSHPAGE | KM_NODEBUG);
-+ temp = kmem_zalloc(MAXPATHLEN, KM_PUSHPAGE);
-
- VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
-
- /*
- * Write the configuration to disk. We need to do the traditional
-@@ -232,7 +232,7 @@
-
- if (nvl == NULL)
- VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_add_nvlist(nvl, spa->spa_name,
- spa->spa_config) == 0);
-@@ -275,7 +275,7 @@
- if (*generation == spa_config_generation)
- return (NULL);
-
-- VERIFY(nvlist_alloc(&pools, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&pools, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- mutex_enter(&spa_namespace_lock);
- while ((spa = spa_next(spa)) != NULL) {
-@@ -332,7 +332,7 @@
- if (txg == -1ULL)
- txg = spa->spa_config_txg;
-
-- VERIFY(nvlist_alloc(&config, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&config, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
- spa_version(spa)) == 0);
-@@ -407,21 +407,21 @@
- ddt_stat_t *dds;
- ddt_object_t *ddo;
-
-- ddh = kmem_zalloc(sizeof (ddt_histogram_t), KM_SLEEP);
-+ ddh = kmem_zalloc(sizeof (ddt_histogram_t), KM_PUSHPAGE);
- ddt_get_dedup_histogram(spa, ddh);
- VERIFY(nvlist_add_uint64_array(config,
- ZPOOL_CONFIG_DDT_HISTOGRAM,
- (uint64_t *)ddh, sizeof (*ddh) / sizeof (uint64_t)) == 0);
- kmem_free(ddh, sizeof (ddt_histogram_t));
-
-- ddo = kmem_zalloc(sizeof (ddt_object_t), KM_SLEEP);
-+ ddo = kmem_zalloc(sizeof (ddt_object_t), KM_PUSHPAGE);
- ddt_get_dedup_object_stats(spa, ddo);
- VERIFY(nvlist_add_uint64_array(config,
- ZPOOL_CONFIG_DDT_OBJ_STATS,
- (uint64_t *)ddo, sizeof (*ddo) / sizeof (uint64_t)) == 0);
- kmem_free(ddo, sizeof (ddt_object_t));
-
-- dds = kmem_zalloc(sizeof (ddt_stat_t), KM_SLEEP);
-+ dds = kmem_zalloc(sizeof (ddt_stat_t), KM_PUSHPAGE);
- ddt_get_dedup_stats(spa, dds);
- VERIFY(nvlist_add_uint64_array(config,
- ZPOOL_CONFIG_DDT_STATS,
-diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c
-index 243f2b4..508df2e 100644
---- a/module/zfs/spa_history.c
-+++ b/module/zfs/spa_history.c
-@@ -233,7 +233,7 @@
- }
- #endif
-
-- VERIFY(nvlist_alloc(&nvrecord, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&nvrecord, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
- VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_TIME,
- gethrestime_sec()) == 0);
- VERIFY(nvlist_add_uint64(nvrecord, ZPOOL_HIST_WHO, hap->ha_uid) == 0);
-@@ -265,10 +265,10 @@
- }
-
- VERIFY(nvlist_size(nvrecord, &reclen, NV_ENCODE_XDR) == 0);
-- record_packed = kmem_alloc(reclen, KM_SLEEP);
-+ record_packed = kmem_alloc(reclen, KM_PUSHPAGE);
-
- VERIFY(nvlist_pack(nvrecord, &record_packed, &reclen,
-- NV_ENCODE_XDR, KM_SLEEP) == 0);
-+ NV_ENCODE_XDR, KM_PUSHPAGE) == 0);
-
- mutex_enter(&spa->spa_history_lock);
- if (hap->ha_log_type == LOG_CMD_POOL_CREATE)
-@@ -315,7 +315,7 @@
- return (err);
- }
-
-- ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP);
-+ ha = kmem_alloc(sizeof (history_arg_t), KM_PUSHPAGE);
- ha->ha_history_str = strdup(history_str);
- ha->ha_zone = strdup(spa_history_zone());
- ha->ha_log_type = what;
-@@ -441,7 +441,7 @@
- if (tx->tx_txg == TXG_INITIAL)
- return;
-
-- ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP);
-+ ha = kmem_alloc(sizeof (history_arg_t), KM_PUSHPAGE);
- va_copy(adx_copy, adx);
- ha->ha_history_str = kmem_vasprintf(fmt, adx_copy);
- va_end(adx_copy);
-diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
-index 1016ac7..33b5575 100644
---- a/module/zfs/spa_misc.c
-+++ b/module/zfs/spa_misc.c
-@@ -424,7 +424,7 @@
-
- ASSERT(MUTEX_HELD(&spa_namespace_lock));
-
-- spa = kmem_zalloc(sizeof (spa_t), KM_SLEEP | KM_NODEBUG);
-+ spa = kmem_zalloc(sizeof (spa_t), KM_PUSHPAGE | KM_NODEBUG);
-
- mutex_init(&spa->spa_async_lock, NULL, MUTEX_DEFAULT, NULL);
- mutex_init(&spa->spa_errlist_lock, NULL, MUTEX_DEFAULT, NULL);
-@@ -471,12 +471,12 @@
- list_create(&spa->spa_config_list, sizeof (spa_config_dirent_t),
- offsetof(spa_config_dirent_t, scd_link));
-
-- dp = kmem_zalloc(sizeof (spa_config_dirent_t), KM_SLEEP);
-+ dp = kmem_zalloc(sizeof (spa_config_dirent_t), KM_PUSHPAGE);
- dp->scd_path = altroot ? NULL : spa_strdup(spa_config_path);
- list_insert_head(&spa->spa_config_list, dp);
-
- VERIFY(nvlist_alloc(&spa->spa_load_info, NV_UNIQUE_NAME,
-- KM_SLEEP) == 0);
-+ KM_PUSHPAGE) == 0);
-
- if (config != NULL)
- VERIFY(nvlist_dup(config, &spa->spa_config, 0) == 0);
-@@ -646,7 +646,7 @@
- if ((aux = avl_find(avl, &search, &where)) != NULL) {
- aux->aux_count++;
- } else {
-- aux = kmem_zalloc(sizeof (spa_aux_t), KM_SLEEP);
-+ aux = kmem_zalloc(sizeof (spa_aux_t), KM_PUSHPAGE);
- aux->aux_guid = vd->vdev_guid;
- aux->aux_count = 1;
- avl_insert(avl, aux, where);
-@@ -1130,7 +1130,7 @@
- char *new;
-
- len = strlen(s);
-- new = kmem_alloc(len + 1, KM_SLEEP);
-+ new = kmem_alloc(len + 1, KM_PUSHPAGE);
- bcopy(s, new, len);
- new[len] = '\0';
-
-diff --git a/module/zfs/space_map.c b/module/zfs/space_map.c
-index 1ce7b2a..9c0cdb6 100644
---- a/module/zfs/space_map.c
-+++ b/module/zfs/space_map.c
-@@ -134,7 +134,7 @@
- avl_remove(sm->sm_pp_root, ss_after);
- ss = ss_after;
- } else {
-- ss = kmem_alloc(sizeof (*ss), KM_SLEEP);
-+ ss = kmem_alloc(sizeof (*ss), KM_PUSHPAGE);
- ss->ss_start = start;
- ss->ss_end = end;
- avl_insert(&sm->sm_root, ss, where);
-@@ -181,7 +181,7 @@
- avl_remove(sm->sm_pp_root, ss);
-
- if (left_over && right_over) {
-- newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP);
-+ newseg = kmem_alloc(sizeof (*newseg), KM_PUSHPAGE);
- newseg->ss_start = end;
- newseg->ss_end = ss->ss_end;
- ss->ss_end = start;
-@@ -551,7 +551,7 @@
- {
- space_ref_t *sr;
-
-- sr = kmem_alloc(sizeof (*sr), KM_SLEEP);
-+ sr = kmem_alloc(sizeof (*sr), KM_PUSHPAGE);
- sr->sr_offset = offset;
- sr->sr_refcnt = refcnt;
-
-diff --git a/module/zfs/txg.c b/module/zfs/txg.c
-index 6e64adf..5021e44 100644
---- a/module/zfs/txg.c
-+++ b/module/zfs/txg.c
-@@ -339,7 +339,7 @@
- TASKQ_THREADS_CPU_PCT | TASKQ_PREPOPULATE);
- }
-
-- cb_list = kmem_alloc(sizeof (list_t), KM_SLEEP);
-+ cb_list = kmem_alloc(sizeof (list_t), KM_PUSHPAGE);
- list_create(cb_list, sizeof (dmu_tx_callback_t),
- offsetof(dmu_tx_callback_t, dcb_node));
-
-diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
-index 1630d2f..3f50489 100644
---- a/module/zfs/vdev.c
-+++ b/module/zfs/vdev.c
-@@ -193,7 +193,7 @@
- pvd->vdev_children = MAX(pvd->vdev_children, id + 1);
- newsize = pvd->vdev_children * sizeof (vdev_t *);
-
-- newchild = kmem_zalloc(newsize, KM_SLEEP);
-+ newchild = kmem_zalloc(newsize, KM_PUSHPAGE);
- if (pvd->vdev_child != NULL) {
- bcopy(pvd->vdev_child, newchild, oldsize);
- kmem_free(pvd->vdev_child, oldsize);
-@@ -263,7 +263,7 @@
- if (pvd->vdev_child[c])
- newc++;
-
-- newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_SLEEP);
-+ newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_PUSHPAGE);
-
- for (c = newc = 0; c < oldc; c++) {
- if ((cvd = pvd->vdev_child[c]) != NULL) {
-@@ -286,7 +286,7 @@
- vdev_t *vd;
- int t;
-
-- vd = kmem_zalloc(sizeof (vdev_t), KM_SLEEP);
-+ vd = kmem_zalloc(sizeof (vdev_t), KM_PUSHPAGE);
-
- if (spa->spa_root_vdev == NULL) {
- ASSERT(ops == &vdev_root_ops);
-@@ -835,7 +835,7 @@
-
- ASSERT(oldc <= newc);
-
-- mspp = kmem_zalloc(newc * sizeof (*mspp), KM_SLEEP | KM_NODEBUG);
-+ mspp = kmem_zalloc(newc * sizeof (*mspp), KM_PUSHPAGE | KM_NODEBUG);
-
- if (oldc != 0) {
- bcopy(vd->vdev_ms, mspp, oldc * sizeof (*mspp));
-@@ -990,7 +990,7 @@
- mutex_enter(&vd->vdev_probe_lock);
-
- if ((pio = vd->vdev_probe_zio) == NULL) {
-- vps = kmem_zalloc(sizeof (*vps), KM_SLEEP);
-+ vps = kmem_zalloc(sizeof (*vps), KM_PUSHPAGE);
-
- vps->vps_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_PROBE |
- ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_AGGREGATE |
-diff --git a/module/zfs/vdev_cache.c b/module/zfs/vdev_cache.c
-index e2f8040..bf4ae7b 100644
---- a/module/zfs/vdev_cache.c
-+++ b/module/zfs/vdev_cache.c
-@@ -177,7 +177,7 @@
- vdev_cache_evict(vc, ve);
- }
-
-- ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
-+ ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_PUSHPAGE);
- ve->ve_offset = offset;
- ve->ve_lastused = ddi_get_lbolt();
- ve->ve_data = zio_buf_alloc(VCBS);
-@@ -274,7 +274,7 @@
-
- mutex_enter(&vc->vc_lock);
-
-- ve_search = kmem_alloc(sizeof(vdev_cache_entry_t), KM_SLEEP);
-+ ve_search = kmem_alloc(sizeof(vdev_cache_entry_t), KM_PUSHPAGE);
- ve_search->ve_offset = cache_offset;
- ve = avl_find(&vc->vc_offset_tree, ve_search, NULL);
- kmem_free(ve_search, sizeof(vdev_cache_entry_t));
-diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
-index 28a4861..febb6d0 100644
---- a/module/zfs/vdev_disk.c
-+++ b/module/zfs/vdev_disk.c
-@@ -171,7 +171,7 @@
- return EINVAL;
- }
-
-- vd = kmem_zalloc(sizeof(vdev_disk_t), KM_SLEEP);
-+ vd = kmem_zalloc(sizeof(vdev_disk_t), KM_PUSHPAGE);
- if (vd == NULL)
- return ENOMEM;
-
-@@ -252,7 +252,7 @@
- int i;
-
- dr = kmem_zalloc(sizeof(dio_request_t) +
-- sizeof(struct bio *) * bio_count, KM_SLEEP);
-+ sizeof(struct bio *) * bio_count, KM_PUSHPAGE);
- if (dr) {
- init_completion(&dr->dr_comp);
- atomic_set(&dr->dr_ref, 0);
-@@ -721,7 +721,7 @@
- }
-
- size = P2ALIGN_TYPED(s, sizeof(vdev_label_t), uint64_t);
-- label = vmem_alloc(sizeof(vdev_label_t), KM_SLEEP);
-+ label = vmem_alloc(sizeof(vdev_label_t), KM_PUSHPAGE);
-
- for (i = 0; i < VDEV_LABELS; i++) {
- uint64_t offset, state, txg = 0;
-diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c
-index ce49fe0..25d0bad 100644
---- a/module/zfs/vdev_file.c
-+++ b/module/zfs/vdev_file.c
-@@ -72,7 +72,7 @@
- goto skip_open;
- }
-
-- vf = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_file_t), KM_SLEEP);
-+ vf = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_file_t), KM_PUSHPAGE);
-
- /*
- * We always open the files from the root of the global zone, even if
-diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c
-index 3774d71..7ac2350 100644
---- a/module/zfs/vdev_label.c
-+++ b/module/zfs/vdev_label.c
-@@ -212,7 +212,7 @@
- {
- nvlist_t *nv = NULL;
-
-- VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE,
- vd->vdev_ops->vdev_op_type) == 0);
-@@ -319,7 +319,7 @@
- ASSERT(!vd->vdev_ishole);
-
- child = kmem_alloc(vd->vdev_children * sizeof (nvlist_t *),
-- KM_SLEEP);
-+ KM_PUSHPAGE);
-
- for (c = 0, idx = 0; c < vd->vdev_children; c++) {
- vdev_t *cvd = vd->vdev_child[c];
-@@ -408,7 +408,7 @@
- uint64_t *array;
- uint_t c, idx;
-
-- array = kmem_alloc(rvd->vdev_children * sizeof (uint64_t), KM_SLEEP);
-+ array = kmem_alloc(rvd->vdev_children * sizeof (uint64_t), KM_PUSHPAGE);
-
- for (c = 0, idx = 0; c < rvd->vdev_children; c++) {
- vdev_t *tvd = rvd->vdev_child[c];
-@@ -709,7 +709,7 @@
- * active hot spare (in which case we want to revert the
- * labels).
- */
-- VERIFY(nvlist_alloc(&label, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&label, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_add_uint64(label, ZPOOL_CONFIG_VERSION,
- spa_version(spa)) == 0);
-@@ -722,7 +722,7 @@
- /*
- * For level 2 ARC devices, add a special label.
- */
-- VERIFY(nvlist_alloc(&label, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-+ VERIFY(nvlist_alloc(&label, NV_UNIQUE_NAME, KM_PUSHPAGE) == 0);
-
- VERIFY(nvlist_add_uint64(label, ZPOOL_CONFIG_VERSION,
- spa_version(spa)) == 0);
-@@ -749,7 +749,7 @@
- buf = vp->vp_nvlist;
- buflen = sizeof (vp->vp_nvlist);
-
-- error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP);
-+ error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_PUSHPAGE);
- if (error != 0) {
- nvlist_free(label);
- zio_buf_free(vp, sizeof (vdev_phys_t));
-@@ -1061,7 +1061,7 @@
- buf = vp->vp_nvlist;
- buflen = sizeof (vp->vp_nvlist);
-
-- if (nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP) == 0) {
-+ if (nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_PUSHPAGE) == 0) {
- for (; l < VDEV_LABELS; l += 2) {
- vdev_label_write(zio, vd, l, vp,
- offsetof(vdev_label_t, vl_vdev_phys),
-@@ -1094,7 +1094,7 @@
-
- ASSERT(!vd->vdev_ishole);
-
-- good_writes = kmem_zalloc(sizeof (uint64_t), KM_SLEEP);
-+ good_writes = kmem_zalloc(sizeof (uint64_t), KM_PUSHPAGE);
- vio = zio_null(zio, spa, NULL,
- (vd->vdev_islog || vd->vdev_aux != NULL) ?
- vdev_label_sync_ignore_done : vdev_label_sync_top_done,
-diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c
-index 47181d4..96623d2 100644
---- a/module/zfs/vdev_mirror.c
-+++ b/module/zfs/vdev_mirror.c
-@@ -79,7 +79,7 @@
-
- c = BP_GET_NDVAS(zio->io_bp);
-
-- mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_SLEEP);
-+ mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_PUSHPAGE);
- mm->mm_children = c;
- mm->mm_replacing = B_FALSE;
- mm->mm_preferred = spa_get_random(c);
-@@ -106,7 +106,7 @@
- } else {
- c = vd->vdev_children;
-
-- mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_SLEEP);
-+ mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_PUSHPAGE);
- mm->mm_children = c;
- mm->mm_replacing = (vd->vdev_ops == &vdev_replacing_ops ||
- vd->vdev_ops == &vdev_spare_ops);
-diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c
-index b987ac4..21c6e03 100644
---- a/module/zfs/vdev_raidz.c
-+++ b/module/zfs/vdev_raidz.c
-@@ -456,7 +456,7 @@
-
- ASSERT3U(acols, <=, scols);
-
-- rm = kmem_alloc(offsetof(raidz_map_t, rm_col[scols]), KM_SLEEP);
-+ rm = kmem_alloc(offsetof(raidz_map_t, rm_col[scols]), KM_PUSHPAGE);
-
- rm->rm_cols = acols;
- rm->rm_scols = scols;
-@@ -1196,7 +1196,7 @@
- size_t psize;
-
- psize = sizeof (invlog[0][0]) * n * nmissing;
-- p = kmem_alloc(psize, KM_SLEEP);
-+ p = kmem_alloc(psize, KM_PUSHPAGE);
-
- for (pp = p, i = 0; i < nmissing; i++) {
- invlog[i] = pp;
-@@ -1313,7 +1313,7 @@
-
- psize = (sizeof (rows[0][0]) + sizeof (invrows[0][0])) *
- nmissing_rows * n + sizeof (used[0]) * n;
-- p = kmem_alloc(psize, KM_SLEEP);
-+ p = kmem_alloc(psize, KM_PUSHPAGE);
-
- for (pp = p, i = 0; i < nmissing_rows; i++) {
- rows[i] = pp;
-diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c
-index 7801837..0b98231 100644
---- a/module/zfs/zfs_fm.c
-+++ b/module/zfs/zfs_fm.c
-@@ -519,7 +519,7 @@
- size_t offset = 0;
- ssize_t start = -1;
-
-- zfs_ecksum_info_t *eip = kmem_zalloc(sizeof (*eip), KM_SLEEP);
-+ zfs_ecksum_info_t *eip = kmem_zalloc(sizeof (*eip), KM_PUSHPAGE);
-
- /* don't do any annotation for injected checksum errors */
- if (info != NULL && info->zbc_injected)
-@@ -688,7 +688,7 @@
- struct zio *zio, uint64_t offset, uint64_t length, void *arg,
- zio_bad_cksum_t *info)
- {
-- zio_cksum_report_t *report = kmem_zalloc(sizeof (*report), KM_SLEEP);
-+ zio_cksum_report_t *report = kmem_zalloc(sizeof (*report), KM_PUSHPAGE);
-
- if (zio->io_vsd != NULL)
- zio->io_vsd_ops->vsd_cksum_report(zio, report, arg);
-@@ -697,7 +697,7 @@
-
- /* copy the checksum failure information if it was provided */
- if (info != NULL) {
-- report->zcr_ckinfo = kmem_zalloc(sizeof (*info), KM_SLEEP);
-+ report->zcr_ckinfo = kmem_zalloc(sizeof (*info), KM_PUSHPAGE);
- bcopy(info, report->zcr_ckinfo, sizeof (*info));
- }
-
-diff --git a/module/zfs/zil.c b/module/zfs/zil.c
-index 5296b38..895ba52 100644
---- a/module/zfs/zil.c
-+++ b/module/zfs/zil.c
-@@ -144,7 +144,7 @@
- if (avl_find(t, dva, &where) != NULL)
- return (EEXIST);
-
-- zn = kmem_alloc(sizeof (zil_bp_node_t), KM_SLEEP);
-+ zn = kmem_alloc(sizeof (zil_bp_node_t), KM_PUSHPAGE);
- zn->zn_dva = *dva;
- avl_insert(t, zn, where);
-
-@@ -434,7 +434,7 @@
- {
- lwb_t *lwb;
-
-- lwb = kmem_cache_alloc(zil_lwb_cache, KM_SLEEP);
-+ lwb = kmem_cache_alloc(zil_lwb_cache, KM_PUSHPAGE);
- lwb->lwb_zilog = zilog;
- lwb->lwb_blk = *bp;
- lwb->lwb_buf = zio_buf_alloc(BP_GET_LSIZE(bp));
-@@ -731,7 +731,7 @@
- for (i = 0; i < ndvas; i++) {
- zvsearch.zv_vdev = DVA_GET_VDEV(&bp->blk_dva[i]);
- if (avl_find(t, &zvsearch, &where) == NULL) {
-- zv = kmem_alloc(sizeof (*zv), KM_SLEEP);
-+ zv = kmem_alloc(sizeof (*zv), KM_PUSHPAGE);
- zv->zv_vdev = zvsearch.zv_vdev;
- avl_insert(t, zv, where);
- }
-@@ -1235,7 +1235,7 @@
- }
- ASSERT(itxg->itxg_sod == 0);
- itxg->itxg_txg = txg;
-- itxs = itxg->itxg_itxs = kmem_zalloc(sizeof (itxs_t), KM_SLEEP);
-+ itxs = itxg->itxg_itxs = kmem_zalloc(sizeof (itxs_t), KM_PUSHPAGE);
-
- list_create(&itxs->i_sync_list, sizeof (itx_t),
- offsetof(itx_t, itx_node));
-@@ -1255,7 +1255,7 @@
-
- ian = avl_find(t, &foid, &where);
- if (ian == NULL) {
-- ian = kmem_alloc(sizeof (itx_async_node_t), KM_SLEEP);
-+ ian = kmem_alloc(sizeof (itx_async_node_t), KM_PUSHPAGE);
- list_create(&ian->ia_list, sizeof (itx_t),
- offsetof(itx_t, itx_node));
- ian->ia_foid = foid;
-@@ -1626,7 +1626,7 @@
- zilog_t *zilog;
- int i;
-
-- zilog = kmem_zalloc(sizeof (zilog_t), KM_SLEEP);
-+ zilog = kmem_zalloc(sizeof (zilog_t), KM_PUSHPAGE);
-
- zilog->zl_header = zh_phys;
- zilog->zl_os = os;
-@@ -1948,7 +1948,7 @@
- zr.zr_replay = replay_func;
- zr.zr_arg = arg;
- zr.zr_byteswap = BP_SHOULD_BYTESWAP(&zh->zh_log);
-- zr.zr_lr = vmem_alloc(2 * SPA_MAXBLOCKSIZE, KM_SLEEP);
-+ zr.zr_lr = vmem_alloc(2 * SPA_MAXBLOCKSIZE, KM_PUSHPAGE);
-
- /*
- * Wait for in-progress removes to sync before starting replay.
---
-1.7.10
-
diff --git a/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild b/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild
deleted file mode 100644
index 61c85ab92f1a..000000000000
--- a/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild,v 1.4 2012/07/01 13:03:28 ryao Exp $
-
-EAPI="4"
-
-AT_M4DIR="config"
-AUTOTOOLS_AUTORECONF="1"
-AUTOTOOLS_IN_SOURCE_BUILD="1"
-
-inherit bash-completion-r1 flag-o-matic linux-mod toolchain-funcs autotools-utils
-
-if [ ${PV} == "9999" ] ; then
- inherit git-2
- EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
-else
- inherit eutils versionator
- MY_PV=$(replace_version_separator 3 '-')
- SRC_URI="https://github.com/downloads/zfsonlinux/${PN}/${PN}-${MY_PV}.tar.gz"
- S="${WORKDIR}/${PN}-${MY_PV}"
- KEYWORDS="~amd64"
-fi
-
-DESCRIPTION="Native ZFS for Linux"
-HOMEPAGE="http://zfsonlinux.org/"
-
-LICENSE="CDDL GPL-2 MIT"
-SLOT="0"
-IUSE="custom-cflags debug dracut +rootfs test test-suite static-libs"
-
-DEPEND="
- =sys-kernel/spl-${PV}*
- sys-apps/util-linux[static-libs?]
- sys-libs/zlib[static-libs(+)?]
-"
-RDEPEND="${DEPEND}
- !sys-fs/zfs-fuse
- !prefix? ( sys-fs/udev )
- test-suite? (
- sys-apps/gawk
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- virtual/modutils
- )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- )
-"
-DEPEND+="
- test? ( sys-fs/mdadm )
-"
-
-pkg_setup() {
- CONFIG_CHECK="!DEBUG_LOCK_ALLOC
- !PREEMPT
- !PREEMPT_VOLUNTARY
- BLK_DEV_LOOP
- EFI_PARTITION
- MODULES
- ZLIB_DEFLATE
- ZLIB_INFLATE"
- use rootfs && \
- CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
- DEVTMPFS"
- kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
- check_extra_config
-}
-
-src_prepare() {
- # Workaround for hard coded path
- sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/common.sh.in || die
- # Workaround rename
- sed -i "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" scripts/common.sh.in || die
-
- if [ ${PV} != "9999" ]
- then
- epatch "${FILESDIR}/${P}-hardened-support.patch"
-
- # Fix various deadlocks
- epatch "${FILESDIR}/${P}-use-pushpage.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-1-of-3.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-2-of-3.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-3-of-3.patch"
- epatch "${FILESDIR}/${P}-range-lock-caller-allocate.patch"
- fi
-
- autotools-utils_src_prepare
-}
-
-src_configure() {
- use custom-cflags || strip-flags
- set_arch_to_kernel
- local myeconfargs=(
- --bindir="${EPREFIX}/bin"
- --sbindir="${EPREFIX}/sbin"
- --with-config=all
- --with-linux="${KV_DIR}"
- --with-linux-obj="${KV_OUT_DIR}"
- --with-udevdir="${EPREFIX}/lib/udev"
- $(use_enable debug)
- )
- autotools-utils_src_configure
-}
-
-src_test() {
- if [ $UID -ne 0 ]
- then
- ewarn "Cannot run make check tests with FEATURES=userpriv."
- ewarn "Skipping make check tests."
- else
- autotools-utils_src_test
- fi
-}
-
-src_install() {
- autotools-utils_src_install
- gen_usr_ldscript -a uutil nvpair zpool zfs
- use dracut || rm -rf "${ED}usr/share/dracut"
- use test-suite || rm -rf "${ED}usr/libexec"
-
- if use rootfs
- then
- doinitd "${FILESDIR}/zfs-shutdown"
- exeinto /usr/share/zfs
- doexe "${FILESDIR}/linuxrc"
- fi
-
- newbashcomp "${FILESDIR}/bash-completion" zfs
-
-}
-
-pkg_postinst() {
- linux-mod_pkg_postinst
-
- use x86 && ewarn "32-bit kernels are unsupported by ZFSOnLinux upstream. Do not file bug reports."
-
- [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
- || ewarn 'You should add zfs to the boot runlevel.'
-
- use rootfs && ([ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ] \
- || ewarn 'You should add zfs-shutdown to the shutdown runlevel.')
-
-}
diff --git a/sys-fs/zfs/zfs-0.6.0_rc9-r4.ebuild b/sys-fs/zfs/zfs-0.6.0_rc9-r5.ebuild
index 7d6449aaa121..9a6dc91af126 100644
--- a/sys-fs/zfs/zfs-0.6.0_rc9-r4.ebuild
+++ b/sys-fs/zfs/zfs-0.6.0_rc9-r5.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9-r4.ebuild,v 1.1 2012/07/10 00:31:39 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9-r5.ebuild,v 1.1 2012/07/11 13:20:31 ryao Exp $
EAPI="4"
@@ -24,7 +24,7 @@ fi
DESCRIPTION="Native ZFS for Linux"
HOMEPAGE="http://zfsonlinux.org/"
-LICENSE="CDDL GPL-2 MIT"
+LICENSE="BSD-2 CDDL MIT"
SLOT="0"
IUSE="custom-cflags debug dracut +rootfs test test-suite static-libs"
@@ -79,14 +79,18 @@ src_prepare() {
if [ ${PV} != "9999" ]
then
+ # Fix build issues
epatch "${FILESDIR}/${P}-hardened-support.patch"
+ epatch "${FILESDIR}/${P}-linux-3.5-support.patch"
+ epatch "${FILESDIR}/${P}-fix-32-bit-warnings.patch"
# Fix various deadlocks
- epatch "${FILESDIR}/${P}-fix-32-bit-warnings.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-1-of-3.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-2-of-3.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-3-of-3.patch"
- epatch "${FILESDIR}/${P}-range-lock-caller-allocate.patch"
+
+ #Miscellaneous
+ epatch "${FILESDIR}/${P}-bsd-init.patch"
fi
autotools-utils_src_prepare
diff --git a/sys-fs/zfs/zfs-0.6.0_rc9.ebuild b/sys-fs/zfs/zfs-0.6.0_rc9.ebuild
deleted file mode 100644
index 85d3f254fc43..000000000000
--- a/sys-fs/zfs/zfs-0.6.0_rc9.ebuild
+++ /dev/null
@@ -1,145 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9.ebuild,v 1.7 2012/07/01 13:03:28 ryao Exp $
-
-EAPI="4"
-
-AT_M4DIR="config"
-AUTOTOOLS_AUTORECONF="1"
-AUTOTOOLS_IN_SOURCE_BUILD="1"
-
-inherit bash-completion-r1 flag-o-matic linux-mod toolchain-funcs autotools-utils
-
-if [ ${PV} == "9999" ] ; then
- inherit git-2
- EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
-else
- inherit eutils versionator
- MY_PV=$(replace_version_separator 3 '-')
- SRC_URI="https://github.com/downloads/zfsonlinux/${PN}/${PN}-${MY_PV}.tar.gz"
- S="${WORKDIR}/${PN}-${MY_PV}"
- KEYWORDS="~amd64"
-fi
-
-DESCRIPTION="Native ZFS for Linux"
-HOMEPAGE="http://zfsonlinux.org/"
-
-LICENSE="CDDL GPL-2 MIT"
-SLOT="0"
-IUSE="bash-completion custom-cflags debug dracut +rootfs test test-suite static-libs"
-
-DEPEND="
- =sys-kernel/spl-${PV}*
- sys-apps/util-linux[static-libs?]
- sys-libs/zlib[static-libs(+)?]
-"
-RDEPEND="${DEPEND}
- !sys-fs/zfs-fuse
- !prefix? ( sys-fs/udev )
- test-suite? (
- sys-apps/gawk
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- virtual/modutils
- )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- )
-"
-DEPEND+="
- test? ( sys-fs/mdadm )
-"
-
-pkg_setup() {
- CONFIG_CHECK="!DEBUG_LOCK_ALLOC
- !PREEMPT
- !PREEMPT_VOLUNTARY
- BLK_DEV_LOOP
- EFI_PARTITION
- MODULES
- ZLIB_DEFLATE
- ZLIB_INFLATE"
- use rootfs && CONFIG_CHECK="${CONFIG_CHECK} DEVTMPFS"
- kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
- check_extra_config
-}
-
-src_prepare() {
- # Workaround for hard coded path
- sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/common.sh.in || die
- # Workaround rename
- sed -i "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" scripts/common.sh.in || die
-
- if [ ${PV} != "9999" ]
- then
- epatch "${FILESDIR}/${P}-hardened-support.patch"
-
- # Fix various deadlocks
- epatch "${FILESDIR}/${P}-use-pushpage.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-1-of-3.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-2-of-3.patch"
- epatch "${FILESDIR}/${P}-remove-pfmalloc-3-of-3.patch"
- fi
-
- autotools-utils_src_prepare
-}
-
-src_configure() {
- use custom-cflags || strip-flags
- set_arch_to_kernel
- local myeconfargs=(
- --bindir="${EPREFIX}/bin"
- --sbindir="${EPREFIX}/sbin"
- --with-config=all
- --with-linux="${KV_DIR}"
- --with-linux-obj="${KV_OUT_DIR}"
- --with-udevdir="${EPREFIX}/lib/udev"
- $(use_enable debug)
- )
- autotools-utils_src_configure
-}
-
-src_test() {
- if [ $UID -ne 0 ]
- then
- ewarn "Cannot run make check tests with FEATURES=userpriv."
- ewarn "Skipping make check tests."
- else
- autotools-utils_src_test
- fi
-}
-
-src_install() {
- autotools-utils_src_install
- gen_usr_ldscript -a uutil nvpair zpool zfs
- use dracut || rm -rf "${ED}usr/share/dracut"
- use test-suite || rm -rf "${ED}usr/libexec"
-
- if use rootfs
- then
- doinitd "${FILESDIR}/zfs-shutdown"
- exeinto /usr/share/zfs
- doexe "${FILESDIR}/linuxrc"
- fi
-
- newbashcomp "${FILESDIR}/bash-completion" zfs
-
-}
-
-pkg_postinst() {
- linux-mod_pkg_postinst
-
- use x86 && ewarn "32-bit kernels are unsupported by ZFSOnLinux upstream. Do not file bug reports."
-
- [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
- || ewarn 'You should add zfs to the boot runlevel.'
-
- use rootfs && ([ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ] \
- || ewarn 'You should add zfs-shutdown to the shutdown runlevel.')
-
-}
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 3c7599804511..4f4bd6d9c209 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-9999.ebuild,v 1.27 2012/07/01 13:03:28 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-9999.ebuild,v 1.28 2012/07/11 13:20:31 ryao Exp $
EAPI="4"
@@ -24,9 +24,9 @@ fi
DESCRIPTION="Native ZFS for Linux"
HOMEPAGE="http://zfsonlinux.org/"
-LICENSE="CDDL GPL-2 MIT"
+LICENSE="BSD-2 CDDL MIT"
SLOT="0"
-IUSE="bash-completion custom-cflags debug dracut +rootfs test test-suite static-libs"
+IUSE="custom-cflags debug dracut +rootfs test test-suite static-libs"
DEPEND="
=sys-kernel/spl-${PV}*
@@ -64,7 +64,9 @@ pkg_setup() {
MODULES
ZLIB_DEFLATE
ZLIB_INFLATE"
- use rootfs && CONFIG_CHECK="${CONFIG_CHECK} DEVTMPFS"
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
check_extra_config
}
@@ -77,13 +79,18 @@ src_prepare() {
if [ ${PV} != "9999" ]
then
+ # Fix build issues
epatch "${FILESDIR}/${P}-hardened-support.patch"
+ epatch "${FILESDIR}/${P}-linux-3.5-support.patch"
+ epatch "${FILESDIR}/${P}-fix-32-bit-warnings.patch"
# Fix various deadlocks
- epatch "${FILESDIR}/${P}-use-pushpage.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-1-of-3.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-2-of-3.patch"
epatch "${FILESDIR}/${P}-remove-pfmalloc-3-of-3.patch"
+
+ #Miscellaneous
+ epatch "${FILESDIR}/${P}-bsd-init.patch"
fi
autotools-utils_src_prepare