diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest deleted file mode 100644 index fec273a..0000000 --- a/sys-fs/zfs/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -AUX zfs-0.6.0-includedir.patch 586 RMD160 eb4cc6a9d66721e70c932b1dd640abd852d5470d SHA1 c673e057008b4cb7d4c45b936533e9bceff2443c SHA256 047a0cec35bcc5f8050fa80f8203ea020bf148375297c64300a9607f062cec2d -AUX zfs-0.6.0-kernel-3.1-compat.patch 13773 RMD160 8fc8d5c5a3650c775fd2b6c954dc4a9a66a24bd8 SHA1 57d82b8ff26847f0eb202eccdc26eafa1ddbc270 SHA256 348c0b1a46490d63061478898c88c4164f20ce687eeb3af898578263e4329c2e -AUX zfs-0.6.0-kernel-3.2-compat.patch 44345 RMD160 d6a3c936d4dd22e6c7c8b58c4c05d2d2a613c268 SHA1 44b8fa5afe50e951a5142aa5af81586fb0e3f290 SHA256 3d1afb6c1b65b5d01d9a78dd1957273b5ea487a555a8a129c5bf70091b23df9d -AUX zfs-9999-includedir.patch 601 RMD160 a75d2aca63f0b94a88003a9361c54cf54e77b533 SHA1 f0c60696b6bdfb349897c9b936ffb33b48a70cbf SHA256 d13c30e83548482cde91fb3366ab3d53bc5d0a554270c15a213e2dd15ec937ce -AUX zfs.initd 2052 RMD160 3636ead94d4b7200cc221b9e9646b85a5c3acc1a SHA1 d59d5b475c3dc335bf70a24a7af80ef7a38df347 SHA256 ad5e5aa282f2942b23364b5dcb43b4edea5c3923559d18d624ca9bcb51218476 -DIST zfs-0.6.0-rc6.tar.gz 1936503 RMD160 c5bcaa967fe70f5c72863f9e230850b37d76b8ce SHA1 70e6d4a6c97281df52e9c91ae577d15637804934 SHA256 b4f72580307d8b81fa9568fd46dccc993367402bf085adb9eca4dd1a24f323e0 -EBUILD zfs-0.6.0_rc6-r2.ebuild 1797 RMD160 15ef2b30e742c9639512f24fb2ec765427c9b4ae SHA1 10b862b0baf9794ef2a157b4e9e5e35f17e64aa1 SHA256 260fb88576e029cc65f5c8ff0ba5178c81ebdbeaf8d5757474e56128420e940d -EBUILD zfs-9999.ebuild 1478 RMD160 74c3c243479e0a5e648c8d20122bfe7802438c8a SHA1 245a203a145160d9fcb7a349fe12b28f291e836a SHA256 d94e9a20286df8ed2f407b08e3d71a29b24d8af5fbba20869a8bc7f7505f296c diff --git a/sys-fs/zfs/files/zfs-0.6.0-includedir.patch b/sys-fs/zfs/files/zfs-0.6.0-includedir.patch deleted file mode 100644 index fd31ec3..0000000 --- a/sys-fs/zfs/files/zfs-0.6.0-includedir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -urN zfs-0.6.0-rc3.orig/Makefile.am zfs-0.6.0-rc3/Makefile.am ---- zfs-0.6.0-rc3.orig/Makefile.am 2011-04-07 22:31:01.000000000 +0400 -+++ zfs-0.6.0-rc3/Makefile.am 2011-04-12 03:25:36.000000000 +0400 -@@ -32,8 +32,7 @@ - - if CONFIG_KERNEL - install-data-local: -- destname=zfs-$(ZFS_META_VERSION)/$(LINUX_VERSION); \ -- instdest=$(DESTDIR)/usr/src/$$destname; \ -+ instdest=$(DESTDIR)/${includedir}/zfs-linux; \ - echo "$(ZFS_META_VERSION)" >$$instdest/zfs.release; \ - for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ diff --git a/sys-fs/zfs/files/zfs-0.6.0-kernel-3.1-compat.patch b/sys-fs/zfs/files/zfs-0.6.0-kernel-3.1-compat.patch deleted file mode 100644 index 7440118..0000000 --- a/sys-fs/zfs/files/zfs-0.6.0-kernel-3.1-compat.patch +++ /dev/null @@ -1,581 +0,0 @@ -diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4 -index 3f93842..862b897 100644 ---- a/config/kernel-fsync.m4 -+++ b/config/kernel-fsync.m4 -@@ -1,20 +1,63 @@ - dnl # --dnl # 2.6.35 API change --dnl # The dentry argument was deamed unused and dropped in 2.6.36. -+dnl # Linux 2.6.x - 2.6.34 API - dnl # --AC_DEFUN([ZFS_AC_KERNEL_FSYNC_2ARGS], [ -- AC_MSG_CHECKING([whether fops->fsync() wants 2 args]) -+AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [ - ZFS_LINUX_TRY_COMPILE([ - #include - ],[ -- int (*fsync) (struct file *, int datasync) = NULL; -+ int (*fsync) (struct file *, struct dentry *, int) = NULL; - struct file_operations fops __attribute__ ((unused)); - - fops.fsync = fsync; - ],[ -- AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_2ARGS_FSYNC, 1, [fops->fsync() want 2 args]) -+ AC_MSG_RESULT([dentry]) -+ AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1, -+ [fops->fsync() with dentry]) - ],[ -- AC_MSG_RESULT(no) - ]) - ]) -+ -+dnl # -+dnl # Linux 2.6.35 - Linux 3.0 API -+dnl # -+AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [ -+ ZFS_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ 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, -+ [fops->fsync() without dentry]) -+ ],[ -+ ]) -+]) -+ -+dnl # -+dnl # Linux 3.1 -x 3.x API -+dnl # -+AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [ -+ ZFS_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ 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]) -+ ],[ -+ ]) -+]) -+ -+AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [ -+ AC_MSG_CHECKING([whether fops->fsync() wants]) -+ ZFS_AC_KERNEL_FSYNC_WITH_DENTRY -+ ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY -+ ZFS_AC_KERNEL_FSYNC_RANGE -+]) -diff --git a/config/kernel.m4 b/config/kernel.m4 -index fec157a..8cfbccf 100644 ---- a/config/kernel.m4 -+++ b/config/kernel.m4 -@@ -32,7 +32,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ - ZFS_AC_KERNEL_CONST_XATTR_HANDLER - ZFS_AC_KERNEL_XATTR_HANDLER_GET - ZFS_AC_KERNEL_XATTR_HANDLER_SET -- ZFS_AC_KERNEL_FSYNC_2ARGS -+ ZFS_AC_KERNEL_FSYNC - ZFS_AC_KERNEL_EVICT_INODE - ZFS_AC_KERNEL_INSERT_INODE_LOCKED - ZFS_AC_KERNEL_D_OBTAIN_ALIAS -diff --git a/configure b/configure -index e70651f..89596d9 100755 ---- a/configure -+++ b/configure -@@ -14418,8 +14418,9 @@ fi - - - -- { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants 2 args" >&5 --$as_echo_n "checking whether fops->fsync() wants 2 args... " >&6; } -+ { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5 -+$as_echo_n "checking whether fops->fsync() wants... " >&6; } -+ - - - cat confdefs.h - <<_ACEOF >conftest.c -@@ -14436,7 +14437,7 @@ int - main (void) - { - -- int (*fsync) (struct file *, int datasync) = NULL; -+ int (*fsync) (struct file *, struct dentry *, int) = NULL; - struct file_operations fops __attribute__ ((unused)); - - fops.fsync = fsync; -@@ -14462,11 +14463,75 @@ _ACEOF - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -- { $as_echo "$as_me:$LINENO: result: yes" >&5 --$as_echo "yes" >&6; } -+ { $as_echo "$as_me:$LINENO: result: dentry" >&5 -+$as_echo "dentry" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_2ARGS_FSYNC 1 -+#define HAVE_FSYNC_WITH_DENTRY 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ int (*fsync) (struct file *, int) = NULL; -+ struct file_operations fops __attribute__ ((unused)); -+ -+ fops.fsync = fsync; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: no dentry" >&5 -+$as_echo "no dentry" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_FSYNC_WITHOUT_DENTRY 1 - _ACEOF - - -@@ -14474,8 +14539,6 @@ else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - -- { $as_echo "$as_me:$LINENO: result: no" >&5 --$as_echo "no" >&6; } - - - -@@ -14486,6 +14549,71 @@ fi - - - -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ int (*fsync) (struct file *, loff_t, loff_t, int) = NULL; -+ struct file_operations fops __attribute__ ((unused)); -+ -+ fops.fsync = fsync; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: range" >&5 -+$as_echo "range" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_FSYNC_RANGE 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5 - $as_echo_n "checking whether sops->evict_inode() exists... " >&6; } - -@@ -19027,8 +19155,9 @@ fi - - - -- { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants 2 args" >&5 --$as_echo_n "checking whether fops->fsync() wants 2 args... " >&6; } -+ { $as_echo "$as_me:$LINENO: checking whether fops->fsync() wants" >&5 -+$as_echo_n "checking whether fops->fsync() wants... " >&6; } -+ - - - cat confdefs.h - <<_ACEOF >conftest.c -@@ -19045,7 +19174,7 @@ int - main (void) - { - -- int (*fsync) (struct file *, int datasync) = NULL; -+ int (*fsync) (struct file *, struct dentry *, int) = NULL; - struct file_operations fops __attribute__ ((unused)); - - fops.fsync = fsync; -@@ -19071,11 +19200,75 @@ _ACEOF - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -- { $as_echo "$as_me:$LINENO: result: yes" >&5 --$as_echo "yes" >&6; } -+ { $as_echo "$as_me:$LINENO: result: dentry" >&5 -+$as_echo "dentry" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_2ARGS_FSYNC 1 -+#define HAVE_FSYNC_WITH_DENTRY 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ int (*fsync) (struct file *, int) = NULL; -+ struct file_operations fops __attribute__ ((unused)); -+ -+ fops.fsync = fsync; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: no dentry" >&5 -+$as_echo "no dentry" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_FSYNC_WITHOUT_DENTRY 1 - _ACEOF - - -@@ -19083,8 +19276,6 @@ else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - -- { $as_echo "$as_me:$LINENO: result: no" >&5 --$as_echo "no" >&6; } - - - -@@ -19095,6 +19286,71 @@ fi - - - -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ int (*fsync) (struct file *, loff_t, loff_t, int) = NULL; -+ struct file_operations fops __attribute__ ((unused)); -+ -+ fops.fsync = fsync; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: range" >&5 -+$as_echo "range" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_FSYNC_RANGE 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether sops->evict_inode() exists" >&5 - $as_echo_n "checking whether sops->evict_inode() exists... " >&6; } - -diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c -index 298c0b6..0ef2c15 100644 ---- a/module/zfs/zpl_file.c -+++ b/module/zfs/zpl_file.c -@@ -76,37 +76,78 @@ zpl_readdir(struct file *filp, void *dirent, filldir_t filldir) - return (error); - } - -+#if defined(HAVE_FSYNC_WITH_DENTRY) - /* -- * 2.6.35 API change, -- * As of 2.6.35 the dentry argument to the .fsync() vfs hook was deemed -+ * Linux 2.6.x - 2.6.34 API, -+ * Through 2.6.34 the nfsd kernel server would pass a NULL 'file struct *' -+ * to the fops->fsync() hook. For this reason, we must be careful not to -+ * use filp unconditionally. -+ */ -+static int -+zpl_fsync(struct file *filp, struct dentry *dentry, int datasync) -+{ -+ cred_t *cr = CRED(); -+ int error; -+ -+ crhold(cr); -+ error = -zfs_fsync(dentry->d_inode, datasync, cr); -+ crfree(cr); -+ ASSERT3S(error, <=, 0); -+ -+ return (error); -+} -+ -+#elif defined(HAVE_FSYNC_WITHOUT_DENTRY) -+/* -+ * Linux 2.6.35 - 3.0 API, -+ * As of 2.6.35 the dentry argument to the fops->fsync() hook was deemed - * redundant. The dentry is still accessible via filp->f_path.dentry, - * and we are guaranteed that filp will never be NULL. -- * -- * 2.6.34 API change, -- * Prior to 2.6.34 the nfsd kernel server would pass a NULL file struct * -- * to the .fsync() hook. For this reason, we must be careful not to use -- * filp unconditionally in the 3 argument case. - */ --#ifdef HAVE_2ARGS_FSYNC - static int - zpl_fsync(struct file *filp, int datasync) - { -- struct dentry *dentry = filp->f_path.dentry; --#else -+ struct inode *inode = filp->f_mapping->host; -+ cred_t *cr = CRED(); -+ int error; -+ -+ crhold(cr); -+ error = -zfs_fsync(inode, datasync, cr); -+ crfree(cr); -+ ASSERT3S(error, <=, 0); -+ -+ return (error); -+} -+ -+#elif defined(HAVE_FSYNC_RANGE) -+/* -+ * Linux 3.1 - 3.x API, -+ * As of 3.1 the responsibility to call filemap_write_and_wait_range() has -+ * been pushed down in to the .fsync() vfs hook. Additionally, the i_mutex -+ * lock is no longer held by the caller, for zfs we don't require the lock -+ * to be held so we don't acquire it. -+ */ - static int --zpl_fsync(struct file *filp, struct dentry *dentry, int datasync) -+zpl_fsync(struct file *filp, loff_t start, loff_t end, int datasync) - { --#endif /* HAVE_2ARGS_FSYNC */ -+ struct inode *inode = filp->f_mapping->host; - cred_t *cr = CRED(); - int error; - -+ error = filemap_write_and_wait_range(inode->i_mapping, start, end); -+ if (error) -+ return (error); -+ - crhold(cr); -- error = -zfs_fsync(dentry->d_inode, datasync, cr); -+ error = -zfs_fsync(inode, datasync, cr); - crfree(cr); - ASSERT3S(error, <=, 0); - - return (error); - } -+#else -+#error "Unsupported fops->fsync() implementation" -+#endif - - ssize_t - zpl_read_common(struct inode *ip, const char *buf, size_t len, loff_t pos, -diff --git a/zfs_config.h.in b/zfs_config.h.in -index 6f18dca..41d7ab1 100644 ---- a/zfs_config.h.in -+++ b/zfs_config.h.in -@@ -6,9 +6,6 @@ - /* bio_end_io_t wants 2 args */ - #undef HAVE_2ARGS_BIO_END_IO_T - --/* fops->fsync() want 2 args */ --#undef HAVE_2ARGS_FSYNC -- - /* security_inode_init_security wants 6 args */ - #undef HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY - -@@ -93,6 +90,15 @@ - /* kernel defines fmode_t */ - #undef HAVE_FMODE_T - -+/* fops->fsync() with range */ -+#undef HAVE_FSYNC_RANGE -+ -+/* fops->fsync() without dentry */ -+#undef HAVE_FSYNC_WITHOUT_DENTRY -+ -+/* fops->fsync() with dentry */ -+#undef HAVE_FSYNC_WITH_DENTRY -+ - /* blk_disk_ro() is available */ - #undef HAVE_GET_DISK_RO - diff --git a/sys-fs/zfs/files/zfs-0.6.0-kernel-3.2-compat.patch b/sys-fs/zfs/files/zfs-0.6.0-kernel-3.2-compat.patch deleted file mode 100644 index d023cdb..0000000 --- a/sys-fs/zfs/files/zfs-0.6.0-kernel-3.2-compat.patch +++ /dev/null @@ -1,1211 +0,0 @@ -diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4 -index a26de9f..c21588a 100644 ---- a/config/kernel-security-inode-init.m4 -+++ b/config/kernel-security-inode-init.m4 -@@ -12,7 +12,14 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [ - ZFS_LINUX_TRY_COMPILE([ - #include - ],[ -- security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL); -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ char *name __attribute__ ((unused)) = NULL; -+ void *value __attribute__ ((unused)) = NULL; -+ size_t len __attribute__ ((unused)) = 0; -+ -+ security_inode_init_security(ip, dip, str, &name, &value, &len); - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1, -@@ -22,3 +29,33 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [ - ]) - EXTRA_KCFLAGS="$tmp_flags" - ]) -+ -+dnl # -+dnl # 3.2 API change -+dnl # The security_inode_init_security() API has been changed to include -+dnl # a filesystem specific callback to write security extended attributes. -+dnl # This was done to support the initialization of multiple LSM xattrs -+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 -+ ],[ -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ initxattrs func __attribute__ ((unused)) = NULL; -+ -+ security_inode_init_security(ip, dip, str, func, NULL); -+ ],[ -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1, -+ [security_inode_init_security wants callback]) -+ ],[ -+ AC_MSG_RESULT(no) -+ ]) -+ EXTRA_KCFLAGS="$tmp_flags" -+]) -diff --git a/config/kernel.m4 b/config/kernel.m4 -index 2afe77e..45e9b14 100644 ---- a/config/kernel.m4 -+++ b/config/kernel.m4 -@@ -41,6 +41,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ - ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE - ZFS_AC_KERNEL_TRUNCATE_SETSIZE - ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY -+ ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY - ZFS_AC_KERNEL_MOUNT_NODEV - ZFS_AC_KERNEL_SHRINK - ZFS_AC_KERNEL_BDI -diff --git a/configure b/configure -index f30b1ff..5106738 100755 ---- a/configure -+++ b/configure -@@ -15144,7 +15144,14 @@ int - main (void) - { - -- security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL); -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ char *name __attribute__ ((unused)) = NULL; -+ void *value __attribute__ ((unused)) = NULL; -+ size_t len __attribute__ ((unused)) = 0; -+ -+ security_inode_init_security(ip, dip, str, &name, &value, &len); - - ; - return 0; -@@ -15192,6 +15199,79 @@ fi - EXTRA_KCFLAGS="$tmp_flags" - - -+ { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants callback" >&5 -+$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; } -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ initxattrs func __attribute__ ((unused)) = NULL; -+ -+ security_inode_init_security(ip, dip, str, func, NULL); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ EXTRA_KCFLAGS="$tmp_flags" -+ -+ - { $as_echo "$as_me:$LINENO: checking whether symbol mount_nodev is exported" >&5 - $as_echo_n "checking whether symbol mount_nodev is exported... " >&6; } - grep -q -E '[[:space:]]mount_nodev[[:space:]]' \ -@@ -20191,7 +20271,14 @@ int - main (void) - { - -- security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL); -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ char *name __attribute__ ((unused)) = NULL; -+ void *value __attribute__ ((unused)) = NULL; -+ size_t len __attribute__ ((unused)) = 0; -+ -+ security_inode_init_security(ip, dip, str, &name, &value, &len); - - ; - return 0; -@@ -20239,6 +20326,79 @@ fi - EXTRA_KCFLAGS="$tmp_flags" - - -+ { $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants callback" >&5 -+$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; } -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct inode *ip __attribute__ ((unused)) = NULL; -+ struct inode *dip __attribute__ ((unused)) = NULL; -+ const struct qstr *str __attribute__ ((unused)) = NULL; -+ initxattrs func __attribute__ ((unused)) = NULL; -+ -+ security_inode_init_security(ip, dip, str, func, NULL); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ EXTRA_KCFLAGS="$tmp_flags" -+ -+ - { $as_echo "$as_me:$LINENO: checking whether symbol mount_nodev is exported" >&5 - $as_echo_n "checking whether symbol mount_nodev is exported... " >&6; } - grep -q -E '[[:space:]]mount_nodev[[:space:]]' \ -diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c -index 9117b7b..51c81ed 100644 ---- a/module/zfs/zpl_xattr.c -+++ b/module/zfs/zpl_xattr.c -@@ -606,6 +606,34 @@ __zpl_xattr_security_set(struct inode *ip, const char *name, - } - ZPL_XATTR_SET_WRAPPER(zpl_xattr_security_set); - -+#ifdef HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY -+static int -+__zpl_xattr_security_init(struct inode *ip, const struct xattr *xattrs, -+ void *fs_info) -+{ -+ const struct xattr *xattr; -+ int error = 0; -+ -+ for (xattr = xattrs; xattr->name != NULL; xattr++) { -+ error = __zpl_xattr_security_set(ip, -+ xattr->name, xattr->value, xattr->value_len, 0); -+ -+ if (error < 0) -+ break; -+ } -+ -+ return (error); -+} -+ -+int -+zpl_xattr_security_init(struct inode *ip, struct inode *dip, -+ const struct qstr *qstr) -+{ -+ return security_inode_init_security(ip, dip, qstr, -+ &__zpl_xattr_security_init, NULL); -+} -+ -+#else - int - zpl_xattr_security_init(struct inode *ip, struct inode *dip, - const struct qstr *qstr) -@@ -631,6 +659,7 @@ zpl_xattr_security_init(struct inode *ip, struct inode *dip, - - return (error); - } -+#endif /* HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY */ - - xattr_handler_t zpl_xattr_security_handler = { - .prefix = XATTR_SECURITY_PREFIX, -diff --git a/zfs_config.h.in b/zfs_config.h.in -index b53ca52..4eee892 100644 ---- a/zfs_config.h.in -+++ b/zfs_config.h.in -@@ -66,6 +66,9 @@ - /* blk_rq_sectors() is available */ - #undef HAVE_BLK_RQ_SECTORS - -+/* security_inode_init_security wants callback */ -+#undef HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY -+ - /* check_disk_size_change() is available */ - #undef HAVE_CHECK_DISK_SIZE_CHANGE - -diff --git a/Makefile.in b/Makefile.in -index 6c55040..332efc1 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -91,6 +91,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/Makefile.in b/cmd/Makefile.in -index f006e4c..ee3f4be 100644 ---- a/cmd/Makefile.in -+++ b/cmd/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in -index 3ae2015..e7da7c2 100644 ---- a/cmd/mount_zfs/Makefile.in -+++ b/cmd/mount_zfs/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/sas_switch_id/Makefile.in b/cmd/sas_switch_id/Makefile.in -index a23b35d..fb6ea65 100644 ---- a/cmd/sas_switch_id/Makefile.in -+++ b/cmd/sas_switch_id/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in -index 7e0a88e..da31195 100644 ---- a/cmd/zdb/Makefile.in -+++ b/cmd/zdb/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in -index 759492f..55ca808 100644 ---- a/cmd/zfs/Makefile.in -+++ b/cmd/zfs/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in -index 77d8a10..5e6f90e 100644 ---- a/cmd/zinject/Makefile.in -+++ b/cmd/zinject/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in -index 1374449..cf672f1 100644 ---- a/cmd/zpios/Makefile.in -+++ b/cmd/zpios/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in -index df27c8c..b915006 100644 ---- a/cmd/zpool/Makefile.in -+++ b/cmd/zpool/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in -index eefb09a..aadd124 100644 ---- a/cmd/zpool_id/Makefile.in -+++ b/cmd/zpool_id/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in -index 9914ca1..e1b1643 100644 ---- a/cmd/zpool_layout/Makefile.in -+++ b/cmd/zpool_layout/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in -index 0ed7754..e99cc9e 100644 ---- a/cmd/ztest/Makefile.in -+++ b/cmd/ztest/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/cmd/zvol_id/Makefile.in b/cmd/zvol_id/Makefile.in -index 6b2af96..d6719fd 100644 ---- a/cmd/zvol_id/Makefile.in -+++ b/cmd/zvol_id/Makefile.in -@@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/config/kernel-set-nlink.m4 b/config/kernel-set-nlink.m4 -new file mode 100644 -index 0000000..f7ffc0d ---- /dev/null -+++ b/config/kernel-set-nlink.m4 -@@ -0,0 +1,20 @@ -+dnl # -+dnl # Linux v3.2-rc1 API change -+dnl # SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170 -+dnl # -+AC_DEFUN([ZFS_AC_KERNEL_SET_NLINK], [ -+ AC_MSG_CHECKING([whether set_nlink() is available]) -+ ZFS_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ struct inode node; -+ unsigned int link = 0; -+ (void) set_nlink(&node, link); -+ ],[ -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(HAVE_SET_NLINK, 1, -+ [set_nlink() is available]) -+ ],[ -+ AC_MSG_RESULT(no) -+ ]) -+]) -diff --git a/config/kernel.m4 b/config/kernel.m4 -index 8cfbccf..63a3237 100644 ---- a/config/kernel.m4 -+++ b/config/kernel.m4 -@@ -42,5 +42,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ - ZFS_AC_KERNEL_MOUNT_NODEV - ZFS_AC_KERNEL_BDI -+ ZFS_AC_KERNEL_SET_NLINK - - AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ - KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -diff --git a/configure b/configure -index 919a4dd..e9e2ec1 100755 ---- a/configure -+++ b/configure -@@ -15226,6 +15226,73 @@ fi - - - -+ { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5 -+$as_echo_n "checking whether set_nlink() is available... " >&6; } -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct inode node; -+ unsigned int link = 0; -+ (void) set_nlink(&node, link); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_SET_NLINK 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ - if test "$LINUX_OBJ" != "$LINUX"; then - - KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -@@ -19996,6 +20063,73 @@ fi - - - -+ { $as_echo "$as_me:$LINENO: checking whether set_nlink() is available" >&5 -+$as_echo_n "checking whether set_nlink() is available... " >&6; } -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct inode node; -+ unsigned int link = 0; -+ (void) set_nlink(&node, link); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_SET_NLINK 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ - if test "$LINUX_OBJ" != "$LINUX"; then - - KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -diff --git a/dracut/90zfs/Makefile.in b/dracut/90zfs/Makefile.in -index 07bf3f2..cc79618 100644 ---- a/dracut/90zfs/Makefile.in -+++ b/dracut/90zfs/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/dracut/Makefile.in b/dracut/Makefile.in -index b2769b1..1c6b3e6 100644 ---- a/dracut/Makefile.in -+++ b/dracut/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/etc/Makefile.in b/etc/Makefile.in -index 594db91..a2e3986 100644 ---- a/etc/Makefile.in -+++ b/etc/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in -index 31da3b6..9eb8ae7 100644 ---- a/etc/init.d/Makefile.in -+++ b/etc/init.d/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in -index 59c7b8e..6c81f5d 100644 ---- a/etc/zfs/Makefile.in -+++ b/etc/zfs/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/Makefile.in b/include/Makefile.in -index 9ea2e2f..f82fdb2 100644 ---- a/include/Makefile.in -+++ b/include/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in -index 5e04eb4..e50b89b 100644 ---- a/include/linux/Makefile.in -+++ b/include/linux/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h -index 825a7fd..371bbc1 100644 ---- a/include/linux/vfs_compat.h -+++ b/include/linux/vfs_compat.h -@@ -94,4 +94,19 @@ bdi_setup_and_register(struct backing_dev_info *bdi,char *name,unsigned int cap) - } - #endif /* HAVE_BDI && !HAVE_BDI_SETUP_AND_REGISTER */ - -+/* -+ * 3.2-rc1 API change, -+ * Add set_nlink() if it is not exported by the Linux kernel. -+ * -+ * i_nlink is read-only in Linux 3.2, but it can be set directly in -+ * earlier kernels. -+ */ -+#ifndef HAVE_SET_NLINK -+static inline void -+set_nlink(struct inode *inode, unsigned int nlink) -+{ -+ inode->i_nlink = nlink; -+} -+#endif /* HAVE_SET_NLINK */ -+ - #endif /* _ZFS_VFS_H */ -diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in -index ad98df9..b17649b 100644 ---- a/include/sys/Makefile.in -+++ b/include/sys/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in -index b29c9f3..e3fd84c 100644 ---- a/include/sys/fm/Makefile.in -+++ b/include/sys/fm/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in -index 395e698..4095261 100644 ---- a/include/sys/fm/fs/Makefile.in -+++ b/include/sys/fm/fs/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in -index c6de71a..db73ab8 100644 ---- a/include/sys/fs/Makefile.in -+++ b/include/sys/fs/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/Makefile.in b/lib/Makefile.in -index e132c20..17f84a5 100644 ---- a/lib/Makefile.in -+++ b/lib/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in -index 38a8357..55bb04d 100644 ---- a/lib/libavl/Makefile.in -+++ b/lib/libavl/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in -index 9f23630..6e4a83b 100644 ---- a/lib/libefi/Makefile.in -+++ b/lib/libefi/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in -index 589938e..60439ae 100644 ---- a/lib/libnvpair/Makefile.in -+++ b/lib/libnvpair/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in -index c0c0786..94ea82e 100644 ---- a/lib/libshare/Makefile.in -+++ b/lib/libshare/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in -index f0d3d76..194679a 100644 ---- a/lib/libspl/Makefile.in -+++ b/lib/libspl/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in -index 2e29d93..a9ffb57 100644 ---- a/lib/libspl/asm-generic/Makefile.in -+++ b/lib/libspl/asm-generic/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in -index d366650..ca65730 100644 ---- a/lib/libspl/asm-i386/Makefile.in -+++ b/lib/libspl/asm-i386/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in -index b3b9042..2db49b3 100644 ---- a/lib/libspl/asm-x86_64/Makefile.in -+++ b/lib/libspl/asm-x86_64/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in -index 4653fea..d7a8f52 100644 ---- a/lib/libspl/include/Makefile.in -+++ b/lib/libspl/include/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in -index 3782302..b608928 100644 ---- a/lib/libspl/include/ia32/Makefile.in -+++ b/lib/libspl/include/ia32/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in -index 9503ba6..3662996 100644 ---- a/lib/libspl/include/ia32/sys/Makefile.in -+++ b/lib/libspl/include/ia32/sys/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in -index f3a7fd3..68e3c2f 100644 ---- a/lib/libspl/include/rpc/Makefile.in -+++ b/lib/libspl/include/rpc/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in -index 8a69ebc..6851505 100644 ---- a/lib/libspl/include/sys/Makefile.in -+++ b/lib/libspl/include/sys/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in -index 8cd6cbf..89c3285 100644 ---- a/lib/libspl/include/sys/dktp/Makefile.in -+++ b/lib/libspl/include/sys/dktp/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in -index 2078025..de9db42 100644 ---- a/lib/libspl/include/sys/sysevent/Makefile.in -+++ b/lib/libspl/include/sys/sysevent/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in -index 91c91fa..d7cd17c 100644 ---- a/lib/libspl/include/util/Makefile.in -+++ b/lib/libspl/include/util/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in -index 932fb8a..f6c8690 100644 ---- a/lib/libunicode/Makefile.in -+++ b/lib/libunicode/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in -index c05c31c..d44bba2 100644 ---- a/lib/libuutil/Makefile.in -+++ b/lib/libuutil/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in -index 14db984..29642b1 100644 ---- a/lib/libzfs/Makefile.in -+++ b/lib/libzfs/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in -index 63297bc..0e46c15 100644 ---- a/lib/libzpool/Makefile.in -+++ b/lib/libzpool/Makefile.in -@@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/man/Makefile.in b/man/Makefile.in -index e6a82e9..84c6c17 100644 ---- a/man/Makefile.in -+++ b/man/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in -index 98193db..be187c9 100644 ---- a/man/man8/Makefile.in -+++ b/man/man8/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c -index 1edbd7e..a35e3b5 100644 ---- a/module/zfs/zfs_znode.c -+++ b/module/zfs/zfs_znode.c -@@ -440,7 +440,7 @@ zfs_inode_update(znode_t *zp) - ip->i_generation = zp->z_gen; - ip->i_uid = zp->z_uid; - ip->i_gid = zp->z_gid; -- ip->i_nlink = zp->z_links; -+ set_nlink(ip, zp->z_links); - ip->i_mode = zp->z_mode; - ip->i_blkbits = SPA_MINBLOCKSHIFT; - dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &blksize, -diff --git a/scripts/Makefile.in b/scripts/Makefile.in -index 966288d..5115a9e 100644 ---- a/scripts/Makefile.in -+++ b/scripts/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in -index a9ba3e7..1c59d74 100644 ---- a/scripts/zpios-profile/Makefile.in -+++ b/scripts/zpios-profile/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in -index e237411..fb11145 100644 ---- a/scripts/zpios-test/Makefile.in -+++ b/scripts/zpios-test/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in -index 1e887e6..2c4fcb9 100644 ---- a/scripts/zpool-config/Makefile.in -+++ b/scripts/zpool-config/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in -index 6106756..bebd47b 100644 ---- a/scripts/zpool-layout/Makefile.in -+++ b/scripts/zpool-layout/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/udev/Makefile.in b/udev/Makefile.in -index e1e5924..856d11a 100644 ---- a/udev/Makefile.in -+++ b/udev/Makefile.in -@@ -68,6 +68,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in -index dba7a45..37eb4c7 100644 ---- a/udev/rules.d/Makefile.in -+++ b/udev/rules.d/Makefile.in -@@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ - $(top_srcdir)/config/kernel-rq-for-each_segment.m4 \ - $(top_srcdir)/config/kernel-rq-is_sync.m4 \ - $(top_srcdir)/config/kernel-security-inode-init.m4 \ -+ $(top_srcdir)/config/kernel-set-nlink.m4 \ - $(top_srcdir)/config/kernel-truncate-setsize.m4 \ - $(top_srcdir)/config/kernel-xattr-handler.m4 \ - $(top_srcdir)/config/kernel.m4 \ -diff --git a/zfs_config.h.in b/zfs_config.h.in -index 41d7ab1..e0f7467 100644 ---- a/zfs_config.h.in -+++ b/zfs_config.h.in -@@ -153,6 +153,9 @@ - /* rq_is_sync() is available */ - #undef HAVE_RQ_IS_SYNC - -+/* set_nlink() is available */ -+#undef HAVE_SET_NLINK -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_STDINT_H - diff --git a/sys-fs/zfs/files/zfs-9999-includedir.patch b/sys-fs/zfs/files/zfs-9999-includedir.patch deleted file mode 100644 index 641c5ad..0000000 --- a/sys-fs/zfs/files/zfs-9999-includedir.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -urN zfs-0.6.0-rc3.orig/Makefile.am zfs-0.6.0-rc3/Makefile.am ---- zfs-0.6.0-rc3.orig/Makefile.am 2011-04-07 22:31:01.000000000 +0400 -+++ zfs-0.6.0-rc3/Makefile.am 2011-04-12 03:25:36.000000000 +0400 -@@ -33,9 +33,7 @@ - - if CONFIG_KERNEL - install-data-local: -- release=$(ZFS_META_VERSION)-$(ZFS_META_RELEASE); \ -- instdest=$(DESTDIR)/usr/src/zfs-$$release/$(LINUX_VERSION); \ -- echo "$$release" >$$instdest/zfs.release; \ -+ instdest=$(DESTDIR)/${includedir}/zfs-linux; \ - for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ - done diff --git a/sys-fs/zfs/files/zfs.initd b/sys-fs/zfs/files/zfs.initd deleted file mode 100644 index c9c5634..0000000 --- a/sys-fs/zfs/files/zfs.initd +++ /dev/null @@ -1,98 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/files/zfs,v 0.9 2011/04/30 10:13:43 devsk Exp $ - -depend() -{ - before net - after udev - keyword -lxc -openvz -prefix -vserver -} - -CACHEFILE=/etc/zfs/zpool.cache -ZPOOL=/usr/sbin/zpool -ZFS=/usr/sbin/zfs -ZFS_MODULE=zfs - -checksystem() { - if [ -c /dev/zfs ]; then - einfo "ZFS modules already loaded" - return 0 - else - einfo "Checking if ZFS modules present" - if [ "x$(modprobe -l $ZFS_MODULE | grep $ZFS_MODULE)" == "x" ]; then - eerror "$ZFS_MODULE not found. Is the ZFS package installed?" - return 1 - fi - fi - einfo "Checking if zfs userspace tools present" - if [ ! -x $ZPOOL ]; then - eerror "$ZPOOL binary not found." - return 1 - fi - if [ ! -x $ZFS ]; then - eerror "$ZFS binary not found." - return 1 - fi - return 0 -} - -start() { - ebegin "Starting ZFS" - checksystem || return 1 - if [ ! -c /dev/zfs ]; then - modprobe $ZFS_MODULE - rv=$? - if [ $rv -ne 0 ]; then - eerror "Failed to load the $ZFS_MODULE module, check 'dmesg|tail'." - eend $rv - return $rv - fi - fi - - # Import all pools described by the cache file, and then mount - # all filesystem based on their properties. - if [ -f $CACHEFILE ]; then - einfo "Importing ZFS pools" - # as per fedora script, import can fail if all pools are already imported - # The check for $rv makes no sense...but someday, it will work right. - $ZPOOL import -c $CACHEFILE -aN 2>/dev/null || true - rv=$? - if [ $rv -ne 0 ]; then - eerror "Failed to import not-yet imported pools." - eend $rv - return $rv - fi - fi - - einfo "Mounting ZFS filesystems" - $ZFS mount -a - rv=$? - if [ $rv -ne 0 ]; then - eerror "Failed to mount ZFS filesystems." - eend $rv - return $rv - fi - - eend 0 - return 0 -} - -stop() -{ - ebegin "Unmounting ZFS filesystems" - $ZFS umount -a - rv=$? - if [ $rv -ne 0 ]; then - eerror "Failed to umount ZFS filesystems." - fi - - eend $rv -} - -status() -{ - # show pool status and list - $ZPOOL status && echo && $ZPOOL list -} diff --git a/sys-fs/zfs/zfs-0.6.0_rc6-r2.ebuild b/sys-fs/zfs/zfs-0.6.0_rc6-r2.ebuild deleted file mode 100644 index 1f1d464..0000000 --- a/sys-fs/zfs/zfs-0.6.0_rc6-r2.ebuild +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" - -WANT_AUTOMAKE="1.11" -AT_M4DIR=./config # for aclocal called by eautoreconf -inherit eutils autotools linux-mod - -DESCRIPTION="Native ZFS for Linux" -HOMEPAGE="http://zfsonlinux.org" -SRC_URI="http://github.com/downloads/zfsonlinux/${PN}/${P/_/-}.tar.gz" - -LICENSE="CDDL GPL-2" -SLOT="0" -KEYWORDS="~amd64 -x86" -IUSE="" - -DEPEND=" - >=sys-kernel/spl-${PV} - virtual/linux-sources - " -RDEPEND=" - !sys-fs/zfs-fuse - " - -S="${WORKDIR}/${P/_/-}" - -pkg_setup() { - linux-mod_pkg_setup - kernel_is gt 2 6 32 || die "Your kernel is too old. ${CATEGORY}/${PN} need 2.6.32 or newer." - linux_config_exists || die "Your kernel sources are unconfigured." - if linux_chkconfig_present PREEMPT; then - eerror "${CATEGORY}/${PN} doesn't currently work with PREEMPT kernel." - eerror "Please look at bug https://github.com/zfsonlinux/zfs/issues/83" - die "PREEMPT kernel" - fi -} - -src_prepare() { - epatch "${FILESDIR}/${PN}-0.6.0-includedir.patch" - # Pinkbyte: patch for kernel 3.1 compatibility - epatch "${FILESDIR}/${PN}-0.6.0-kernel-3.1-compat.patch" - # Pinkbyte: patch for kernel 3.2 compatibility - epatch "${FILESDIR}/${PN}-0.6.0-kernel-3.2-compat.patch" - # - eautoreconf -} - -src_configure() { - set_arch_to_kernel - econf \ - --with-config=all \ - --with-linux="${KV_OUT_DIR}" \ - --with-linux-obj="${KV_OUT_DIR}" \ - --with-spl=/usr/include/spl \ - --with-spl-obj=/usr/include/spl/module -} - -src_compile() { - set_arch_to_kernel - default # _not_ the one from linux-mod -} - -src_install() { - emake DESTDIR="${D}" install || die 'emake install failed' - newinitd "${FILESDIR}/zfs.initd" zfs - keepdir /var/lock/zfs - # Drop unwanted files - rm -rf "${D}/usr/src" || die "removing unwanted files die" -} diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index 56efeed..0000000 --- a/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" - -WANT_AUTOMAKE="1.11" -AT_M4DIR=./config # for aclocal called by eautoreconf - -EGIT_REPO_URI="http://github.com/zfsonlinux/zfs.git" - -inherit autotools eutils git-2 linux-mod - -DESCRIPTION="Native ZFS for Linux" -HOMEPAGE="http://zfsonlinux.org/" -SRC_URI="" - -LICENSE="CDDL GPL-2" -SLOT="0" -KEYWORDS="" -IUSE="" - -DEPEND=" - >=sys-devel/spl-${PV} - virtual/linux-sources - " -RDEPEND=" - !sys-fs/zfs-fuse - " - -pkg_setup() { - linux-mod_pkg_setup - kernel_is gt 2 6 32 || die "Your kernel is too old. ${CATEGORY}/${PN} need 2.6.32 or newer." - linux_config_exists || die "Your kernel sources are unconfigured." - if linux_chkconfig_present PREEMPT; then - eerror "${CATEGORY}/${PN} doesn't currently work with PREEMPT kernel." - eerror "Please look at bug https://github.com/zfsonlinux/zfs/issues/83" - die "PREEMPT kernel" - fi -} - -src_prepare() { - epatch "${FILESDIR}"/${P}-includedir.patch - eautoreconf -} - -src_configure() { - set_arch_to_kernel - econf \ - --with-config=all \ - --with-linux="${KV_OUT_DIR}" \ - --with-linux-obj="${KV_OUT_DIR}" \ - --with-spl=/usr/include/spl \ - --with-spl-obj=/usr/include/spl/module -} - -src_compile() { - set_arch_to_kernel - default # _not_ the one from linux-mod -} - -src_install() { - emake DESTDIR="${D}" install || die 'emake install failed' - # Drop unwanted files - rm -rf "${D}/usr/src" || die "removing unwanted files die" -} diff --git a/sys-kernel/spl/Manifest b/sys-kernel/spl/Manifest deleted file mode 100644 index 1268dc6..0000000 --- a/sys-kernel/spl/Manifest +++ /dev/null @@ -1,7 +0,0 @@ -AUX spl-0.6.0-includedir.patch 1179 RMD160 cade3b696d6981b2583cc5ae8ecf614d38ef2efc SHA1 2c5ce007df75a7a8425e1a28308eefdcb29446c2 SHA256 8d05fc006348264e1633e14b73e022d482164d6cefc8d2425faffc50d2346150 -AUX spl-0.6.0-kernel-3.1-compat.patch 27063 RMD160 df1d3e67b7aba240b7e02150122715396888e83d SHA1 d2f9266741758c8b94212885dc74b115fb6c5bcb SHA256 7cb0f13b973f03907a35f81fd4b2e7f3316029ed2aa6a79522bc2a4bf5501d72 -AUX spl-0.6.0-kernel-3.2-compat.patch 9656 RMD160 e0d03d25fa80cec7ee620fa5522ce505bfa1a050 SHA1 730c79be658e48f7fdecd1c4a62fcfafafe59f53 SHA256 cb6a02de0e113f8784382811dd589da9ca9dd5af430f746b6503ebc58046189b -AUX spl-9999-includedir.patch 1165 RMD160 98219674ccbea205a3ec1de20ecfd0ca331a2537 SHA1 4d5f92617640dcdb763586f86633c894ef260fb5 SHA256 d5e7a3edabdce01cdda2dc105bafd62935f54f9cd708dcfb5b9927c6e179ecb8 -DIST spl-0.6.0-rc6.tar.gz 438215 RMD160 8acfc2f7817993f561e78e6627eab22555d8ed27 SHA1 7cdbf313ccae73b382022da408eb17d6a612dd5b SHA256 a728ec0e5db9260d48e8165d3ac6f783b17812fca7b87966fae085c9e7a48446 -EBUILD spl-0.6.0_rc6-r2.ebuild 1218 RMD160 1f4701ed12c560e1b2ded9328c12abef8003c49b SHA1 b8f5d36eaeb5665391af64f6f2d3a1dedbdc358d SHA256 c65c421f368e72cf3aab837bbf87d6bb3b0153a5fdef0ae34dea077f053aadbd -EBUILD spl-9999.ebuild 930 RMD160 f80465a36115277d860f6c931c44052578a8c97a SHA1 3962be9e632fe195cf8d069a55bf56abaf53e46a SHA256 eefd5ddf6c45d36ac39ed7e29e872064e823e87f2d895a09f6c8aaf87f1f55f2 diff --git a/sys-kernel/spl/files/spl-0.6.0-includedir.patch b/sys-kernel/spl/files/spl-0.6.0-includedir.patch deleted file mode 100644 index 37cdbf6..0000000 --- a/sys-kernel/spl/files/spl-0.6.0-includedir.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -urN spl-0.6.0-rc3.orig/include/Makefile.am spl-0.6.0-rc3/include/Makefile.am ---- spl-0.6.0-rc3.orig/include/Makefile.am 2011-04-07 22:30:50.000000000 +0400 -+++ spl-0.6.0-rc3/include/Makefile.am 2011-04-12 03:12:40.000000000 +0400 -@@ -15,8 +15,7 @@ - noinst_HEADERS += $(top_srcdir)/include/vm/*.h - - install-data-local: -- destname=spl-$(SPL_META_VERSION)/$(LINUX_VERSION); \ -- instdest=$(DESTDIR)/usr/src/$$destname; \ -+ instdest=$(DESTDIR)/${includedir}/spl; \ - instfiles=`find . -name '*.h'`; \ - for instfile in $$instfiles; do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ -diff -urN spl-0.6.0-rc3.orig/Makefile.am spl-0.6.0-rc3/Makefile.am ---- spl-0.6.0-rc3.orig/Makefile.am 2011-04-07 22:30:50.000000000 +0400 -+++ spl-0.6.0-rc3/Makefile.am 2011-04-12 03:12:22.000000000 +0400 -@@ -29,8 +29,7 @@ - - if CONFIG_KERNEL - install-data-local: -- destname=spl-$(SPL_META_VERSION)/$(LINUX_VERSION); \ -- instdest=$(DESTDIR)/usr/src/$$destname; \ -+ instdest=$(DESTDIR)/${includedir}/spl; \ - echo "$(SPL_META_VERSION)" >$$instdest/spl.release; \ - for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ diff --git a/sys-kernel/spl/files/spl-0.6.0-kernel-3.1-compat.patch b/sys-kernel/spl/files/spl-0.6.0-kernel-3.1-compat.patch deleted file mode 100644 index 8bfbeeb..0000000 --- a/sys-kernel/spl/files/spl-0.6.0-kernel-3.1-compat.patch +++ /dev/null @@ -1,926 +0,0 @@ -diff --git a/config/spl-build.m4 b/config/spl-build.m4 -index c046db8..d0bd97c 100644 ---- a/config/spl-build.m4 -+++ b/config/spl-build.m4 -@@ -68,19 +68,21 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ - SPL_AC_2ARGS_SET_FS_PWD - SPL_AC_2ARGS_VFS_UNLINK - SPL_AC_4ARGS_VFS_RENAME -+ SPL_AC_VFS_FSYNC -+ SPL_AC_2ARGS_VFS_FSYNC - SPL_AC_FS_STRUCT_SPINLOCK - SPL_AC_CRED_STRUCT - SPL_AC_GROUPS_SEARCH - SPL_AC_PUT_TASK_STRUCT - SPL_AC_5ARGS_PROC_HANDLER - SPL_AC_KVASPRINTF -- SPL_AC_3ARGS_FILE_FSYNC - SPL_AC_EXPORTED_RWSEM_IS_LOCKED - SPL_AC_KERNEL_INVALIDATE_INODES - SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES - SPL_AC_SHRINK_DCACHE_MEMORY - SPL_AC_SHRINK_ICACHE_MEMORY -- SPL_AC_KERN_PATH_PARENT -+ SPL_AC_KERN_PATH_PARENT_HEADER -+ SPL_AC_KERN_PATH_PARENT_SYMBOL - SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE - SPL_AC_SHRINK_CONTROL_STRUCT - ]) -@@ -588,6 +590,30 @@ AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], - ]) - - dnl # -+dnl # SPL_CHECK_SYMBOL_HEADER -+dnl # check if a symbol prototype is defined in listed headers. -+dnl # -+AC_DEFUN([SPL_CHECK_SYMBOL_HEADER], [ -+ AC_MSG_CHECKING([whether symbol $1 exists in header]) -+ header=0 -+ for file in $3; do -+ grep -q "$2" "$LINUX/$file" 2>/dev/null -+ rc=$? -+ if test $rc -eq 0; then -+ header=1 -+ break; -+ fi -+ done -+ if test $header -eq 0; then -+ AC_MSG_RESULT([no]) -+ $5 -+ else -+ AC_MSG_RESULT([yes]) -+ $4 -+ fi -+]) -+ -+dnl # - dnl # SPL_CHECK_HEADER - dnl # check whether header exists and define HAVE_$2_HEADER - dnl # -@@ -1693,19 +1719,30 @@ AC_DEFUN([SPL_AC_KVASPRINTF], [ - ]) - - dnl # -+dnl # 2.6.29 API change, -+dnl # vfs_fsync() funcation added, prior to this use file_fsync(). -+dnl # -+AC_DEFUN([SPL_AC_VFS_FSYNC], [ -+ SPL_CHECK_SYMBOL_EXPORT( -+ [vfs_fsync], -+ [fs/sync.c], -+ [AC_DEFINE(HAVE_VFS_FSYNC, 1, [vfs_fsync() is available])], -+ []) -+]) -+ -+dnl # - dnl # 2.6.35 API change, --dnl # Unused 'struct dentry *' removed from prototype. -+dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype. - dnl # --AC_DEFUN([SPL_AC_3ARGS_FILE_FSYNC], [ -- AC_MSG_CHECKING([whether file_fsync() wants 3 args]) -+AC_DEFUN([SPL_AC_2ARGS_VFS_FSYNC], [ -+ AC_MSG_CHECKING([whether vfs_fsync() wants 2 args]) - SPL_LINUX_TRY_COMPILE([ -- #include -+ #include - ],[ -- file_fsync(NULL, NULL, 0); -+ vfs_fsync(NULL, 0); - ],[ - AC_MSG_RESULT(yes) -- AC_DEFINE(HAVE_3ARGS_FILE_FSYNC, 1, -- [file_fsync() wants 3 args]) -+ AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args]) - ],[ - AC_MSG_RESULT(no) - ]) -@@ -1809,11 +1846,27 @@ dnl # and the flags argument has been removed. The only behavior now - dnl # offered is that of LOOKUP_PARENT. The spl already always passed - dnl # this flag so dropping the flag does not impact us. - dnl # --AC_DEFUN([SPL_AC_KERN_PATH_PARENT], [ -+AC_DEFUN([SPL_AC_KERN_PATH_PARENT_HEADER], [ -+ SPL_CHECK_SYMBOL_HEADER( -+ [kern_path_parent], -+ [int kern_path_parent(const char \*, struct nameidata \*)], -+ [include/linux/namei.h], -+ [AC_DEFINE(HAVE_KERN_PATH_PARENT_HEADER, 1, -+ [kern_path_parent() is available])], -+ []) -+]) -+ -+dnl # -+dnl # 3.1 API compat, -+dnl # The kern_path_parent() symbol is no longer exported by the kernel. -+dnl # However, it remains the prefered interface and since we still have -+dnl # access to the prototype we dynamically lookup the required address. -+dnl # -+AC_DEFUN([SPL_AC_KERN_PATH_PARENT_SYMBOL], [ - SPL_CHECK_SYMBOL_EXPORT( - [kern_path_parent], - [fs/namei.c], -- [AC_DEFINE(HAVE_KERN_PATH_PARENT, 1, -+ [AC_DEFINE(HAVE_KERN_PATH_PARENT_SYMBOL, 1, - [kern_path_parent() is available])], - []) - ]) -diff --git a/configure b/configure -index 1369ca0..901a912 100755 ---- a/configure -+++ b/configure -@@ -15067,6 +15067,112 @@ fi - - - -+ { $as_echo "$as_me:$LINENO: checking whether symbol vfs_fsync is exported" >&5 -+$as_echo_n "checking whether symbol vfs_fsync is exported... " >&6; } -+ grep -q -E '[[:space:]]vfs_fsync[[:space:]]' \ -+ $LINUX_OBJ/Module*.symvers 2>/dev/null -+ rc=$? -+ if test $rc -ne 0; then -+ export=0 -+ for file in fs/sync.c; do -+ grep -q -E "EXPORT_SYMBOL.*(vfs_fsync)" \ -+ "$LINUX_OBJ/$file" 2>/dev/null -+ rc=$? -+ if test $rc -eq 0; then -+ export=1 -+ break; -+ fi -+ done -+ if test $export -eq 0; then -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_VFS_FSYNC 1 -+_ACEOF -+ -+ fi -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_VFS_FSYNC 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ { $as_echo "$as_me:$LINENO: checking whether vfs_fsync() wants 2 args" >&5 -+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; } -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ vfs_fsync(NULL, 0); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_2ARGS_VFS_FSYNC 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether struct fs_struct uses spinlock_t" >&5 - $as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; } - tmp_flags="$EXTRA_KCFLAGS" -@@ -15391,71 +15497,6 @@ _ACEOF - - - -- { $as_echo "$as_me:$LINENO: checking whether file_fsync() wants 3 args" >&5 --$as_echo_n "checking whether file_fsync() wants 3 args... " >&6; } -- -- --cat confdefs.h - <<_ACEOF >conftest.c --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ -- -- -- #include -- --int --main (void) --{ -- -- file_fsync(NULL, NULL, 0); -- -- ; -- return 0; --} -- --_ACEOF -- -- -- rm -Rf build && mkdir -p build -- echo "obj-m := conftest.o" >build/Makefile -- if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- -- { $as_echo "$as_me:$LINENO: result: yes" >&5 --$as_echo "yes" >&6; } -- --cat >>confdefs.h <<\_ACEOF --#define HAVE_3ARGS_FILE_FSYNC 1 --_ACEOF -- -- --else -- $as_echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- { $as_echo "$as_me:$LINENO: result: no" >&5 --$as_echo "no" >&6; } -- -- -- --fi -- -- rm -Rf build -- -- -- -- - { $as_echo "$as_me:$LINENO: checking whether symbol rwsem_is_locked is exported" >&5 - $as_echo_n "checking whether symbol rwsem_is_locked is exported... " >&6; } - grep -q -E '[[:space:]]rwsem_is_locked[[:space:]]' \ -@@ -15684,6 +15725,34 @@ _ACEOF - - - -+ -+ { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent exists in header" >&5 -+$as_echo_n "checking whether symbol kern_path_parent exists in header... " >&6; } -+ header=0 -+ for file in include/linux/namei.h; do -+ grep -q "int kern_path_parent(const char \*, struct nameidata \*)" "$LINUX/$file" 2>/dev/null -+ rc=$? -+ if test $rc -eq 0; then -+ header=1 -+ break; -+ fi -+ done -+ if test $header -eq 0; then -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_KERN_PATH_PARENT_HEADER 1 -+_ACEOF -+ -+ fi -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5 - $as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; } - grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \ -@@ -15709,7 +15778,7 @@ $as_echo "no" >&6; } - $as_echo "yes" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_KERN_PATH_PARENT 1 -+#define HAVE_KERN_PATH_PARENT_SYMBOL 1 - _ACEOF - - fi -@@ -15718,7 +15787,7 @@ _ACEOF - $as_echo "yes" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_KERN_PATH_PARENT 1 -+#define HAVE_KERN_PATH_PARENT_SYMBOL 1 - _ACEOF - - fi -@@ -19268,6 +19337,112 @@ fi - - - -+ { $as_echo "$as_me:$LINENO: checking whether symbol vfs_fsync is exported" >&5 -+$as_echo_n "checking whether symbol vfs_fsync is exported... " >&6; } -+ grep -q -E '[[:space:]]vfs_fsync[[:space:]]' \ -+ $LINUX_OBJ/Module*.symvers 2>/dev/null -+ rc=$? -+ if test $rc -ne 0; then -+ export=0 -+ for file in fs/sync.c; do -+ grep -q -E "EXPORT_SYMBOL.*(vfs_fsync)" \ -+ "$LINUX_OBJ/$file" 2>/dev/null -+ rc=$? -+ if test $rc -eq 0; then -+ export=1 -+ break; -+ fi -+ done -+ if test $export -eq 0; then -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_VFS_FSYNC 1 -+_ACEOF -+ -+ fi -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_VFS_FSYNC 1 -+_ACEOF -+ -+ fi -+ -+ -+ -+ { $as_echo "$as_me:$LINENO: checking whether vfs_fsync() wants 2 args" >&5 -+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; } -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ vfs_fsync(NULL, 0); -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_2ARGS_VFS_FSYNC 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether struct fs_struct uses spinlock_t" >&5 - $as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; } - tmp_flags="$EXTRA_KCFLAGS" -@@ -19592,71 +19767,6 @@ _ACEOF - - - -- { $as_echo "$as_me:$LINENO: checking whether file_fsync() wants 3 args" >&5 --$as_echo_n "checking whether file_fsync() wants 3 args... " >&6; } -- -- --cat confdefs.h - <<_ACEOF >conftest.c --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ -- -- -- #include -- --int --main (void) --{ -- -- file_fsync(NULL, NULL, 0); -- -- ; -- return 0; --} -- --_ACEOF -- -- -- rm -Rf build && mkdir -p build -- echo "obj-m := conftest.o" >build/Makefile -- if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- -- { $as_echo "$as_me:$LINENO: result: yes" >&5 --$as_echo "yes" >&6; } -- --cat >>confdefs.h <<\_ACEOF --#define HAVE_3ARGS_FILE_FSYNC 1 --_ACEOF -- -- --else -- $as_echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- { $as_echo "$as_me:$LINENO: result: no" >&5 --$as_echo "no" >&6; } -- -- -- --fi -- -- rm -Rf build -- -- -- -- - { $as_echo "$as_me:$LINENO: checking whether symbol rwsem_is_locked is exported" >&5 - $as_echo_n "checking whether symbol rwsem_is_locked is exported... " >&6; } - grep -q -E '[[:space:]]rwsem_is_locked[[:space:]]' \ -@@ -19885,6 +19995,34 @@ _ACEOF - - - -+ -+ { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent exists in header" >&5 -+$as_echo_n "checking whether symbol kern_path_parent exists in header... " >&6; } -+ header=0 -+ for file in include/linux/namei.h; do -+ grep -q "int kern_path_parent(const char \*, struct nameidata \*)" "$LINUX/$file" 2>/dev/null -+ rc=$? -+ if test $rc -eq 0; then -+ header=1 -+ break; -+ fi -+ done -+ if test $header -eq 0; then -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ else -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_KERN_PATH_PARENT_HEADER 1 -+_ACEOF -+ -+ fi -+ -+ -+ - { $as_echo "$as_me:$LINENO: checking whether symbol kern_path_parent is exported" >&5 - $as_echo_n "checking whether symbol kern_path_parent is exported... " >&6; } - grep -q -E '[[:space:]]kern_path_parent[[:space:]]' \ -@@ -19910,7 +20048,7 @@ $as_echo "no" >&6; } - $as_echo "yes" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_KERN_PATH_PARENT 1 -+#define HAVE_KERN_PATH_PARENT_SYMBOL 1 - _ACEOF - - fi -@@ -19919,7 +20057,7 @@ _ACEOF - $as_echo "yes" >&6; } - - cat >>confdefs.h <<\_ACEOF --#define HAVE_KERN_PATH_PARENT 1 -+#define HAVE_KERN_PATH_PARENT_SYMBOL 1 - _ACEOF - - fi -diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h -index 97bd763..5c7833d 100644 ---- a/include/linux/file_compat.h -+++ b/include/linux/file_compat.h -@@ -50,12 +50,16 @@ spl_filp_open(const char *name, int flags, int mode, int *err) - #define spl_filp_poff(f) (&(f)->f_pos) - #define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p) - --#ifdef HAVE_3ARGS_FILE_FSYNC --#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), \ -- (fp)->f_dentry, sync) -+#ifdef HAVE_VFS_FSYNC -+# ifdef HAVE_2ARGS_VFS_FSYNC -+# define spl_filp_fsync(fp, sync) vfs_fsync(fp, sync) -+# else -+# define spl_filp_fsync(fp, sync) vfs_fsync(fp, (fp)->f_dentry, sync) -+# endif /* HAVE_2ARGS_VFS_FSYNC */ - #else --#define spl_filp_fsync(fp, sync) (fp)->f_op->fsync((fp), sync) --#endif -+# include -+# define spl_filp_fsync(fp, sync) file_fsync(fp, (fp)->f_dentry, sync) -+#endif /* HAVE_VFS_FSYNC */ - - #ifdef HAVE_INODE_I_MUTEX - #define spl_inode_lock(ip) (mutex_lock(&(ip)->i_mutex)) -@@ -67,11 +71,17 @@ spl_filp_open(const char *name, int flags, int mode, int *err) - #define spl_inode_unlock(ip) (up(&(ip)->i_sem)) - #endif /* HAVE_INODE_I_MUTEX */ - --#ifdef HAVE_KERN_PATH_PARENT --#define spl_kern_path_parent(path, nd) kern_path_parent(path, nd) -+#ifdef HAVE_KERN_PATH_PARENT_HEADER -+# ifndef HAVE_KERN_PATH_PARENT_SYMBOL -+typedef int (*kern_path_parent_t)(const char *, struct nameidata *); -+extern kern_path_parent_t kern_path_parent_fn; -+# define spl_kern_path_parent(path, nd) kern_path_parent_fn(path, nd) -+# else -+# define spl_kern_path_parent(path, nd) kern_path_parent(path, nd) -+# endif /* HAVE_KERN_PATH_PARENT_SYMBOL */ - #else --#define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd) --#endif /* HAVE_KERN_PATH_PARENT */ -+# define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd) -+#endif /* HAVE_KERN_PATH_PARENT_HEADER */ - - #endif /* SPL_FILE_COMPAT_H */ - -diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h -index 173acd4..b375f9b 100644 ---- a/include/linux/mm_compat.h -+++ b/include/linux/mm_compat.h -@@ -93,16 +93,37 @@ extern shrink_dcache_memory_t shrink_dcache_memory_fn; - # define shrink_dcache_memory(nr, gfp) \ - ({ \ - struct shrink_control sc = { .nr_to_scan = nr, .gfp_mask = gfp }; \ -- shrink_dcache_memory_fn(NULL, &sc); \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_dcache_memory_fn) \ -+ __ret__ = shrink_dcache_memory_fn(NULL, &sc); \ -+ \ -+ __ret__; \ - }) - # elif defined(HAVE_3ARGS_SHRINKER_CALLBACK) - typedef int (*shrink_dcache_memory_t)(struct shrinker *, int, gfp_t); - extern shrink_dcache_memory_t shrink_dcache_memory_fn; --# define shrink_dcache_memory(nr, gfp) shrink_dcache_memory_fn(NULL, nr, gfp) -+# define shrink_dcache_memory(nr, gfp) \ -+({ \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_dcache_memory_fn) \ -+ __ret__ = shrink_dcache_memory_fn(NULL, nr, gfp); \ -+ \ -+ __ret__; \ -+}) - # else - typedef int (*shrink_dcache_memory_t)(int, gfp_t); - extern shrink_dcache_memory_t shrink_dcache_memory_fn; --# define shrink_dcache_memory(nr, gfp) shrink_dcache_memory_fn(nr, gfp) -+# define shrink_dcache_memory(nr, gfp) \ -+({ \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_dcache_memory_fn) \ -+ __ret__ = shrink_dcache_memory_fn(nr, gfp); \ -+ \ -+ __ret__; \ -+}) - # endif /* HAVE_3ARGS_SHRINKER_CALLBACK */ - #endif /* HAVE_SHRINK_DCACHE_MEMORY */ - -@@ -120,16 +141,37 @@ extern shrink_icache_memory_t shrink_icache_memory_fn; - # define shrink_icache_memory(nr, gfp) \ - ({ \ - struct shrink_control sc = { .nr_to_scan = nr, .gfp_mask = gfp }; \ -- shrink_icache_memory_fn(NULL, &sc); \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_icache_memory_fn) \ -+ __ret__ = shrink_icache_memory_fn(NULL, &sc); \ -+ \ -+ __ret__; \ - }) - # elif defined(HAVE_3ARGS_SHRINKER_CALLBACK) - typedef int (*shrink_icache_memory_t)(struct shrinker *, int, gfp_t); - extern shrink_icache_memory_t shrink_icache_memory_fn; --# define shrink_icache_memory(nr, gfp) shrink_icache_memory_fn(NULL, nr, gfp) -+# define shrink_icache_memory(nr, gfp) \ -+({ \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_icache_memory_fn) \ -+ __ret__ = shrink_icache_memory_fn(NULL, nr, gfp); \ -+ \ -+ __ret__; \ -+}) - # else - typedef int (*shrink_icache_memory_t)(int, gfp_t); - extern shrink_icache_memory_t shrink_icache_memory_fn; --# define shrink_icache_memory(nr, gfp) shrink_icache_memory_fn(nr, gfp) -+# define shrink_icache_memory(nr, gfp) \ -+({ \ -+ int __ret__ = 0; \ -+ \ -+ if (shrink_icache_memory_fn) \ -+ __ret__ = shrink_icache_memory_fn(nr, gfp); \ -+ \ -+ __ret__; \ -+}) - # endif /* HAVE_3ARGS_SHRINKER_CALLBACK */ - #endif /* HAVE_SHRINK_ICACHE_MEMORY */ - -diff --git a/include/sys/vnode.h b/include/sys/vnode.h -index 36605ca..03462bd 100644 ---- a/include/sys/vnode.h -+++ b/include/sys/vnode.h -@@ -189,8 +189,9 @@ extern file_t *vn_getf(int fd); - extern void vn_releasef(int fd); - extern int vn_set_pwd(const char *filename); - --int vn_init(void); --void vn_fini(void); -+int spl_vn_init_kallsyms_lookup(void); -+int spl_vn_init(void); -+void spl_vn_fini(void); - - #define VOP_CLOSE vn_close - #define VOP_SEEK vn_seek -diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c -index 1dedf76..3f042cc 100644 ---- a/module/spl/spl-generic.c -+++ b/module/spl/spl-generic.c -@@ -561,7 +561,7 @@ __init spl_init(void) - if ((rc = spl_taskq_init())) - SGOTO(out4, rc); - -- if ((rc = vn_init())) -+ if ((rc = spl_vn_init())) - SGOTO(out5, rc); - - if ((rc = proc_init())) -@@ -594,6 +594,9 @@ __init spl_init(void) - if ((rc = spl_kmem_init_kallsyms_lookup())) - SGOTO(out10, rc); - -+ if ((rc = spl_vn_init_kallsyms_lookup())) -+ SGOTO(out10, rc); -+ - printk(KERN_NOTICE "SPL: Loaded module v%s%s, using hostid 0x%08x\n", - SPL_META_VERSION, SPL_DEBUG_STR, (unsigned int) spl_hostid); - SRETURN(rc); -@@ -606,7 +609,7 @@ out8: - out7: - proc_fini(); - out6: -- vn_fini(); -+ spl_vn_fini(); - out5: - spl_taskq_fini(); - out4: -@@ -634,7 +637,7 @@ spl_fini(void) - tsd_fini(); - kstat_fini(); - proc_fini(); -- vn_fini(); -+ spl_vn_fini(); - spl_taskq_fini(); - spl_rw_fini(); - spl_mutex_fini(); -diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c -index b3c054a..1d2fa90 100644 ---- a/module/spl/spl-kmem.c -+++ b/module/spl/spl-kmem.c -@@ -2123,21 +2123,15 @@ spl_kmem_init_kallsyms_lookup(void) - #endif /* HAVE_INVALIDATE_INODES */ - - #ifndef HAVE_SHRINK_DCACHE_MEMORY -+ /* When shrink_dcache_memory_fn == NULL support is disabled */ - shrink_dcache_memory_fn = (shrink_dcache_memory_t) -- spl_kallsyms_lookup_name("shrink_dcache_memory"); -- if (!shrink_dcache_memory_fn) { -- printk(KERN_ERR "Error: Unknown symbol shrink_dcache_memory\n"); -- return -EFAULT; -- } -+ spl_kallsyms_lookup_name("shrink_dcache_memory"); - #endif /* HAVE_SHRINK_DCACHE_MEMORY */ - - #ifndef HAVE_SHRINK_ICACHE_MEMORY -+ /* When shrink_icache_memory_fn == NULL support is disabled */ - shrink_icache_memory_fn = (shrink_icache_memory_t) -- spl_kallsyms_lookup_name("shrink_icache_memory"); -- if (!shrink_icache_memory_fn) { -- printk(KERN_ERR "Error: Unknown symbol shrink_icache_memory\n"); -- return -EFAULT; -- } -+ spl_kallsyms_lookup_name("shrink_icache_memory"); - #endif /* HAVE_SHRINK_ICACHE_MEMORY */ - - return 0; -diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c -index 354e879..cd0fa2c 100644 ---- a/module/spl/spl-vnode.c -+++ b/module/spl/spl-vnode.c -@@ -42,6 +42,13 @@ static spl_kmem_cache_t *vn_file_cache; - static DEFINE_SPINLOCK(vn_file_lock); - static LIST_HEAD(vn_file_list); - -+#ifdef HAVE_KERN_PATH_PARENT_HEADER -+#ifndef HAVE_KERN_PATH_PARENT_SYMBOL -+kern_path_parent_t kern_path_parent_fn = SYMBOL_POISON; -+EXPORT_SYMBOL(kern_path_parent_fn); -+#endif /* HAVE_KERN_PATH_PARENT_SYMBOL */ -+#endif /* HAVE_KERN_PATH_PARENT_HEADER */ -+ - vtype_t - vn_mode_to_vtype(mode_t mode) - { -@@ -789,8 +796,24 @@ vn_file_cache_destructor(void *buf, void *cdrarg) - mutex_destroy(&fp->f_lock); - } /* vn_file_cache_destructor() */ - -+int spl_vn_init_kallsyms_lookup(void) -+{ -+#ifdef HAVE_KERN_PATH_PARENT_HEADER -+#ifndef HAVE_KERN_PATH_PARENT_SYMBOL -+ kern_path_parent_fn = (kern_path_parent_t) -+ spl_kallsyms_lookup_name("kern_path_parent"); -+ if (!kern_path_parent_fn) { -+ printk(KERN_ERR "Error: Unknown symbol kern_path_parent\n"); -+ return -EFAULT; -+ } -+#endif /* HAVE_KERN_PATH_PARENT_SYMBOL */ -+#endif /* HAVE_KERN_PATH_PARENT_HEADER */ -+ -+ return (0); -+} -+ - int --vn_init(void) -+spl_vn_init(void) - { - SENTRY; - vn_cache = kmem_cache_create("spl_vn_cache", -@@ -808,7 +831,7 @@ vn_init(void) - } /* vn_init() */ - - void --vn_fini(void) -+spl_vn_fini(void) - { - file_t *fp, *next_fp; - int leaked = 0; -diff --git a/spl_config.h.in b/spl_config.h.in -index 97f0e06..08b4342 100644 ---- a/spl_config.h.in -+++ b/spl_config.h.in -@@ -18,15 +18,15 @@ - /* set_fs_pwd() wants 2 args */ - #undef HAVE_2ARGS_SET_FS_PWD - -+/* vfs_fsync() wants 2 args */ -+#undef HAVE_2ARGS_VFS_FSYNC -+ - /* vfs_unlink() wants 2 args */ - #undef HAVE_2ARGS_VFS_UNLINK - - /* zlib_deflate_workspacesize() wants 2 args */ - #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE - --/* file_fsync() wants 3 args */ --#undef HAVE_3ARGS_FILE_FSYNC -- - /* INIT_WORK wants 3 args */ - #undef HAVE_3ARGS_INIT_WORK - -@@ -115,7 +115,10 @@ - #undef HAVE_KALLSYMS_LOOKUP_NAME - - /* kern_path_parent() is available */ --#undef HAVE_KERN_PATH_PARENT -+#undef HAVE_KERN_PATH_PARENT_HEADER -+ -+/* kern_path_parent() is available */ -+#undef HAVE_KERN_PATH_PARENT_SYMBOL - - /* kmalloc_node() is available */ - #undef HAVE_KMALLOC_NODE -@@ -213,6 +216,9 @@ - /* user_path_dir() is available */ - #undef HAVE_USER_PATH_DIR - -+/* vfs_fsync() is available */ -+#undef HAVE_VFS_FSYNC -+ - /* Page state NR_ACTIVE is available */ - #undef HAVE_ZONE_STAT_ITEM_NR_ACTIVE - diff --git a/sys-kernel/spl/files/spl-0.6.0-kernel-3.2-compat.patch b/sys-kernel/spl/files/spl-0.6.0-kernel-3.2-compat.patch deleted file mode 100644 index 8fcd624..0000000 --- a/sys-kernel/spl/files/spl-0.6.0-kernel-3.2-compat.patch +++ /dev/null @@ -1,325 +0,0 @@ -diff --git a/config/spl-build.m4 b/config/spl-build.m4 -index 90ff680..27b2c42 100644 ---- a/config/spl-build.m4 -+++ b/config/spl-build.m4 -@@ -85,6 +85,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ - SPL_AC_KERN_PATH_PARENT_SYMBOL - SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE - SPL_AC_SHRINK_CONTROL_STRUCT -+ SPL_AC_RWSEM_SPINLOCK_IS_RAW - ]) - - AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ -@@ -1973,3 +1974,29 @@ AC_DEFUN([SPL_AC_SHRINK_CONTROL_STRUCT], [ - AC_MSG_RESULT(no) - ]) - ]) -+ -+dnl # -+dnl # 3.1 API Change -+dnl # -+dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to -+dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1. -+dnl # -+AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [ -+ AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw]) -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ SPL_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ struct rw_semaphore dummy_semaphore __attribute__ ((unused)); -+ raw_spinlock_t dummy_lock __attribute__ ((unused)); -+ dummy_semaphore.wait_lock = dummy_lock; -+ ],[ -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(RWSEM_SPINLOCK_IS_RAW, 1, -+ [struct rw_semaphore member wait_lock is raw_spinlock_t]) -+ ],[ -+ AC_MSG_RESULT(no) -+ ]) -+ EXTRA_KCFLAGS="$tmp_flags" -+]) -diff --git a/configure b/configure -index 9d95d76..621773d 100755 ---- a/configure -+++ b/configure -@@ -16025,6 +16025,76 @@ fi - - - -+ -+ { $as_echo "$as_me:$LINENO: checking whether struct rw_semaphore member wait_lock is raw" >&5 -+$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; } -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct rw_semaphore dummy_semaphore __attribute__ ((unused)); -+ raw_spinlock_t dummy_lock __attribute__ ((unused)); -+ dummy_semaphore.wait_lock = dummy_lock; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define RWSEM_SPINLOCK_IS_RAW 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ EXTRA_KCFLAGS="$tmp_flags" -+ - ;; - user) ;; - all) -@@ -20335,6 +20405,76 @@ fi - - - -+ { $as_echo "$as_me:$LINENO: checking whether struct rw_semaphore member wait_lock is raw" >&5 -+$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; } -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ -+ -+cat confdefs.h - <<_ACEOF >conftest.c -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ -+ #include -+ -+int -+main (void) -+{ -+ -+ struct rw_semaphore dummy_semaphore __attribute__ ((unused)); -+ raw_spinlock_t dummy_lock __attribute__ ((unused)); -+ dummy_semaphore.wait_lock = dummy_lock; -+ -+ ; -+ return 0; -+} -+ -+_ACEOF -+ -+ -+ rm -Rf build && mkdir -p build -+ echo "obj-m := conftest.o" >build/Makefile -+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ { $as_echo "$as_me:$LINENO: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+cat >>confdefs.h <<\_ACEOF -+#define RWSEM_SPINLOCK_IS_RAW 1 -+_ACEOF -+ -+ -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ { $as_echo "$as_me:$LINENO: result: no" >&5 -+$as_echo "no" >&6; } -+ -+ -+ -+fi -+ -+ rm -Rf build -+ -+ -+ EXTRA_KCFLAGS="$tmp_flags" -+ -+ - ;; - srpm) ;; - *) -diff --git a/include/linux/rwsem_compat.h b/include/linux/rwsem_compat.h -index 67a82bb..fe69f01 100644 ---- a/include/linux/rwsem_compat.h -+++ b/include/linux/rwsem_compat.h -@@ -27,6 +27,26 @@ - - #include - -+#ifdef RWSEM_SPINLOCK_IS_RAW -+#define spl_rwsem_lock_irqsave(lock, flags) \ -+({ \ -+ raw_spin_lock_irqsave(lock, flags); \ -+}) -+#define spl_rwsem_unlock_irqrestore(lock, flags) \ -+({ \ -+ raw_spin_unlock_irqrestore(lock, flags); \ -+}) -+#else -+#define spl_rwsem_lock_irqsave(lock, flags) \ -+({ \ -+ spin_lock_irqsave(lock, flags); \ -+}) -+#define spl_rwsem_unlock_irqrestore(lock, flags) \ -+({ \ -+ spin_unlock_irqrestore(lock, flags); \ -+}) -+#endif /* RWSEM_SPINLOCK_IS_RAW */ -+ - #ifdef RWSEM_IS_LOCKED_TAKES_WAIT_LOCK - /* - * A race condition in rwsem_is_locked() was fixed in Linux 2.6.33 and the fix -@@ -48,14 +68,14 @@ - - #else - --#define spl_rwsem_is_locked(rwsem) \ --({ \ -- unsigned long _flags_; \ -- int _rc_; \ -- spin_lock_irqsave(&rwsem->wait_lock, _flags_); \ -- _rc_ = rwsem_is_locked(rwsem); \ -- spin_unlock_irqrestore(&rwsem->wait_lock, _flags_); \ -- _rc_; \ -+#define spl_rwsem_is_locked(rwsem) \ -+({ \ -+ unsigned long _flags_; \ -+ int _rc_; \ -+ spl_rwsem_lock_irqsave(&rwsem->wait_lock, _flags_); \ -+ _rc_ = rwsem_is_locked(rwsem); \ -+ spl_rwsem_unlock_irqrestore(&rwsem->wait_lock, _flags_); \ -+ _rc_; \ - }) - - #endif /* RWSEM_IS_LOCKED_TAKES_WAIT_LOCK */ -diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h -index 3d98085..9d29ad6 100644 ---- a/include/sys/rwlock.h -+++ b/include/sys/rwlock.h -@@ -52,9 +52,9 @@ spl_rw_set_owner(krwlock_t *rwp) - { - unsigned long flags; - -- spin_lock_irqsave(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags); - rwp->rw_owner = current; -- spin_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); - } - - static inline void -@@ -62,9 +62,9 @@ spl_rw_clear_owner(krwlock_t *rwp) - { - unsigned long flags; - -- spin_lock_irqsave(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags); - rwp->rw_owner = NULL; -- spin_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); - } - - static inline kthread_t * -@@ -73,9 +73,9 @@ rw_owner(krwlock_t *rwp) - unsigned long flags; - kthread_t *owner; - -- spin_lock_irqsave(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags); - owner = rwp->rw_owner; -- spin_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); -+ spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags); - - return owner; - } -@@ -187,14 +187,14 @@ extern int __down_write_trylock_locked(struct rw_semaphore *); - unsigned long _flags_; \ - int _rc_ = 0; \ - \ -- spin_lock_irqsave(&SEM(rwp)->wait_lock, _flags_); \ -+ spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, _flags_); \ - if ((list_empty(&SEM(rwp)->wait_list)) && \ - (SEM(rwp)->activity == 1)) { \ - __up_read_locked(SEM(rwp)); \ - VERIFY(_rc_ = __down_write_trylock_locked(SEM(rwp))); \ - (rwp)->rw_owner = current; \ - } \ -- spin_unlock_irqrestore(&SEM(rwp)->wait_lock, _flags_); \ -+ spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, _flags_); \ - _rc_; \ - }) - #else -diff --git a/spl_config.h.in b/spl_config.h.in -index 94e28e7..847da21 100644 ---- a/spl_config.h.in -+++ b/spl_config.h.in -@@ -271,6 +271,9 @@ - /* rwsem_is_locked() acquires sem->wait_lock */ - #undef RWSEM_IS_LOCKED_TAKES_WAIT_LOCK - -+/* struct rw_semaphore member wait_lock is raw_spinlock_t */ -+#undef RWSEM_SPINLOCK_IS_RAW -+ - /* Define the project alias string. */ - #undef SPL_META_ALIAS - diff --git a/sys-kernel/spl/files/spl-9999-includedir.patch b/sys-kernel/spl/files/spl-9999-includedir.patch deleted file mode 100644 index 3fcfa91..0000000 --- a/sys-kernel/spl/files/spl-9999-includedir.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -urN spl-9999.orig/include/Makefile.am spl-9999/include/Makefile.am ---- spl-9999.orig/include/Makefile.am 2012-01-29 21:39:26.000000000 +0400 -+++ spl-9999/include/Makefile.am 2012-01-29 21:40:53.927394626 +0400 -@@ -15,8 +15,7 @@ - noinst_HEADERS += $(top_srcdir)/include/vm/*.h - - install-data-local: -- release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \ -- instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \ -+ instdest=$(DESTDIR)/${includedir}/spl; \ - instfiles=`find . -name '*.h'`; \ - for instfile in $$instfiles; do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ -diff -urN spl-9999.orig/Makefile.am spl-9999/Makefile.am ---- spl-9999.orig/Makefile.am 2012-01-29 21:39:26.000000000 +0400 -+++ spl-9999/Makefile.am 2012-01-29 21:40:35.047393124 +0400 -@@ -30,8 +30,7 @@ - - if CONFIG_KERNEL - install-data-local: -- release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \ -- instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \ -+ instdest=$(DESTDIR)/${includedir}/spl; \ - echo "$$release" >$$instdest/spl.release; \ - for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \ - $(INSTALL) -D $$instfile $$instdest/$$instfile; \ diff --git a/sys-kernel/spl/spl-0.6.0_rc6-r2.ebuild b/sys-kernel/spl/spl-0.6.0_rc6-r2.ebuild deleted file mode 100644 index 7ea06cc..0000000 --- a/sys-kernel/spl/spl-0.6.0_rc6-r2.ebuild +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" - -WANT_AUTOMAKE="1.11" -AT_M4DIR=./config # for aclocal called by eautoreconf -inherit linux-info eutils autotools - -DESCRIPTION="Solaris Porting Layer - a Linux kernel module providing some Solaris kernel APIs" -HOMEPAGE="http://zfsonlinux.org" -SRC_URI="http://github.com/downloads/zfsonlinux/${PN}/${P/_/-}.tar.gz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~amd64 -x86" -IUSE="" - -DEPEND=" - virtual/linux-sources - " -RDEPEND="" - -S="${WORKDIR}/${P/_/-}" - -src_prepare() { - epatch "${FILESDIR}"/${PN}-0.6.0-includedir.patch - # Pinkbyte: fix build issue with 3.1 kernel - epatch "${FILESDIR}"/${PN}-0.6.0-kernel-3.1-compat.patch - # Pinkbyte: add compatibility with 3.2 kernel - epatch "${FILESDIR}"/${PN}-0.6.0-kernel-3.2-compat.patch - # - eautoreconf -# cd "${WORKDIR}" -# ./autogen.sh -} - -src_configure() { - set_arch_to_kernel - econf \ - --with-config=all \ - --with-linux="${KV_OUT_DIR}" \ - --with-linux-obj="${KV_OUT_DIR}" -} - -src_install() { - emake DESTDIR="${D}" install || die 'emake install failed' - dosym /usr/include/spl/spl_config.h /usr/include/spl/module/spl_config.h \ - || die -} diff --git a/sys-kernel/spl/spl-9999.ebuild b/sys-kernel/spl/spl-9999.ebuild deleted file mode 100644 index 786fb81..0000000 --- a/sys-kernel/spl/spl-9999.ebuild +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" - -WANT_AUTOMAKE="1.11" -AT_M4DIR=./config # for aclocal called by eautoreconf -inherit git-2 linux-info eutils autotools - -DESCRIPTION="Solaris Porting Layer - a Linux kernel module providing some Solaris kernel APIs" -HOMEPAGE="http://zfsonlinux.org/" -SRC_URI="" -EGIT_REPO_URI="git://github.com/zfsonlinux/spl.git" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="" -IUSE="" - -DEPEND=" - virtual/linux-sources - " -RDEPEND="" - -src_prepare() { - epatch "${FILESDIR}"/${P}-includedir.patch - eautoreconf -} - -src_configure() { - set_arch_to_kernel - econf \ - --with-config=all \ - --with-linux="${KV_OUT_DIR}" \ - --with-linux-obj="${KV_OUT_DIR}" -} - -src_install() { - emake DESTDIR="${D}" install || die 'emake install failed' - dosym /usr/include/spl/spl_config.h /usr/include/spl/module/spl_config.h \ - || die -}