summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2012-10-17 04:57:33 +0000
committerRichard Yao <ryao@gentoo.org>2012-10-17 04:57:33 +0000
commitf3cc0a3a55feb4dec07d0bf2ec3bb6c4635a98cc (patch)
treea66d9cb61d496bba90e79e7ae8b5d86f785ea125 /sys-kernel/spl
parentRemove old. (diff)
downloadhistorical-f3cc0a3a55feb4dec07d0bf2ec3bb6c4635a98cc.tar.gz
historical-f3cc0a3a55feb4dec07d0bf2ec3bb6c4635a98cc.tar.bz2
historical-f3cc0a3a55feb4dec07d0bf2ec3bb6c4635a98cc.zip
Linux 3.6 support
Package-Manager: portage-2.1.11.9/cvs/Linux x86_64
Diffstat (limited to 'sys-kernel/spl')
-rw-r--r--sys-kernel/spl/ChangeLog8
-rw-r--r--sys-kernel/spl/Manifest4
-rw-r--r--sys-kernel/spl/files/spl-0.6.0_rc11-linux-3.6-compat.patch258
-rw-r--r--sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild92
4 files changed, 360 insertions, 2 deletions
diff --git a/sys-kernel/spl/ChangeLog b/sys-kernel/spl/ChangeLog
index a94872dc2e41..c703719cf76a 100644
--- a/sys-kernel/spl/ChangeLog
+++ b/sys-kernel/spl/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-kernel/spl
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.30 2012/10/03 00:06:36 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.31 2012/10/17 04:57:33 ryao Exp $
+
+*spl-0.6.0_rc11-r1 (17 Oct 2012)
+
+ 17 Oct 2012; Richard Yao <ryao@gentoo.org>
+ +files/spl-0.6.0_rc11-linux-3.6-compat.patch, +spl-0.6.0_rc11-r1.ebuild:
+ Linux 3.6 support
03 Oct 2012; Richard Yao <ryao@gentoo.org> spl-9999.ebuild:
Sync spl-9999.ebuild with spl-0.6.0_rc11.ebuild - thanks prometheanfire
diff --git a/sys-kernel/spl/Manifest b/sys-kernel/spl/Manifest
index 180a325abfdf..fcd8b34127fa 100644
--- a/sys-kernel/spl/Manifest
+++ b/sys-kernel/spl/Manifest
@@ -1,8 +1,10 @@
+AUX spl-0.6.0_rc11-linux-3.6-compat.patch 7545 SHA256 babec54aa933e2bf3b068f50a252dc7802a4ab6ff3815c7280c438b032c0305a SHA512 9331e989f9d78acaaeeade1c52ab5724af24ed063c4a327244c3380cc12ba6155ce55fbaa8c8a1a3e5fe662773726ef8d2768c58a7da5bec0e195198b6dfa4eb WHIRLPOOL 29b80515a9f45d232569770b18057926b183f7115d63f82572342ae3f1b97042403cdc58eea434a9ca029e9ea6aea0dd7cd66e1f6a8e97ba5d3f9a7a2fa92008
AUX spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch 2071 SHA256 d34d56201046c6464141c50c815a956e200260c4b17a057af2dde6fdb5fcf949 SHA512 8decd4a803b85b46b5c241eeb0dd7b44e0491a972b08094d763a20d5ef21624ff0bbe79e56098600702f78f506e842c8bbfc3bc94067b86531399b0ba0b4285e WHIRLPOOL 5fbe166099b10e1281e5d824e25acd7f4467766d865e6c297dd8b503906b12bc63221babb0fb6e9fade65679a8637489cec16ac3e6e14d54457c9cda858db9db
DIST spl-0.6.0-rc10.tar.gz 523189 SHA256 b25a748b18522f38b495f3577905ccd296f2782d1180140a05bd1efa19113ea0 SHA512 c5a01c9d42afcc3c4069b771fed2cbdc20d621994d2709a06057d93aeecc1b15c442cf5bce4cced90ecf7ac841f610e0b55b678e2bde8b853aeefac4402baf19 WHIRLPOOL 961edac42c35b1ecf65748eb2fc9876ed8cf1207307eedaba41a381e519589859ad5bbe468f7b94d563ec954e10c47237b4540f63a7ea211bbf9d92158f06b11
DIST spl-0.6.0-rc11.tar.gz 521190 SHA256 0f39edfb87c444781080e6f60acbd1094e3113cfc85a23d4e997fe0d53ce3a2f SHA512 d85dd2b10f98028ebc77069e63fd54241d7e8290cf81856cfb82648279e736ce108bc02b21993a87b8e8a046c3a3f37c0a3ede4cd32a4fa6be032316b47c5add WHIRLPOOL d49b863321173fa8effdaa338df4b8171e8db54f11b5f789a618ffa6abbdfcba721d2d38c59bac77786fb2d64096ed1e8f65a42f7ad2ab37a581d5e2493c05cb
EBUILD spl-0.6.0_rc10.ebuild 2173 SHA256 22f79dcb950c2e5747d0808950eb0140b57f5addb25830a51cb432f0cb0c477b SHA512 fd8b303a4b5bb34a418e59d00c396541c9655607b113ed29b5185eed74aed52b819723a5f56a7c3f0330a89f25e83c6b1f9899f26494d015f1e6129b592f03c0 WHIRLPOOL 37c213e141f6f1d08921d48944498c4e789f713e905b716c52ba73ee914ecf4d9fd2adc6921af0ad3cda754e51c534b1a1f1ac04df7b9ecfb23459e01299a03e
+EBUILD spl-0.6.0_rc11-r1.ebuild 2158 SHA256 33eeeaae00b3bcb4ccd70571743c5c971f7f75a7c2fcdb49c1e05c7e37e99077 SHA512 a60db67a05ea7b841812be0d1a97dcf499e69ca978b1181f427dfd97c776eafd63addb4e2b6b31527b74a64b3cdc09775b3818b00f8a5db31620615d893efc15 WHIRLPOOL 65283ca5dcdf4a03a7ac09baebc0b2d7ea5ec0603efb84943cb0f99a675e187a0099f6404d2a7155d72a9d9fbb904b0980c6b6de9b61805e63093189a1285ebd
EBUILD spl-0.6.0_rc11.ebuild 2083 SHA256 d7b10b5b7767cf6eac40954138a75d936927c78144f97b912d9991fcb0ca0f06 SHA512 ec387f0770bfaa8f23ba76f571e8ded8c33a909008d791b10fbc23d7fa9458f8923ec708d0662818443923c8c08920186f1519e94cfe169b6fdb101adb9eee84 WHIRLPOOL f3df9e269f70b620f5d0955ca29812eb18f9506e6a506d4f7d31e8f4ac2e6783b9a12e34037701c3a7d73a30aeb1e755780ee1e51faff3006c11cb10bb042d52
EBUILD spl-9999.ebuild 2078 SHA256 a2a38851d4edd1a04063e6b90beb370d2f9292632080e95e21cc1dfe97948fc1 SHA512 b686a18265d9f0e00b9878d7743086faae7323cd29fb2dc0aa90cf1fc119a4f95e32ef688c1e56ebb4b99c8f331ce6f9b70fafc96e91df12c753d25fb2b1a7a2 WHIRLPOOL 48e1fce6b69f4749795a256ea30a7ed96d0f13057fdc9010260266c48934e10f07535615913675b11e2b1f7d559e7727a84077b43cd0daa7fe83679508ce1224
-MISC ChangeLog 4589 SHA256 603b584dbbc5a5a3b51f299d9a9f8dd43cf4f06fde8b4e1d82e2d62675cf7b52 SHA512 a1c0fb8e80d3761dc6d24042a27616f57217bc088500f8e504f631651eb1f430fbc935bb111f87ae7e8a3d503a0a7ee9645ee3237aa42e35f3ca56780bd25d78 WHIRLPOOL f6b2fe93a94d3b6c2fb18fada3fa52b567222c84b9ca85096aac43b30aedc768878c18e4081069a884044b97a5d40c56c12a4d8f17452b2299852a576565ebd5
+MISC ChangeLog 4764 SHA256 fee2c798f241dd85bf067b0fde84f80efd1697c5639db0d054a9cd61cfc61750 SHA512 e4a94c66522aa92bb4f12420875e673088ed362bcc6162b25126a05079f0c7aa7ceb1e69aff192e99491d550b74cdc04bcfac7587482ab801779f7a42630ce9d WHIRLPOOL 15f4c55b47ad56395f87d9488b46451b7763dd56906b734d670e4b9ca61c5603d319aa254edaa21420040f409f4d3b702112ad3e02246ba6cb8edd57188ef4c0
MISC metadata.xml 228 SHA256 a317cd066ed83c5b5acf9d49869cb2f153499bb90cee389334bee9781534f5e8 SHA512 1638d4580908d32ad6fad71d109a58d699c9111d26c1073ae95b20248fc2a5da91a1f73153f01942df25c64865586e970e6532a312cd374d9866bf21264ddc54 WHIRLPOOL 11e5655c66af420e31f60d3ab19ef3ff55222271dd63bca94b548c7a63bbc73e8edfb4d80648d143c7d8315f8ba66bc4140dcf97ff85ea472e2a7cab1de98264
diff --git a/sys-kernel/spl/files/spl-0.6.0_rc11-linux-3.6-compat.patch b/sys-kernel/spl/files/spl-0.6.0_rc11-linux-3.6-compat.patch
new file mode 100644
index 000000000000..92676186c30f
--- /dev/null
+++ b/sys-kernel/spl/files/spl-0.6.0_rc11-linux-3.6-compat.patch
@@ -0,0 +1,258 @@
+From bcb15891ab394e11615eee08bba1fd85ac32e158 Mon Sep 17 00:00:00 2001
+From: Yuxuan Shui <yshuiv7@gmail.com>
+Date: Thu, 11 Oct 2012 22:41:33 +0800
+Subject: [PATCH] Linux 3.6 compat, kern_path_locked() added
+
+The kern_path_parent() function was removed from Linux 3.6 because
+it was observed that all the callers just want the parent dentry.
+The simpler kern_path_locked() function replaces kern_path_parent()
+and does the lookup while holding the ->i_mutex lock.
+
+This is good news for the vn implementation because it removes the
+need for us to handle the locking. However, it makes it harder to
+implement a single readable vn_remove()/vn_rename() function which
+is usually what we prefer.
+
+Therefore, we implement a new version of vn_remove()/vn_rename()
+for Linux 3.6 and newer kernels. This allows us to leave the
+existing working implementation untouched, and to add a simpler
+version for newer kernels.
+
+Long term I would very much like to see all of the vn code removed
+since what this code enabled is generally frowned upon in the kernel.
+But that can't happen util we either abondon the zpool.cache file
+or implement alternate infrastructure to update is correctly in
+user space.
+
+Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #154
+---
+ config/spl-build.m4 | 16 +++++
+ include/linux/file_compat.h | 6 ++
+ module/spl/spl-vnode.c | 136 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 158 insertions(+)
+
+diff --git a/config/spl-build.m4 b/config/spl-build.m4
+index 0c7a03c..eb644a1 100644
+--- a/config/spl-build.m4
++++ b/config/spl-build.m4
+@@ -86,6 +86,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
+ SPL_AC_SHRINK_ICACHE_MEMORY
+ SPL_AC_KERN_PATH_PARENT_HEADER
+ SPL_AC_KERN_PATH_PARENT_SYMBOL
++ SPL_AC_KERN_PATH_LOCKED
+ SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
+ SPL_AC_SHRINK_CONTROL_STRUCT
+ SPL_AC_RWSEM_SPINLOCK_IS_RAW
+@@ -2188,6 +2189,21 @@ AC_DEFUN([SPL_AC_KERN_PATH_PARENT_SYMBOL],
+ ])
+
+ dnl #
++dnl # 3.6 API compat,
++dnl # The kern_path_parent() function was replaced by the kern_path_locked()
++dnl # function to eliminate all struct nameidata usage outside fs/namei.c.
++dnl #
++AC_DEFUN([SPL_AC_KERN_PATH_LOCKED], [
++ SPL_CHECK_SYMBOL_HEADER(
++ [kern_path_locked],
++ [struct dentry \*kern_path_locked(const char \*, struct path \*)],
++ [include/linux/namei.h],
++ [AC_DEFINE(HAVE_KERN_PATH_LOCKED, 1,
++ [kern_path_locked() is available])],
++ [])
++])
++
++dnl #
+ dnl # 2.6.39 API compat,
+ dnl # The function zlib_deflate_workspacesize() now take 2 arguments.
+ dnl # This was done to avoid always having to allocate the maximum size
+diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h
+index 2b5b7d2..27819d5 100644
+--- a/include/linux/file_compat.h
++++ b/include/linux/file_compat.h
+@@ -83,6 +83,12 @@
+ # define spl_kern_path_parent(path, nd) path_lookup(path, LOOKUP_PARENT, nd)
+ #endif /* HAVE_KERN_PATH_PARENT_HEADER */
+
++#ifdef HAVE_KERN_PATH_LOCKED
++typedef struct dentry * (*kern_path_locked_t)(const char *, struct path *);
++extern kern_path_locked_t kern_path_locked_fn;
++# define spl_kern_path_locked(name, path) kern_path_locked_fn(name, path)
++#endif /* HAVE_KERN_PATH_LOCKED */
++
+ #ifndef HAVE_CLEAR_CLOSE_ON_EXEC
+ #define __clear_close_on_exec(fd, fdt) FD_CLR(fd, fdt->close_on_exec)
+ #endif
+diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
+index f5fc65d..a0fed32 100644
+--- a/module/spl/spl-vnode.c
++++ b/module/spl/spl-vnode.c
+@@ -50,6 +50,10 @@
+ #endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
+ #endif /* HAVE_KERN_PATH_PARENT_HEADER */
+
++#ifdef HAVE_KERN_PATH_LOCKED
++kern_path_locked_t kern_path_locked_fn = SYMBOL_POISON;
++#endif /* HAVE_KERN_PATH_LOCKED */
++
+ vtype_t
+ vn_mode_to_vtype(mode_t mode)
+ {
+@@ -298,6 +302,128 @@
+ }
+ EXPORT_SYMBOL(vn_seek);
+
++#ifdef HAVE_KERN_PATH_LOCKED
++/* Based on do_unlinkat() from linux/fs/namei.c */
++int
++vn_remove(const char *path, uio_seg_t seg, int flags)
++{
++ struct dentry *dentry;
++ struct path parent;
++ struct inode *inode = NULL;
++ int rc = 0;
++ SENTRY;
++
++ ASSERT(seg == UIO_SYSSPACE);
++ ASSERT(flags == RMFILE);
++
++ dentry = spl_kern_path_locked(path, &parent);
++ rc = PTR_ERR(dentry);
++ if (!IS_ERR(dentry)) {
++ if (parent.dentry->d_name.name[parent.dentry->d_name.len])
++ SGOTO(slashes, rc = 0);
++
++ inode = dentry->d_inode;
++ if (!inode)
++ SGOTO(slashes, rc = 0);
++
++ if (inode)
++ ihold(inode);
++
++ rc = vfs_unlink(parent.dentry->d_inode, dentry);
++exit1:
++ dput(dentry);
++ }
++
++ spl_inode_unlock(parent.dentry->d_inode);
++ if (inode)
++ iput(inode); /* truncate the inode here */
++
++ path_put(&parent);
++ SRETURN(-rc);
++
++slashes:
++ rc = !dentry->d_inode ? -ENOENT :
++ S_ISDIR(dentry->d_inode->i_mode) ? -EISDIR : -ENOTDIR;
++ SGOTO(exit1, rc);
++} /* vn_remove() */
++EXPORT_SYMBOL(vn_remove);
++
++/* Based on do_rename() from linux/fs/namei.c */
++int
++vn_rename(const char *oldname, const char *newname, int x1)
++{
++ struct dentry *old_dir, *new_dir;
++ struct dentry *old_dentry, *new_dentry;
++ struct dentry *trap;
++ struct path old_parent, new_parent;
++ int rc = 0;
++ SENTRY;
++
++ old_dentry = spl_kern_path_locked(oldname, &old_parent);
++ if (IS_ERR(old_dentry))
++ SGOTO(exit, rc = PTR_ERR(old_dentry));
++
++ spl_inode_unlock(old_parent.dentry->d_inode);
++
++ new_dentry = spl_kern_path_locked(newname, &new_parent);
++ if (IS_ERR(new_dentry))
++ SGOTO(exit2, rc = PTR_ERR(new_dentry));
++
++ spl_inode_unlock(new_parent.dentry->d_inode);
++
++ rc = -EXDEV;
++ if (old_parent.mnt != new_parent.mnt)
++ SGOTO(exit3, rc);
++
++ old_dir = old_parent.dentry;
++ new_dir = new_parent.dentry;
++ trap = lock_rename(new_dir, old_dir);
++
++ /* source should not be ancestor of target */
++ rc = -EINVAL;
++ if (old_dentry == trap)
++ SGOTO(exit4, rc);
++
++ /* target should not be an ancestor of source */
++ rc = -ENOTEMPTY;
++ if (new_dentry == trap)
++ SGOTO(exit4, rc);
++
++ /* source must exist */
++ rc = -ENOENT;
++ if (!old_dentry->d_inode)
++ SGOTO(exit4, rc);
++
++ /* unless the source is a directory trailing slashes give -ENOTDIR */
++ if (!S_ISDIR(old_dentry->d_inode->i_mode)) {
++ rc = -ENOTDIR;
++ if (old_dentry->d_name.name[old_dentry->d_name.len])
++ SGOTO(exit4, rc);
++ if (new_dentry->d_name.name[new_dentry->d_name.len])
++ SGOTO(exit4, rc);
++ }
++
++#ifdef HAVE_4ARGS_VFS_RENAME
++ rc = vfs_rename(old_dir->d_inode, old_dentry,
++ new_dir->d_inode, new_dentry);
++#else
++ rc = vfs_rename(old_dir->d_inode, old_dentry, oldnd.nd_mnt,
++ new_dir->d_inode, new_dentry, newnd.nd_mnt);
++#endif /* HAVE_4ARGS_VFS_RENAME */
++exit4:
++ unlock_rename(new_dir, old_dir);
++exit3:
++ dput(new_dentry);
++ path_put(&new_parent);
++exit2:
++ dput(old_dentry);
++ path_put(&old_parent);
++exit:
++ SRETURN(-rc);
++}
++EXPORT_SYMBOL(vn_rename);
++
++#else
+ static struct dentry *
+ vn_lookup_hash(struct nameidata *nd)
+ {
+@@ -458,6 +584,7 @@
+ SRETURN(-rc);
+ }
+ EXPORT_SYMBOL(vn_rename);
++#endif /* HAVE_KERN_PATH_LOCKED */
+
+ int
+ vn_getattr(vnode_t *vp, vattr_t *vap, int flags, void *x3, void *x4)
+@@ -862,6 +989,15 @@ int spl_vn_init_kallsyms_lookup(void)
+ #endif /* HAVE_KERN_PATH_PARENT_SYMBOL */
+ #endif /* HAVE_KERN_PATH_PARENT_HEADER */
+
++#ifdef HAVE_KERN_PATH_LOCKED
++ kern_path_locked_fn = (kern_path_locked_t)
++ spl_kallsyms_lookup_name("kern_path_locked");
++ if (!kern_path_locked_fn) {
++ printk(KERN_ERR "Error: Unknown symbol kern_path_locked\n");
++ return -EFAULT;
++ }
++#endif
++
+ return (0);
+ }
+
+--
+1.7.10
+
diff --git a/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild b/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild
new file mode 100644
index 000000000000..af7a82750022
--- /dev/null
+++ b/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild,v 1.1 2012/10/17 04:57:33 ryao Exp $
+
+EAPI="4"
+AUTOTOOLS_AUTORECONF="1"
+
+inherit flag-o-matic linux-mod autotools-utils
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-2
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/downloads/zfsonlinux/${PN}/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="|| ( GPL-2 GPL-3 )"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="test"
+
+RDEPEND="!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+pkg_setup() {
+ CONFIG_CHECK="
+ !DEBUG_LOCK_ALLOC
+ !GRKERNSEC_HIDESYM
+ MODULES
+ KALLSYMS
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 6 || die "Linux 3.6 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Workaround for hard coded path
+ sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die
+
+ # Linux 3.6 Support
+ epatch "${FILESDIR}/${P}-linux-3.6-compat.patch"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=all
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_test() {
+ if [[ ! -e /proc/modules ]]
+ then
+ die "Missing /proc/modules"
+ elif [[ $UID -ne 0 ]]
+ then
+ ewarn "Cannot run make check tests with FEATURES=userpriv."
+ ewarn "Skipping make check tests."
+ elif grep -q '^spl ' /proc/modules
+ then
+ ewarn "Cannot run make check tests with module spl loaded."
+ ewarn "Skipping make check tests."
+ else
+ autotools-utils_src_test
+ fi
+}