summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-fs/zfs-kmod
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-fs/zfs-kmod')
-rw-r--r--sys-fs/zfs-kmod/Manifest11
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch39
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch40
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch51
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch36
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch42
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch105
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch473
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch32
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch36
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch41
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch44
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch56
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch70
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch42
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch32
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch73
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch50
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch37
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch58
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch73
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch167
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch108
-rw-r--r--sys-fs/zfs-kmod/metadata.xml14
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild124
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild137
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild152
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild145
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild138
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild142
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild142
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-9999.ebuild137
35 files changed, 3234 insertions, 0 deletions
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
new file mode 100644
index 000000000000..6698c0d00a29
--- /dev/null
+++ b/sys-fs/zfs-kmod/Manifest
@@ -0,0 +1,11 @@
+DIST zfs-0.6.0-rc13.tar.gz 1490582 SHA256 3e689fc0704237c7d755c65e34ed214a262535afefafde4aef0f112f8c833a09 SHA512 c9bbf1fb7f293a0f5b1247e17c411073994bf419d5f6c1b781efeeb4022f62851e8ea3cf7ee0330b0609bfe13b8084c48f00e942ce52323d706733cccf49699e WHIRLPOOL 97083a6f5d66addc9bc7b3cc3f7dd3bc1696980affbd4033d71cd09ecad413ffb666a8a185dfa2e4f20dd4003746ad61d12142f7a6556db5b34008716c933798
+DIST zfs-0.6.0-rc14.tar.gz 1527612 SHA256 5eae8ef790b26e0dd7c801cc0a235a631ad91d67f148a444d912dbeb24b9a12d SHA512 ad38544ced150ce500c78507782e53a8534815b819e5b9aefda6d670fb7905e31a42cdb4d45164700df48673ea7c42bd1d29a60f1f00e25271b3906de9212d15 WHIRLPOOL cfd4de541eb6c18ee4df8950883525d1b1887e0d9c5f840d97353a5d716ed639f1ab3dc0fe4d8368a890564f10053026bcc738b6066c4488647f1b83be54288d
+DIST zfs-0.6.1.tar.gz 1535521 SHA256 42ed127f74af0ecafc14800a5d2b766655f5ea821098aba92446c1c447093fad SHA512 ef583639f15a5b2e4582760bb013ab5091abc15bae17884d811afec707aff337248102a22fb9fb6f62f99cb3477a8ae82edfdcfdfb962276f593173a5dfe5871 WHIRLPOOL a6791fc2d384e03073abc850f99ba761afd18073337264d8a7bc08b4ddc6fff52df5ce11addc9a3ac7cdfdd9ce9bd779208e515cda631ec19de05fbf9f92307b
+DIST zfs-0.6.2.tar.gz 1558656 SHA256 91b844bf7a42df22d7533e8004289270b7859b8fcbca3bff8087a79b131318b4 SHA512 008f9decdea3e92f6d74f5369ec9df5776b15efbb9f2bc01012999b71e1f2bc5b46b310a329b60545907dcc78773ec79eb6d21aca49d911f33299fd0a36e1a4b WHIRLPOOL 587279866b6ffa2bfebc91f00cb28de85f7f186426a0292f44c6cde7ca3a51c1911fc0ee431c25c3ee0866174522f90ce04b54de4aa3dc0829ba3a719e47af58
+DIST zfs-0.6.3-patches-r1.tar.xz 87852 SHA256 71b5286f77cb6a6c2b97cee406dfd4788f7b40b6675c4a56fc630a47e90d5280 SHA512 e2fa573c7b30a3811e9e1596d35b65f5d013ed5bac43e364b44ffab734398a3294979c152a80ec9a722611cc7c971aec217d8e1a37cc9240a3fa2dddb5b90e3b WHIRLPOOL f2da02d5c7d2385e7de1e858c31d299632ca864d422f0c94e5d3b8674d24beeb073ad2600698350306a9e70dbeef390f0e513d19c126502fceec18795c203d50
+DIST zfs-0.6.3.tar.gz 1665270 SHA256 00caeae63cc724d3dd741aeb36fd2dc03d2158794bd6a5e925cdc8d7e5d3da8c SHA512 8c7741f5f227eb031d79fe87bf7d60e790a098fa6caede462d556c97d798832f97f5a377cbb74fc99b8d198e5f3cc1a3491f69fcdaa0408933dbadd132013416 WHIRLPOOL db9791da12c441c89667b194154b209f5aa69ea46d5327cfcde0b3a910cf1f0e5ca448909824e45b31252a1907280b711fb6ba04eb313d09de0ffbf5e6e304fe
+DIST zfs-0.6.4.2.tar.gz 1738601 SHA256 26af2924cbb891b79203a31827cba4cdc310162d5f7b9e2d643eb6576aa19015 SHA512 87a28997b8f9d36e189410171db583402418a55782b7b7f333993e98c5e17ccc4b6cd5825f38b904294c87e3dfdfb7748bd71cc371589c1358f16c942e0c18db WHIRLPOOL 1700de7da56311a7b608c99a821e2fa97a6145ccc88f3d8eff12f778421ba7b7b9cc5f5fbe5f1acd2ea2fd1db778c200a2ea961e3859a8fc89d80474894293f1
+DIST zfs-0.6.4.tar.gz 1735736 SHA256 7f37aaaa1fc15201dde58bb84e0f191ccac462f19ffec0c889b6f6ed3f73a804 SHA512 cf47cbf5fa8dff75f5e9d81b323f5745d7b210266ba9e6ccab16bbf0e2b055aa1168bad94a77a4bc56c6fbe0391593f210bd4c74f7a8d0d99385ac4dd61e5622 WHIRLPOOL 1b0cc8a9727b57f2e63bd106cd94780002a068b31668b9dc103dbc0b48858a380d7c228f39f0526fc84b9d10aca1bd376ace0346a2ef4306a9d164c2d56606f1
+DIST zfs-kmod-0.6.2-p2.tar.xz 28636 SHA256 12882463a38a5a57cf2bb3c14c5783f9511f6dc7b163a47575f2f3dcc24f26f6 SHA512 5792660ae8f5013d12e70d608e9cffa92a8c4089a88a5e78728ee88204b3f970d452d5b0b3874e02be49ebbc139e07139be7b5a86ca40bc8b23cb11a7198a9a8 WHIRLPOOL 0e4c57b363cdd3d736efbd1355567b18e22439bd3b20ef40b27f6b97ad4570c7cc99a11b196ac25359d1966c1a70e178f4fd1687b60450f148ccda47b07282a9
+DIST zfs-kmod-0.6.2-p3.tar.xz 45988 SHA256 4af06d1472f5d24e01d147b6fec5c78fbbd9739d1259bd3fbf57af66c99b9bcb SHA512 eddf67c0aa49d42f663f98dc721bac75e8d0521df5ae174cd6aeee0a935a71b49e06961404eb6c71a09cd239358868a2fe49de4f1d26776948f8fe7fc943165c WHIRLPOOL 5634a92f6f322f67edef95ad121b0b1699e520ca8beb05b3385dc7e20198dd45d337731bf7df69d1b1c552ed0b78d54b15bc9c9e76b694ae4c8d360892b9d764
+DIST zfs-kmod-0.6.2-p4.tar.xz 63984 SHA256 9167edc4be86e3fcda6b3c198e51f92ab0c95ac5baca11666c28029a628cdac9 SHA512 13e4ec415c35d2f268d89565745f5898c0943423577a2ba6714b3a069c5a80f244cd06dff91464f38dd4ed60673d1145ead080bb03a56d4be33e328f948ffa64 WHIRLPOOL 8c399ec67119ed4fbebb5599d00f888918678bc4e4ea369b4bdc5c75bfc90fc76396087624c8011de370a54ff103bccaa8922d05ac7ccebb2b3481bbbcf44b19
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch
new file mode 100644
index 000000000000..2daf211c7744
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch
@@ -0,0 +1,39 @@
+From 1c50c992bafd96773dc3950d382a89806df8cc9c Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 9 Jan 2013 11:09:06 -0800
+Subject: [PATCH] Revert "Avoid ELOOP on auto-mounted snapshots"
+
+This reverts commit 7afcf5b1da83549bfba70a61fae7a00eaa63c2b0 which
+accidentally introduced a regression with the .zfs snapshot directory.
+While the updated code still does correctly mount the requested
+snapshot. It updates the vfsmount such that it references the
+original dataset vfsmount. The result is that the snapshot itself
+isn't visible.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #816
+---
+ module/zfs/zpl_ctldir.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/module/zfs/zpl_ctldir.c b/module/zfs/zpl_ctldir.c
+index a2d8fa9..7dfaf6e 100644
+--- a/module/zfs/zpl_ctldir.c
++++ b/module/zfs/zpl_ctldir.c
+@@ -357,13 +357,6 @@
+ return ERR_PTR(error);
+
+ /*
+- * Ensure path->dentry points to the dentry for the root of the
+- * newly-mounted snapshot, otherwise this function may be called
+- * repeatedly which can lead to an incorrect ELOOP error return.
+- */
+- follow_up(path);
+-
+- /*
+ * Rather than returning the new vfsmount for the snapshot we must
+ * return NULL to indicate a mount collision. This is done because
+ * the user space mount calls do_add_mount() which adds the vfsmount
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch
new file mode 100644
index 000000000000..7d0263f31901
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch
@@ -0,0 +1,40 @@
+diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
+index 21fdd08..872d44a 100644
+--- a/module/zfs/dsl_dataset.c
++++ b/module/zfs/dsl_dataset.c
+@@ -20,7 +20,7 @@
+ */
+ /*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+- * Copyright (c) 2011 by Delphix. All rights reserved.
++ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+@@ -4158,9 +4220,13 @@ struct dsl_ds_releasearg {
+ dsl_dataset_t *snap;
+ uint64_t used, comp, uncomp;
+
+- err = dsl_dataset_hold_obj(dp, snapobj, FTAG, &snap);
+- if (err != 0)
+- break;
++ if (snapobj == new->ds_object) {
++ snap = new;
++ } else {
++ err = dsl_dataset_hold_obj(dp, snapobj, FTAG, &snap);
++ if (err != 0)
++ break;
++ }
+
+ if (snap->ds_phys->ds_prev_snap_txg ==
+ oldsnap->ds_phys->ds_creation_txg) {
+@@ -4189,7 +4255,8 @@ struct dsl_ds_releasearg {
+ * was not a snapshot of/before new.
+ */
+ snapobj = snap->ds_phys->ds_prev_snap_obj;
+- dsl_dataset_rele(snap, FTAG);
++ if (snap != new)
++ dsl_dataset_rele(snap, FTAG);
+ if (snapobj == 0) {
+ err = EINVAL;
+ break;
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch
new file mode 100644
index 000000000000..9f31ecc82307
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch
@@ -0,0 +1,51 @@
+From 37f000c5aa76613e644cf3e5b1ec7bd2df6f7451 Mon Sep 17 00:00:00 2001
+From: Ned Bass <bass6@llnl.gov>
+Date: Wed, 26 Dec 2012 14:56:41 -0800
+Subject: [PATCH] Fix gcc array subscript above bounds warning
+
+In a debug build, certain GCC versions flag an array bounds warning in
+the below code from dnode_sync.c
+
+ } else {
+ int i;
+ ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
+ /* the blkptrs we are losing better be unallocated */
+ for (i = dn->dn_next_nblkptr[txgoff];
+ i < dnp->dn_nblkptr; i++)
+ ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
+
+This usage is in fact safe, since the ASSERT ensures the index does
+not exceed to maximum possible number of block pointers. However gcc
+can't determine that the assignment 'i = dn->dn_next_nblkptr[txgoff];'
+falls within the array bounds so it issues a warning. To avoid this,
+initialize i to zero to make gcc happy but skip the elements before
+dn->dn_next_nblkptr[txgoff] in the loop body. Since a dnode contains
+at most 3 block pointers this overhead should be negligible.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #950
+---
+ module/zfs/dnode_sync.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c
+index af636dc..f2dda86 100644
+--- a/module/zfs/dnode_sync.c
++++ b/module/zfs/dnode_sync.c
+@@ -666,9 +666,10 @@
+ int i;
+ ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
+ /* the blkptrs we are losing better be unallocated */
+- for (i = dn->dn_next_nblkptr[txgoff];
+- i < dnp->dn_nblkptr; i++)
+- ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
++ for (i = 0; i < dnp->dn_nblkptr; i++) {
++ if (i >= dn->dn_next_nblkptr[txgoff])
++ ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
++ }
+ #endif
+ }
+ mutex_enter(&dn->dn_mtx);
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch
new file mode 100644
index 000000000000..13189244c69a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch
@@ -0,0 +1,36 @@
+From dd26aa535b395735ca61ea2a3e618aded45eb05e Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Mon, 4 Feb 2013 16:35:54 -0800
+Subject: [PATCH] Cast 'zfs bad bloc' to ULL for x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Explicitly case this value to an unsigned long long for 32-bit
+systems to inform the compiler that a long type should not be
+used. Otherwise we get the following compiler error:
+
+ dmu_send.c:376: error: integer constant is too large for
+ ‘long’ type
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+---
+ module/zfs/dmu_send.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
+index 0cf3c4a..921c3d7 100644
+--- a/module/zfs/dmu_send.c
++++ b/module/zfs/dmu_send.c
+@@ -373,7 +373,7 @@
+ for (ptr = abuf->b_data;
+ (char *)ptr < (char *)abuf->b_data + blksz;
+ ptr++)
+- *ptr = 0x2f5baddb10c;
++ *ptr = 0x2f5baddb10cULL;
+ } else {
+ return (EIO);
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch
new file mode 100644
index 000000000000..fb4c7c35696c
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch
@@ -0,0 +1,42 @@
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 5623785..9d5aa46 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -16,7 +16,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS
+ ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE
+ ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE
+- ZFS_AC_KERNEL_BIO_EMPTY_BARRIER
+ ZFS_AC_KERNEL_BIO_FAILFAST
+ ZFS_AC_KERNEL_BIO_FAILFAST_DTD
+ ZFS_AC_KERNEL_REQ_FAILFAST_MASK
+diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
+index cbf0a4d..e902a70 100644
+--- a/module/zfs/vdev_disk.c
++++ b/module/zfs/vdev_disk.c
+@@ -604,8 +604,6 @@
+ return __vdev_disk_physio(bdev, NULL, kbuf, size, offset, flags);
+ }
+
+-/* 2.6.24 API change */
+-#ifdef HAVE_BIO_EMPTY_BARRIER
+ BIO_END_IO_PROTO(vdev_disk_io_flush_completion, bio, size, rc)
+ {
+ zio_t *zio = bio->bi_private;
+@@ -646,13 +644,6 @@
+
+ return 0;
+ }
+-#else
+-static int
+-vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
+-{
+- return ENOTSUP;
+-}
+-#endif /* HAVE_BIO_EMPTY_BARRIER */
+
+ static int
+ vdev_disk_io_start(zio_t *zio)
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch
new file mode 100644
index 000000000000..15d5af34d5c5
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch
@@ -0,0 +1,105 @@
+From d75af3c0ebb4e31ece087aeecfeff282cb6f1361 Mon Sep 17 00:00:00 2001
+From: Etienne Dechamps <etienne@edechamps.fr>
+Date: Sun, 24 Feb 2013 12:42:28 +0000
+Subject: [PATCH] Use -Werror for all kernel configure tests.
+
+As a matter of fact, we're already using -Werror for most tests because
+of a bug in kernel-bio-empty-barrier.m4 which sets -Werror without
+reverting it afterwards. This meant that all tests which ran after this
+one was using -Werror.
+
+This patch simply makes it clear that we're using -Werror and makes
+the code more readable and more predictable.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1317
+---
+ config/kernel-bio-empty-barrier.m4 | 1 -
+ config/kernel-bio-end-io-t-args.m4 | 3 ---
+ config/kernel-security-inode-init.m4 | 6 ------
+ config/kernel.m4 | 2 +-
+ 4 files changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/config/kernel-bio-empty-barrier.m4 b/config/kernel-bio-empty-barrier.m4
+index 99549fe..fda16b3 100644
+--- a/config/kernel-bio-empty-barrier.m4
++++ b/config/kernel-bio-empty-barrier.m4
+@@ -4,7 +4,6 @@ dnl # Empty write barriers are now supported and we should use them.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_BIO_EMPTY_BARRIER], [
+ AC_MSG_CHECKING([whether bio_empty_barrier() is defined])
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
+index ced4861..44e4826 100644
+--- a/config/kernel-bio-end-io-t-args.m4
++++ b/config/kernel-bio-end-io-t-args.m4
+@@ -9,8 +9,6 @@ dnl # to void.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ AC_MSG_CHECKING([whether bio_end_io_t wants 2 args])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+@@ -25,5 +23,4 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4
+index c21588a..a62176d 100644
+--- a/config/kernel-security-inode-init.m4
++++ b/config/kernel-security-inode-init.m4
+@@ -7,8 +7,6 @@ dnl # security checks will just be skipped.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
+ AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/security.h>
+ ],[
+@@ -27,7 +25,6 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+
+ dnl #
+@@ -39,8 +36,6 @@ dnl # and the EVM xattr.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [
+ AC_MSG_CHECKING([whether security_inode_init_security wants callback])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/security.h>
+ ],[
+@@ -57,5 +52,4 @@ AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 6d28074..5623785 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -488,7 +488,7 @@ AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
+ modpost_flag=''
+ test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+ AS_IF(
+- [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
++ [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
+ [$4],
+ [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
+ )
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
new file mode 100644
index 000000000000..03ee65ef9d4a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
@@ -0,0 +1,473 @@
+From ead579050140bfa010d06f6e0fea3f680c781b38 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Thu, 14 Feb 2013 18:54:04 -0500
+Subject: [PATCH] Eliminate runtime function pointer modifications in
+ autotools checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PaX/GrSecurity patched kernels implement a dialect of C that relies on a
+GCC plugin for enforcement. A basic idea in this dialect is that
+function pointers in structures should not change during runtime.
+This causes code that modifies function pointers at runtime to fail to
+compile in many instances. The autotools checks rely on whether or
+not small test cases compile against a given kernel. Some
+autotools checks assume some default case if other cases fail. When one
+of these autotools checks tests a PaX/GrSecurity patched kernel by
+modifying a function pointer at runtime, the default case will be used.
+
+Early detection of such situations is possible by relying on compiler
+warnings, which are compiler errors when --enable-debug is used.
+Unfortunately, very few people build ZFS with --enable-debug. The more
+common situation is that these issues manifest themselves as runtime
+failures in the form of NULL pointer exceptions.
+
+Previous patches that addressed such issues with PaX/GrSecurity
+compatibility largely relied on rewriting autotools checks to avoid
+runtime function pointer modification or the addition of PaX/GrSecurity
+specific checks. This patch takes the previous work to its logical
+conclusion by eliminating the use of runtime function pointer
+modification. This permits the removal of PaX-specific autotools checks
+in favor of ones that work across all supported kernels.
+
+This should resolve issues that were reported to occur with
+PaX/GrSecurity-patched Linux 3.7.5 kernels on Gentoo Linux.
+
+https://bugs.gentoo.org/show_bug.cgi?id=457176
+
+We should be able to prevent future regressions in PaX/GrSecurity
+compatibility by ensuring that all changes to ZFSOnLinux avoid runtime
+function pointer modification. At the same time, this does not solve the
+issue of silent failures triggering default cases in the autotools
+check, which is what permitted these regressions to become runtime
+failures in the first place. This will need to be addressed in a future
+patch.
+
+Reported-by: Marcin Mirosław <bug@mejor.pl>
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+---
+ config/kernel-bdev-block-device-operations.m4 | 21 +++----
+ config/kernel-bio-end-io-t-args.m4 | 6 +-
+ config/kernel-create-nameidata.m4 | 12 ++--
+ config/kernel-dentry-operations.m4 | 6 +-
+ config/kernel-dirty-inode.m4 | 8 +--
+ config/kernel-fallocate.m4 | 37 +++--------
+ config/kernel-fsync.m4 | 84 ++++---------------------
+ config/kernel-lookup-nameidata.m4 | 9 +--
+ config/kernel-mkdir-umode-t.m4 | 7 ++-
+ config/kernel-shrink.m4 | 21 +++----
+ 10 files changed, 62 insertions(+), 149 deletions(-)
+
+diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4
+index 28c3032..1674af0 100644
+--- a/config/kernel-bdev-block-device-operations.m4
++++ b/config/kernel-bdev-block-device-operations.m4
+@@ -7,24 +7,21 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+- ],[
+- int (*blk_open) (struct block_device *, fmode_t) = NULL;
+- int (*blk_release) (struct gendisk *, fmode_t) = NULL;
+- int (*blk_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- int (*blk_compat_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- struct block_device_operations blk_ops = {
++
++ int blk_open (struct block_device *bdev, fmode_t mode) { return 0; }
++ int blk_release (struct gendisk *g, fmode_t mode) { return 0; }
++ int blk_ioctl (struct block_device *bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ int blk_compat_ioctl (struct block_device * bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ static struct block_device_operations blk_ops __attribute__ ((unused)) = {
+ .open = blk_open,
+ .release = blk_release,
+ .ioctl = blk_ioctl,
+ .compat_ioctl = blk_compat_ioctl,
+ };
++ ],[
+
+- blk_ops.open(NULL, 0);
+- blk_ops.release(NULL, 0);
+- blk_ops.ioctl(NULL, 0, 0, 0);
+- blk_ops.compat_ioctl(NULL, 0, 0, 0);
+ ],[
+ AC_MSG_RESULT(struct block_device)
+ AC_DEFINE(HAVE_BDEV_BLOCK_DEVICE_OPERATIONS, 1,
+diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
+index ced4861..fe5707a 100644
+--- a/config/kernel-bio-end-io-t-args.m4
++++ b/config/kernel-bio-end-io-t-args.m4
+@@ -13,11 +13,9 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
++ void wanted_end_io(struct bio * bio, int x) { return; }
+ ],[
+- void (*wanted_end_io)(struct bio *, int) = NULL;
+- bio_end_io_t *local_end_io __attribute__ ((unused));
+-
+- local_end_io = wanted_end_io;
++ bio_end_io_t *local_end_io __attribute__ ((unused)) = wanted_end_io;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_BIO_END_IO_T, 1,
+diff --git a/config/kernel-create-nameidata.m4 b/config/kernel-create-nameidata.m4
+index 100f077..c779715 100644
+--- a/config/kernel-create-nameidata.m4
++++ b/config/kernel-create-nameidata.m4
+@@ -5,18 +5,18 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+ #ifdef HAVE_MKDIR_UMODE_T
+- int (*inode_create) (struct inode *,struct dentry *,
+- umode_t, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode ,struct dentry *dentry,
++ umode_t umode, struct nameidata *nidata) { return 0; }
+ #else
+- int (*inode_create) (struct inode *,struct dentry *,
+- int, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode,struct dentry *dentry,
++ int umode, struct nameidata * nidata) { return 0; }
+ #endif
+- struct inode_operations iops __attribute__ ((unused)) = {
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .create = inode_create,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
+ [iops->create() operation takes nameidata])
+diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4
+index dfbea7d..b89c51d 100644
+--- a/config/kernel-dentry-operations.m4
++++ b/config/kernel-dentry-operations.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/dcache.h>
+- ],[
+- int (*revalidate) (struct dentry *, struct nameidata *) = NULL;
+- struct dentry_operations dops __attribute__ ((unused)) = {
++ int revalidate (struct dentry *dentry, struct nameidata *nidata) { return 0; }
++ static struct dentry_operations dops __attribute__ ((unused)) = {
+ .d_revalidate = revalidate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
+ [dops->d_revalidate() operation takes nameidata])
+diff --git a/config/kernel-dirty-inode.m4 b/config/kernel-dirty-inode.m4
+index 2ededf1..86e3425 100644
+--- a/config/kernel-dirty-inode.m4
++++ b/config/kernel-dirty-inode.m4
+@@ -8,11 +8,11 @@ AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS], [
+ AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ void dirty_inode (struct inode * a, int b) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
++ .dirty_inode = dirty_inode,
++ };
+ ],[
+- void (*dirty_inode) (struct inode *, int) = NULL;
+- struct super_operations sops __attribute__ ((unused));
+-
+- sops.dirty_inode = dirty_inode;
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
+diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4
+index 6ac5ae6..0041ef2 100644
+--- a/config/kernel-fallocate.m4
++++ b/config/kernel-fallocate.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
+ AC_MSG_CHECKING([whether fops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate(struct file *file, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+@@ -25,34 +25,14 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
+ AC_MSG_CHECKING([whether iops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+- struct inode_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate (struct inode *inode, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct inode_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
+- AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+- ],[
+- AC_MSG_RESULT(no)
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.38 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
+- AC_MSG_CHECKING([whether fops->fallocate() exists])
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations_no_const fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
+- };
+ ],[
+ AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
++ AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+@@ -65,5 +45,4 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
+ ZFS_AC_KERNEL_FILE_FALLOCATE
+ ZFS_AC_KERNEL_INODE_FALLOCATE
+- ZFS_AC_PAX_KERNEL_FILE_FALLOCATE
+ ])
+diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4
+index ca00d93..9ac0c79 100644
+--- a/config/kernel-fsync.m4
++++ b/config/kernel-fsync.m4
+@@ -4,11 +4,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, struct dentry *dentry, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([dentry])
+ AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+@@ -23,11 +23,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([no dentry])
+ AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+@@ -42,68 +42,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, loff_t a, loff_t b, int c) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([range])
+- AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+- [fops->fsync() with range])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.x - 2.6.34 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([dentry])
+- AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+- [fops->fsync() with dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.35 - Linux 3.0 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([no dentry])
+- AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+- [fops->fsync() without dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 3.1 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_RANGE], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([range])
+ AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+@@ -117,7 +60,4 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
+ ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
+ ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
+ ZFS_AC_KERNEL_FSYNC_RANGE
+- ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_RANGE
+ ])
+diff --git a/config/kernel-lookup-nameidata.m4 b/config/kernel-lookup-nameidata.m4
+index 5e30be4..20b8cca 100644
+--- a/config/kernel-lookup-nameidata.m4
++++ b/config/kernel-lookup-nameidata.m4
+@@ -5,13 +5,14 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->lookup() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- struct dentry * (*inode_lookup) (struct inode *,struct dentry *,
+- struct nameidata *) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ struct dentry * inode_lookup (struct inode * inode,
++ struct dentry * dentry, struct nameidata * nidata)
++ { return NULL; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .lookup = inode_lookup,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1,
+ [iops->lookup() operation takes nameidata])
+diff --git a/config/kernel-mkdir-umode-t.m4 b/config/kernel-mkdir-umode-t.m4
+index dd5d94b..ce8aa8f 100644
+--- a/config/kernel-mkdir-umode-t.m4
++++ b/config/kernel-mkdir-umode-t.m4
+@@ -10,12 +10,13 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
+ AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*mkdir) (struct inode *,struct dentry *,umode_t) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ int mkdir (struct inode * inode, struct dentry * dentry, umode_t umode)
++ { return 0; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .mkdir = mkdir,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
+ [iops->create()/mkdir()/mknod() take umode_t])
+diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4
+index ea748c9..ce4b965 100644
+--- a/config/kernel-shrink.m4
++++ b/config/kernel-shrink.m4
+@@ -8,15 +8,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
+ AC_MSG_CHECKING([whether super_block has s_shrink])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*shrink)(struct shrinker *, struct shrink_control *sc)
+- __attribute__ ((unused)) = NULL;
+- struct super_block sb __attribute__ ((unused)) = {
++ int shrink(struct shrinker * s, struct shrink_control *sc) { return 0; }
++ static struct super_block sb __attribute__ ((unused)) = {
+ .s_shrink.shrink = shrink,
+ .s_shrink.seeks = DEFAULT_SEEKS,
+ .s_shrink.batch = 0,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
+
+@@ -29,13 +28,12 @@ AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*nr_cached_objects)(struct super_block *)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ int nr_cached_objects(struct super_block * sb) { return 0; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .nr_cached_objects = nr_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
+ [sops->nr_cached_objects() exists])
+@@ -48,13 +46,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- void (*free_cached_objects)(struct super_block *, int)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ void free_cached_objects(struct super_block * sb, int x) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .free_cached_objects = free_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
+ [sops->free_cached_objects() exists])
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch
new file mode 100644
index 000000000000..1dfef6117f1a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch
@@ -0,0 +1,32 @@
+commit 3d8c9c9de0a5e1f1b496fcef2750a01a45860b04
+Author: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Mon Mar 4 15:52:11 2013 -0500
+
+ Linux 3.9 compat: Undefine GCC_VERSION
+
+ The mainline kernel started defining GCC_VERSION with commit
+ torvalds/linux@3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16. Unfortunately,
+ LZ4 also defines this macro, but the two defintions are incompatible. We
+ undefine GCC_VERSION in lz4.c to handle this.
+
+ Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+
+diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c
+index b9850c0..8afaad1 100644
+--- a/module/zfs/lz4.c
++++ b/module/zfs/lz4.c
+@@ -243,6 +243,14 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
+ /* Disable restrict */
+ #define restrict
+
++/*
++ * Linux : GCC_VERSION is defined as of 3.9-rc1, so undefine it.
++ * torvalds/linux@3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16
++ */
++#ifdef GCC_VERSION
++#undef GCC_VERSION
++#endif
++
+ #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+
+ #if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) \ No newline at end of file
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch
new file mode 100644
index 000000000000..5f9f6525e73c
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch
@@ -0,0 +1,36 @@
+From 7f235381a0e501df55ebe2de10b69124e928d175 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Mon, 11 Feb 2013 12:55:24 -0800
+Subject: [PATCH] Add explicit MAXNAMELEN check
+
+It turns out that the Linux VFS doesn't strictly handle all cases
+where a component path name exceeds MAXNAMELEN. It does however
+appear to correctly handle MAXPATHLEN for us.
+
+The right way to handle this appears to be to add an explicit
+check to the zpl_lookup() function. Several in-tree filesystems
+handle this case the same way.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #1279
+---
+ module/zfs/zpl_inode.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
+index e406288..8c8ec24 100644
+--- a/module/zfs/zpl_inode.c
++++ b/module/zfs/zpl_inode.c
+@@ -41,6 +41,9 @@
+ struct inode *ip;
+ int error;
+
++ if (dlen(dentry) > ZFS_MAXNAMELEN)
++ return ERR_PTR(-ENAMETOOLONG);
++
+ crhold(cr);
+ error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL);
+ ASSERT3S(error, <=, 0);
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch
new file mode 100644
index 000000000000..81ec15f3e6c7
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch
@@ -0,0 +1,41 @@
+From 546c978bbd3f132a88609cab15ec0e954eaa62b8 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 21 Feb 2013 12:14:44 -0800
+Subject: [PATCH] Enable zfs_arc_memory_throttle_disable by default
+
+The zfs_arc_memory_throttle_disable module option was introduced
+by commit 0c5493d47059f25ce9dbf20c9fe87655f55102a1 to resolve a
+memory miscalculation which could result in the txg_sync thread
+spinning.
+
+When this was first introduced the default behavior was left
+unchanged until enough real world usage confirmed there were no
+unexpected issues. We've now reached that point. Linux's
+direct reclaim is working as expected so we're enabling this
+behavior by default.
+
+This helps pave the way to retire the spl_kmem_availrmem()
+functionality in the SPL layer. This was the only caller.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #938
+---
+ module/zfs/arc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/arc.c b/module/zfs/arc.c
+index 09924db..b7499ee 100644
+--- a/module/zfs/arc.c
++++ b/module/zfs/arc.c
+@@ -189,7 +189,7 @@
+ int zfs_arc_grow_retry = 0;
+ int zfs_arc_shrink_shift = 0;
+ int zfs_arc_p_min_shift = 0;
+-int zfs_arc_memory_throttle_disable = 0;
++int zfs_arc_memory_throttle_disable = 1;
+ int zfs_disable_dup_eviction = 0;
+ int zfs_arc_meta_prune = 0;
+
+--
+1.8.1.5
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch
new file mode 100644
index 000000000000..51a81363eac8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch
@@ -0,0 +1,44 @@
+From e2060f922f8526aecf437de4cc4dff4c3cdfae16 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue, 15 May 2012 23:19:32 -0400
+Subject: [PATCH] Revert Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))
+
+Commit eec8164771bee067c3cd55ed0a16dadeeba276de worked around an issue
+involving direct reclaim through the use of PF_MEMALLOC. Since we
+are reworking thing to use KM_PUSHPAGE so that swap works, we revert
+this patch in favor of the use of KM_PUSHPAGE in the affected areas.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ module/zfs/txg.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/module/zfs/txg.c b/module/zfs/txg.c
+index 5021e44..8d037f7 100644
+--- a/module/zfs/txg.c
++++ b/module/zfs/txg.c
+@@ -372,19 +372,6 @@
+ callb_cpr_t cpr;
+ uint64_t start, delta;
+
+-#ifdef _KERNEL
+- /*
+- * Disable the normal reclaim path for the txg_sync thread. This
+- * ensures the thread will never enter dmu_tx_assign() which can
+- * otherwise occur due to direct reclaim. If this is allowed to
+- * happen the system can deadlock. Direct reclaim call path:
+- *
+- * ->shrink_icache_memory->prune_icache->dispose_list->
+- * clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign
+- */
+- current->flags |= PF_MEMALLOC;
+-#endif /* _KERNEL */
+-
+ txg_thread_enter(tx, &cpr);
+
+ start = delta = 0;
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch
new file mode 100644
index 000000000000..0a4fd26040e7
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch
@@ -0,0 +1,56 @@
+From 78d26b8497b3845fc8130981c76214d6788f7a9d Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Mon, 7 May 2012 14:14:45 -0400
+Subject: [PATCH] Revert Fix zpl_writepage() deadlock
+
+The commit, cfc9a5c88f91f7b4d606fce89505e1f404691ea5, to fix deadlocks
+in zpl_writepage() relied on PF_MEMALLOC. That had the effect of
+disabling the direct reclaim path on all allocations originating from
+calls to this function, but it failed to address the actual cause of
+those deadlocks. This led to the same deadlocks being observed with
+swap on zvols, but not with swap on the loop device, which exercises
+this code.
+
+The use of PF_MEMALLOC also had the side effect of permitting
+allocations to be made from ZONE_DMA in instances that did not require
+it. This contributes to the possibility of panics caused by depletion
+of pages from ZONE_DMA.
+
+As such, we revert this patch in favor of a proper fix for both issues.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ module/zfs/zpl_file.c | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
+index 5ac41c9..2e9f72a 100644
+--- a/module/zfs/zpl_file.c
++++ b/module/zfs/zpl_file.c
+@@ -358,20 +358,7 @@
+ ASSERT(PageLocked(pp));
+ ASSERT(!PageWriteback(pp));
+
+- /*
+- * Disable the normal reclaim path for zpl_putpage(). This
+- * ensures that all memory allocations under this call path
+- * will never enter direct reclaim. If this were to happen
+- * the VM might try to write out additional pages by calling
+- * zpl_putpage() again resulting in a deadlock.
+- */
+- if (current->flags & PF_MEMALLOC) {
+- (void) zfs_putpage(mapping->host, pp, wbc);
+- } else {
+- current->flags |= PF_MEMALLOC;
+- (void) zfs_putpage(mapping->host, pp, wbc);
+- current->flags &= ~PF_MEMALLOC;
+- }
++ (void) zfs_putpage(mapping->host, pp, wbc);
+
+ return (0);
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch
new file mode 100644
index 000000000000..2eb85754b0f8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch
@@ -0,0 +1,70 @@
+From a1c889dd6fb04d70439074a9399c9ea8f29f2cdb Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Wed, 16 May 2012 18:16:02 -0400
+Subject: [PATCH] Revert Disable direct reclaim for z_wr_* threads
+
+This commit used PF_MEMALLOC to prevent a memory reclaim deadlock.
+However, commit 49be0ccf1fdc2ce852271d4d2f8b7a9c2c4be6db eliminated
+the invocation of __cv_init(), which was the cause of the deadlock.
+PF_MEMALLOC has the side effect of permitting pages from ZONE_DMA
+to be allocated. The use of PF_MEMALLOC was found to cause stability
+problems when doing swap on zvols. Since this technique is known to
+cause problems and no longer fixes anything, we revert it.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ include/sys/zfs_context.h | 1 -
+ module/zfs/spa.c | 9 +++------
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
+index e4af6fc..77dded3 100644
+--- a/include/sys/zfs_context.h
++++ b/include/sys/zfs_context.h
+@@ -382,7 +382,6 @@ extern kstat_t *kstat_create(char *, int,
+ #define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */
+ #define TASKQ_THREADS_CPU_PCT 0x0008 /* Scale # threads by # cpus */
+ #define TASKQ_DC_BATCH 0x0010 /* Mark threads as batch */
+-#define TASKQ_NORECLAIM 0x0020 /* Disable direct memory reclaim */
+
+ #define TQ_SLEEP KM_SLEEP /* Can block for memory */
+ #define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */
+diff --git a/module/zfs/spa.c b/module/zfs/spa.c
+index c33a33a..436cd26 100644
+--- a/module/zfs/spa.c
++++ b/module/zfs/spa.c
+@@ -617,8 +617,9 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
+
+ static taskq_t *
+ spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
+- uint_t value, uint_t flags)
++ uint_t value)
+ {
++ uint_t flags = TASKQ_PREPOPULATE;
+ boolean_t batch = B_FALSE;
+
+ switch (mode) {
+@@ -668,17 +669,13 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
+ const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
+ enum zti_modes mode = ztip->zti_mode;
+ uint_t value = ztip->zti_value;
+- uint_t flags = 0;
+ char name[32];
+
+- if (t == ZIO_TYPE_WRITE)
+- flags |= TASKQ_NORECLAIM;
+-
+ (void) snprintf(name, sizeof (name),
+ "%s_%s", zio_type_name[t], zio_taskq_types[q]);
+
+ spa->spa_zio_taskq[t][q] =
+- spa_taskq_create(spa, name, mode, value, flags);
++ spa_taskq_create(spa, name, mode, value);
+ }
+ }
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch
new file mode 100644
index 000000000000..00ec1057efa1
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch
@@ -0,0 +1,42 @@
+From 3db3ff4a787acf068b122562fb5be5aecec2611f Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@gentoo.org>
+Date: Tue, 2 Jul 2013 00:07:15 -0400
+Subject: [PATCH] Use MAXPATHLEN instead of sizeof in snprintf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This silences a GCC 4.8.0 warning by fixing a programming error
+caught by static analysis:
+
+../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
+../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’
+ in ‘snprintf’ call is the same expression as the destination;
+ did you mean to provide an explicit length?
+ [-Werror=sizeof-pointer-memaccess]
+ (void) snprintf(path, sizeof (path), ztest_aux_template,
+ ^
+
+Signed-off-by: Richard Yao <ryao@gentoo.org>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1480
+---
+ cmd/ztest/ztest.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
+index b38d7b1..93a5f1e 100644
+--- a/cmd/ztest/ztest.c
++++ b/cmd/ztest/ztest.c
+@@ -2581,7 +2581,7 @@ enum ztest_object {
+ zs->zs_vdev_aux = 0;
+ for (;;) {
+ int c;
+- (void) snprintf(path, sizeof (path), ztest_aux_template,
++ (void) snprintf(path, MAXPATHLEN, ztest_aux_template,
+ ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
+ zs->zs_vdev_aux);
+ for (c = 0; c < sav->sav_count; c++)
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch
new file mode 100644
index 000000000000..ce7d5c0494d9
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch
@@ -0,0 +1,32 @@
+From 8f1e11b6105bf46a4258958eb3dcae2ab21ed8b2 Mon Sep 17 00:00:00 2001
+From: Caleb James DeLisle <calebdelisle@lavabit.com>
+Date: Tue, 16 Apr 2013 05:23:39 -0400
+Subject: [PATCH] Remove .readdir from zpl_file_operations table
+
+The zpl_readdir() function shouldn't be registered as part of
+the zpl_file_operations table, it must only be part of the
+zpl_dir_file_operations table. By removing this callback
+the VFS will now correctly return ENOTDIR when calling
+getdents() on a file.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1404
+---
+ module/zfs/zpl_file.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
+index 9c27b7f..db6a72c 100644
+--- a/module/zfs/zpl_file.c
++++ b/module/zfs/zpl_file.c
+@@ -446,7 +446,6 @@
+ .llseek = generic_file_llseek,
+ .read = zpl_read,
+ .write = zpl_write,
+- .readdir = zpl_readdir,
+ .mmap = zpl_mmap,
+ .fsync = zpl_fsync,
+ #ifdef HAVE_FILE_FALLOCATE
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch
new file mode 100644
index 000000000000..8513e78882b1
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch
@@ -0,0 +1,73 @@
+From 57f5a2008e2e6acf58934cf43c5fdca0faffa73e Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 25 Apr 2013 16:29:22 -0700
+Subject: [PATCH] Fix txg_quiesce thread deadlock
+
+A deadlock was accidentally introduced by commit e95853a which
+can occur when the system is under memory pressure. What happens
+is that while the txg_quiesce thread is holding the tx->tx_cpu
+locks it enters memory reclaim. In the context of this memory
+reclaim it then issues synchronous I/O to a ZVOL swap device.
+Because the txg_quiesce thread is holding the tx->tx_cpu locks
+a new txg cannot be opened to handle the I/O. Deadlock.
+
+The fix is straight forward. Move the memory allocation outside
+the critical region where the tx->tx_cpu locks are held. And for
+good measure change the offending allocation to KM_PUSHPAGE to
+ensure it never attempts to issue I/O during reclaim.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #1274
+---
+ module/zfs/dsl_pool.c | 2 +-
+ module/zfs/txg.c | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c
+index 704f034..771b265 100644
+--- a/module/zfs/dsl_pool.c
++++ b/module/zfs/dsl_pool.c
+@@ -143,7 +143,7 @@
+ {
+ txg_history_t *th, *rm;
+
+- th = kmem_zalloc(sizeof(txg_history_t), KM_SLEEP);
++ th = kmem_zalloc(sizeof(txg_history_t), KM_PUSHPAGE);
+ mutex_init(&th->th_lock, NULL, MUTEX_DEFAULT, NULL);
+ th->th_kstat.txg = txg;
+ th->th_kstat.state = TXG_STATE_OPEN;
+diff --git a/module/zfs/txg.c b/module/zfs/txg.c
+index c7c3df3..7c820af 100644
+--- a/module/zfs/txg.c
++++ b/module/zfs/txg.c
+@@ -367,6 +367,13 @@
+ tx->tx_open_txg++;
+
+ /*
++ * Now that we've incremented tx_open_txg, we can let threads
++ * enter the next transaction group.
++ */
++ for (c = 0; c < max_ncpus; c++)
++ mutex_exit(&tx->tx_cpu[c].tc_lock);
++
++ /*
+ * Measure how long the txg was open and replace the kstat.
+ */
+ th = dsl_pool_txg_history_get(dp, txg);
+@@ -376,13 +383,6 @@
+ dsl_pool_txg_history_add(dp, tx->tx_open_txg);
+
+ /*
+- * Now that we've incremented tx_open_txg, we can let threads
+- * enter the next transaction group.
+- */
+- for (c = 0; c < max_ncpus; c++)
+- mutex_exit(&tx->tx_cpu[c].tc_lock);
+-
+- /*
+ * Quiesce the transaction group by waiting for everyone to txg_exit().
+ */
+ start = gethrtime();
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch
new file mode 100644
index 000000000000..b4801708ae35
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch
@@ -0,0 +1,50 @@
+From f706421173c571371afff5e2a2ee0784c5e3f95d Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 17 Apr 2013 13:07:36 -0700
+Subject: [PATCH] Correctly return ERANGE in getxattr(2)
+
+According to the getxattr(2) man page the ERANGE errno should be
+returned when the size of the value buffer is to small to hold the
+result. Prior to this patch the implementation would just truncate
+the value to size bytes.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1408
+---
+ module/zfs/zpl_xattr.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
+index c03764f..a7e38e6 100644
+--- a/module/zfs/zpl_xattr.c
++++ b/module/zfs/zpl_xattr.c
+@@ -225,6 +225,11 @@
+ goto out;
+ }
+
++ if (size < i_size_read(xip)) {
++ error = -ERANGE;
++ goto out;
++ }
++
+ error = zpl_read_common(xip, value, size, 0, UIO_SYSSPACE, 0, cr);
+ out:
+ if (xip)
+@@ -263,9 +268,12 @@
+ if (!size)
+ return (nv_size);
+
+- memcpy(value, nv_value, MIN(size, nv_size));
++ if (size < nv_size)
++ return (-ERANGE);
++
++ memcpy(value, nv_value, nv_size);
+
+- return (MIN(size, nv_size));
++ return (nv_size);
+ }
+
+ static int
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch
new file mode 100644
index 000000000000..bb4b1c4a3a34
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch
@@ -0,0 +1,37 @@
+From 0377189b884fab7db02a95088e05712c7cf336f7 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 8 May 2013 09:20:04 -0700
+Subject: [PATCH] Only check directory xattr on ENOENT
+
+When SA xattrs are enabled only fallback to checking the directory
+xattrs when the name is not found as a SA xattr. Otherwise, the SA
+error which should be returned to the caller is overwritten by the
+directory xattr errors. Positive return values indicating success
+will also be immediately returned.
+
+In the case of #1437 the ERANGE error was being correctly returned
+by zpl_xattr_get_sa() only to be overridden with ENOENT which was
+returned by the subsequent unnessisary call to zpl_xattr_get_dir().
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1437
+---
+ module/zfs/zpl_xattr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
+index a7e38e6..eb2c00d 100644
+--- a/module/zfs/zpl_xattr.c
++++ b/module/zfs/zpl_xattr.c
+@@ -288,7 +288,7 @@
+
+ if (zsb->z_use_sa && zp->z_is_sa) {
+ error = zpl_xattr_get_sa(ip, name, value, size);
+- if (error >= 0)
++ if (error != -ENOENT)
+ goto out;
+ }
+
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch
new file mode 100644
index 000000000000..e59c869eed04
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch
@@ -0,0 +1,58 @@
+From ab68b6e5db29abcd20c0c7b12a8c2fa570031c8b Mon Sep 17 00:00:00 2001
+From: Tim Chase <tim@chase2k.com>
+Date: Mon, 24 Jun 2013 22:03:56 -0500
+Subject: [PATCH] Fix zfs_sb_teardown/zfs_resume_fs NULL dereference
+
+Fix a pair of conditions in which a concurrent umount can cause
+NULL pointer dereferences:
+
+* zfs_sb_teardown - prevent a NULL dereference by not calling
+ dmu_objset_pool with a null z_os.
+
+* zfs_resume_fs - don't try to unmount with a null z_os. This
+ change makes the ZoL code more consistent
+ with both Illumos and FreeBSD.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1543
+---
+ module/zfs/zfs_vfsops.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
+index e618f2b..602c332 100644
+--- a/module/zfs/zfs_vfsops.c
++++ b/module/zfs/zfs_vfsops.c
+@@ -1056,10 +1056,12 @@
+ }
+
+ /*
+- * Drain the iput_taskq to ensure all active references to the
++ * If someone has not already unmounted this file system,
++ * drain the iput_taskq to ensure all active references to the
+ * zfs_sb_t have been handled only then can it be safely destroyed.
+ */
+- taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
++ if (zsb->z_os)
++ taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
+
+ /*
+ * Close the zil. NB: Can't close the zil while zfs_inactive
+@@ -1480,10 +1482,11 @@
+
+ if (err) {
+ /*
+- * Since we couldn't reopen zfs_sb_t, force
+- * unmount this file system.
++ * Since we couldn't reopen zfs_sb_t or, setup the
++ * sa framework, force unmount this file system.
+ */
+- (void) zfs_umount(zsb->z_sb);
++ if (zsb->z_os)
++ (void) zfs_umount(zsb->z_sb);
+ }
+ return (err);
+ }
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch
new file mode 100644
index 000000000000..7cca7d1137c8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch
@@ -0,0 +1,73 @@
+From 76351672c222f28ea1b681097a9eff58a6791555 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 11 Jul 2013 14:11:32 -0700
+Subject: [PATCH] Fix zfsctl_expire_snapshot() deadlock
+
+It is possible for an automounted snapshot which is expiring to
+deadlock with a manual unmount of the snapshot. This can occur
+because taskq_cancel_id() will block if the task is currently
+executing until it completes. But it will never complete because
+zfsctl_unmount_snapshot() is holding the zsb->z_ctldir_lock which
+zfsctl_expire_snapshot() must acquire.
+
+---------------------- z_unmount/0:2153 ---------------------
+ mutex_lock <blocking on zsb->z_ctldir_lock>
+ zfsctl_unmount_snapshot
+ zfsctl_expire_snapshot
+ taskq_thread
+
+------------------------- zfs:10690 -------------------------
+ taskq_wait_id <waiting for z_unmount to exit>
+ taskq_cancel_id
+ __zfsctl_unmount_snapshot
+ zfsctl_unmount_snapshot <takes zsb->z_ctldir_lock>
+ zfs_unmount_snap
+ zfs_ioc_destroy_snaps_nvl
+ zfsdev_ioctl
+ do_vfs_ioctl
+
+We resolve the deadlock by dropping the zsb->z_ctldir_lock before
+calling __zfsctl_unmount_snapshot(). The lock is only there to
+prevent concurrent modification to the zsb->z_ctldir_snaps AVL
+tree. Moreover, we're careful to remove the zfs_snapentry_t from
+the AVL tree before dropping the lock which ensures no other tasks
+can find it. On failure it's added back to the tree.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
+Closes #1527
+---
+ module/zfs/zfs_ctldir.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
+index 4fa530b..168f853 100644
+--- a/module/zfs/zfs_ctldir.c
++++ b/module/zfs/zfs_ctldir.c
+@@ -732,7 +732,11 @@ struct inode *
+ sep = avl_find(&zsb->z_ctldir_snaps, &search, NULL);
+ if (sep) {
+ avl_remove(&zsb->z_ctldir_snaps, sep);
++ mutex_exit(&zsb->z_ctldir_lock);
++
+ error = __zfsctl_unmount_snapshot(sep, flags);
++
++ mutex_enter(&zsb->z_ctldir_lock);
+ if (error == EBUSY)
+ avl_add(&zsb->z_ctldir_snaps, sep);
+ else
+@@ -767,7 +771,11 @@ struct inode *
+ while (sep != NULL) {
+ next = AVL_NEXT(&zsb->z_ctldir_snaps, sep);
+ avl_remove(&zsb->z_ctldir_snaps, sep);
++ mutex_exit(&zsb->z_ctldir_lock);
++
+ error = __zfsctl_unmount_snapshot(sep, flags);
++
++ mutex_enter(&zsb->z_ctldir_lock);
+ if (error == EBUSY) {
+ avl_add(&zsb->z_ctldir_snaps, sep);
+ (*count)++;
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch
new file mode 100644
index 000000000000..b1e7d3736db0
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch
@@ -0,0 +1,167 @@
+diff --git a/module/zfs/spa.c b/module/zfs/spa.c
+index e986e92..65f78b7 100644
+--- a/module/zfs/spa.c
++++ b/module/zfs/spa.c
+@@ -64,6 +64,7 @@
+ #include <sys/zfs_ioctl.h>
+ #include <sys/dsl_scan.h>
+ #include <sys/zfeature.h>
++#include <sys/zvol.h>
+
+ #ifdef _KERNEL
+ #include <sys/bootprops.h>
+@@ -2856,6 +2857,7 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ spa_load_state_t state = SPA_LOAD_OPEN;
+ int error;
+ int locked = B_FALSE;
++ int firstopen = B_FALSE;
+
+ *spapp = NULL;
+
+@@ -2879,6 +2881,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ if (spa->spa_state == POOL_STATE_UNINITIALIZED) {
+ zpool_rewind_policy_t policy;
+
++ firstopen = B_TRUE;
++
+ zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config,
+ &policy);
+ if (policy.zrp_request & ZPOOL_DO_REWIND)
+@@ -2953,6 +2957,11 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ mutex_exit(&spa_namespace_lock);
+ }
+
++#ifdef _KERNEL
++ if (firstopen)
++ zvol_create_minors(spa->spa_name);
++#endif
++
+ *spapp = spa;
+
+ return (0);
+@@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
+ mutex_exit(&spa_namespace_lock);
+ spa_history_log_version(spa, LOG_POOL_IMPORT);
+
++#ifdef _KERNEL
++ zvol_create_minors(pool);
++#endif
++
+ return (0);
+ }
+
+diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
+index 1226b2c..a9184a1 100644
+--- a/module/zfs/zfs_ioctl.c
++++ b/module/zfs/zfs_ioctl.c
+@@ -1268,9 +1268,6 @@ zfs_ioc_pool_import(zfs_cmd_t *zc)
+ error = err;
+ }
+
+- if (error == 0)
+- zvol_create_minors(zc->zc_name);
+-
+ nvlist_free(config);
+
+ if (props)
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index 43a7bb6..e35c91b 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -1215,6 +1215,9 @@ zvol_alloc(dev_t dev, const char *name)
+
+ zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
+
++ spin_lock_init(&zv->zv_lock);
++ list_link_init(&zv->zv_next);
++
+ zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
+ if (zv->zv_queue == NULL)
+ goto out_kmem;
+@@ -1248,9 +1251,6 @@ zvol_alloc(dev_t dev, const char *name)
+ sizeof (rl_t), offsetof(rl_t, r_node));
+ zv->zv_znode.z_is_zvol = TRUE;
+
+- spin_lock_init(&zv->zv_lock);
+- list_link_init(&zv->zv_next);
+-
+ zv->zv_disk->major = zvol_major;
+ zv->zv_disk->first_minor = (dev & MINORMASK);
+ zv->zv_disk->fops = &zvol_ops;
+@@ -1561,30 +1561,36 @@ zvol_init(void)
+ {
+ int error;
+
++ list_create(&zvol_state_list, sizeof (zvol_state_t),
++ offsetof(zvol_state_t, zv_next));
++ mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
++
+ zvol_taskq = taskq_create(ZVOL_DRIVER, zvol_threads, maxclsyspri,
+ zvol_threads, INT_MAX, TASKQ_PREPOPULATE);
+ if (zvol_taskq == NULL) {
+ printk(KERN_INFO "ZFS: taskq_create() failed\n");
+- return (-ENOMEM);
++ error = -ENOMEM;
++ goto out1;
+ }
+
+ error = register_blkdev(zvol_major, ZVOL_DRIVER);
+ if (error) {
+ printk(KERN_INFO "ZFS: register_blkdev() failed %d\n", error);
+- taskq_destroy(zvol_taskq);
+- return (error);
++ goto out2;
+ }
+
+ blk_register_region(MKDEV(zvol_major, 0), 1UL << MINORBITS,
+ THIS_MODULE, zvol_probe, NULL, NULL);
+
+- mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
+- list_create(&zvol_state_list, sizeof (zvol_state_t),
+- offsetof(zvol_state_t, zv_next));
++ return (0);
+
+- (void) zvol_create_minors(NULL);
++out2:
++ taskq_destroy(zvol_taskq);
++out1:
++ mutex_destroy(&zvol_state_lock);
++ list_destroy(&zvol_state_list);
+
+- return (0);
++ return (error);
+ }
+
+ void
+diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh
+index 141348c..281166c 100755
+--- a/scripts/zconfig.sh
++++ b/scripts/zconfig.sh
+@@ -264,8 +264,9 @@ test_4() {
+ zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+ ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
+
+- # Load the modules, wait 1 second for udev
++ # Load the modules, list the pools to ensure they are opened
+ ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
++ ${ZPOOL} list &>/dev/null
+
+ # Verify the devices were created
+ zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+diff --git a/udev/rules.d/90-zfs.rules.in b/udev/rules.d/90-zfs.rules.in
+index 52e1d63..a2715d2 100644
+--- a/udev/rules.d/90-zfs.rules.in
++++ b/udev/rules.d/90-zfs.rules.in
+@@ -1,4 +1,4 @@
+-SUBSYSTEM!="block", GOTO="zfs_end"
++SUBSYSTEM!="block|misc", GOTO="zfs_end"
+ ACTION!="add|change", GOTO="zfs_end"
+
+ ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs"
+@@ -7,4 +7,6 @@ ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs"
+ KERNEL=="null", SYMLINK+="root"
+ SYMLINK=="null", SYMLINK+="root"
+
++SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list"
++
+ LABEL="zfs_end"
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch
new file mode 100644
index 000000000000..90755a1a527f
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch
@@ -0,0 +1,108 @@
+commit a1d9543a39942be56879ca9338078afc77c25cea
+Author: Chris Dunlop <chris@onthe.net.au>
+Date: Mon Jun 3 16:58:52 2013 +1000
+
+ 3.10 API change: block_device_operations->release() returns void
+
+ Linux kernel commit torvalds/linux@db2a144 changed the return type
+ of block_device_operations->release() to void. Detect the expected
+ prototype and defined our callout accordingly.
+
+ Signed-off-by: Chris Dunlop <chris@onthe.net.au>
+ Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+ Closes #1494
+
+diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4
+index 8b5e0a3..faacc19 100644
+--- a/config/kernel-bdev-block-device-operations.m4
++++ b/config/kernel-bdev-block-device-operations.m4
+@@ -10,7 +10,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+
+ int blk_open(struct block_device *bdev, fmode_t mode)
+ { return 0; }
+- int blk_release(struct gendisk *g, fmode_t mode) { return 0; }
+ int blk_ioctl(struct block_device *bdev, fmode_t mode,
+ unsigned x, unsigned long y) { return 0; }
+ int blk_compat_ioctl(struct block_device * bdev, fmode_t mode,
+@@ -19,7 +18,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+ static const struct block_device_operations
+ bops __attribute__ ((unused)) = {
+ .open = blk_open,
+- .release = blk_release,
++ .release = NULL,
+ .ioctl = blk_ioctl,
+ .compat_ioctl = blk_compat_ioctl,
+ };
+diff --git a/config/kernel-block-device-operations-release-void.m4 b/config/kernel-block-device-operations-release-void.m4
+new file mode 100644
+index 0000000..a73f858
+--- /dev/null
++++ b/config/kernel-block-device-operations-release-void.m4
+@@ -0,0 +1,29 @@
++dnl #
++dnl # 3.10.x API change
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
++ AC_MSG_CHECKING([whether block_device_operations.release is void])
++ tmp_flags="$EXTRA_KCFLAGS"
++ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
++ ZFS_LINUX_TRY_COMPILE([
++ #include <linux/blkdev.h>
++
++ void blk_release(struct gendisk *g, fmode_t mode) { return; }
++
++ static const struct block_device_operations
++ bops __attribute__ ((unused)) = {
++ .open = NULL,
++ .release = blk_release,
++ .ioctl = NULL,
++ .compat_ioctl = NULL,
++ };
++ ],[
++ ],[
++ AC_MSG_RESULT(void)
++ AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
++ [struct block_device_operations.release returns void])
++ ],[
++ AC_MSG_RESULT(int)
++ ])
++ EXTRA_KCFLAGS="$tmp_flags"
++])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 7b8e3b0..46c0255 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -7,6 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ ZFS_AC_TEST_MODULE
+ ZFS_AC_KERNEL_CONFIG
+ ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS
++ ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
+ ZFS_AC_KERNEL_TYPE_FMODE_T
+ ZFS_AC_KERNEL_KOBJ_NAME_LEN
+ ZFS_AC_KERNEL_3ARG_BLKDEV_GET
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index e35c91b..b516156 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -1024,7 +1024,11 @@ out_mutex:
+ return (error);
+ }
+
++#ifdef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
++static void
++#else
+ static int
++#endif
+ zvol_release(struct gendisk *disk, fmode_t mode)
+ {
+ zvol_state_t *zv = disk->private_data;
+@@ -1044,7 +1048,9 @@ zvol_release(struct gendisk *disk, fmode_t mode)
+ if (drop_mutex)
+ mutex_exit(&zvol_state_lock);
+
++#ifndef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
+ return (0);
++#endif
+ }
+
+ static int
diff --git a/sys-fs/zfs-kmod/metadata.xml b/sys-fs/zfs-kmod/metadata.xml
new file mode 100644
index 000000000000..89265acacd16
--- /dev/null
+++ b/sys-fs/zfs-kmod/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <use>
+ <flag name="rootfs">Install zfs-shutdown script to support exporting a pool containing rootfs</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">zfsonlinux/zfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild
new file mode 100644
index 000000000000..fd97e6e7decd
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ virtual/awk
+ dev-lang/perl
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 8 || die "Linux 3.8 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix regression where snapshots are not visible
+ epatch "${FILESDIR}/${P}-fix-invisible-snapshots.patch"
+
+ # Fix deadlock involving concurrent `zfs destroy` and `zfs list` commands
+ epatch "${FILESDIR}/${P}-fix-recursive-reader.patch"
+
+ # Fix USE=debug build failure involving GCC 4.7
+ epatch "${FILESDIR}/${P}-gcc-4.7-compat.patch"
+
+ # Cast constant for 32-bit compatibility
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-cast-const-for-32bit-compatibility.patch"
+
+ # Handle missing name length check in Linux VFS
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-vfs-name-length-compatibility.patch"
+
+ # Fix barrier regression on Linux 2.6.37 and later
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-flush-properly.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild
new file mode 100644
index 000000000000..f8eed927b575
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 9 || die "Linux 3.9 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Cast constant for 32-bit compatibility
+ epatch "${FILESDIR}/${P}-cast-const-for-32bit-compatibility.patch"
+
+ # Handle missing name length check in Linux VFS
+ epatch "${FILESDIR}/${P}-vfs-name-length-compatibility.patch"
+
+ # Fix NULL pointer exception on hardened kernels, bug #457176
+ epatch "${FILESDIR}/${P}-improved-hardened-support.patch"
+
+ # Fix barrier regression on Linux 2.6.37 and later
+ epatch "${FILESDIR}/${P}-flush-properly.patch"
+
+ # Improve accuracy of autotools checks
+ epatch "${FILESDIR}/${P}-improved-autotools-checks.patch"
+
+ # Linux 3.9 Support
+ epatch "${FILESDIR}/${P}-linux-3.9-compat.patch"
+
+ # Do not second guess Linux's memory management
+ epatch "${FILESDIR}/${P}-zfs_arc_memory_throttle_disable.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+
+ # Provide /usr/src/zfs symlink for lustre
+ dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux introduces support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild
new file mode 100644
index 000000000000..add60655a5b7
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !UIDGID_STRICT_TYPE_CHECKS
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 10 || die "Linux 3.10 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Correctness fix for getdents
+ epatch "${FILESDIR}/${P}-fix-getdents.patch"
+
+ # Prevent possible deadlock regression
+ epatch "${FILESDIR}/${P}-fix-txg_quiesce-deadlock.patch"
+
+ # Correctness fixes for xattr
+ epatch "${FILESDIR}/${P}-fix-xattr-behavior-1.patch"
+ epatch "${FILESDIR}/${P}-fix-xattr-behavior-2.patch"
+
+ # Make certain that zvols always appear
+ epatch "${FILESDIR}/${P}-fix-zvol-initialization-r1.patch"
+
+ # Linux 3.10 Compatibility
+ epatch "${FILESDIR}/${PN}-0.6.1-linux-3.10-compat.patch"
+
+ # ARC Read Panic Fix
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-arc-read-panic.patch"
+
+ # Fix zfsctl_expire_snapshot deadlock
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch"
+
+ # Fix NULL pointer dereference in zfsctl_expire_snapshot
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+
+ # Provide /usr/src/zfs symlink for lustre
+ dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild
new file mode 100644
index 000000000000..2979452fe76a
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p2.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 12 || die "Linux 3.12 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild
new file mode 100644
index 000000000000..abc989cf389b
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p3.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild
new file mode 100644
index 000000000000..662180211837
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p4.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ 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"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild
new file mode 100644
index 000000000000..d8dba9780223
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/zfs-${PV}-patches-${PR}.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_RANDKSTACK
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 17 || die "Linux 3.17 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/zfs-${PV}-patches"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild
new file mode 100644
index 000000000000..9cce1c34beba
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_RANDKSTACK
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 16 || die "Linux 3.16 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild
new file mode 100644
index 000000000000..67b57ef87967
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 4 1 || die "Linux 4.1 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for new feature flags"
+ ewarn "that are incompatible with ZFSOnLinux 0.6.3 and GRUB2 support for"
+ ewarn "/boot with the new feature flags is not yet available."
+ ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+ ewarn "Any new pools will be created with the new feature flags by default"
+ ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
+ ewarn "create a newpool that is backward compatible, use "
+ ewarn "zpool create -o version=28 ..."
+ ewarn "Then explicitly enable older features. Note that the LZ4 feature has"
+ ewarn "been upgraded to support metadata compression and has not been"
+ ewarn "tested against the older GRUB2 code base. GRUB2 support will be"
+ ewarn "updated as soon as the GRUB2 developers and Open ZFS community write"
+ ewarn "GRUB2 patchese that pass mutual review."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild
new file mode 100644
index 000000000000..bad80188a2c2
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 4 0 || die "Linux 4.0 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for new feature flags"
+ ewarn "that are incompatible with ZFSOnLinux 0.6.3 and GRUB2 support for"
+ ewarn "/boot with the new feature flags is not yet available."
+ ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+ ewarn "Any new pools will be created with the new feature flags by default"
+ ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
+ ewarn "create a newpool that is backward compatible, use "
+ ewarn "zpool create -o version=28 ..."
+ ewarn "Then explicitly enable older features. Note that the LZ4 feature has"
+ ewarn "been upgraded to support metadata compression and has not been"
+ ewarn "tested against the older GRUB2 code base. GRUB2 support will be"
+ ewarn "updated as soon as the GRUB2 developers and Open ZFS community write"
+ ewarn "GRUB2 patchese that pass mutual review."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
new file mode 100644
index 000000000000..50318f9e3040
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 16 || die "Linux 3.16 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}