diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-09-05 20:10:46 +0000 |
---|---|---|
committer | Ian Stakenvicius <axs@gentoo.org> | 2013-09-05 20:10:46 +0000 |
commit | f4ea7947b300a7ade9dbe7d1ef209c2ae301570f (patch) | |
tree | 0fc04d3f18bbc083b3e18d0f8eec20c8d3de8ef3 /net-fs | |
parent | Remove older version (diff) | |
download | gentoo-2-f4ea7947b300a7ade9dbe7d1ef209c2ae301570f.tar.gz gentoo-2-f4ea7947b300a7ade9dbe7d1ef209c2ae301570f.tar.bz2 gentoo-2-f4ea7947b300a7ade9dbe7d1ef209c2ae301570f.zip |
committed revbump with patches to support 3.11 kernels, thanks to johnfg_
(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 2B6559ED)
Diffstat (limited to 'net-fs')
4 files changed, 301 insertions, 1 deletions
diff --git a/net-fs/openafs-kernel/ChangeLog b/net-fs/openafs-kernel/ChangeLog index 936b5784b64a..ae8ce9bf1ee0 100644 --- a/net-fs/openafs-kernel/ChangeLog +++ b/net-fs/openafs-kernel/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/openafs-kernel # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/ChangeLog,v 1.159 2013/09/03 13:43:45 vincent Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/ChangeLog,v 1.160 2013/09/05 20:10:46 axs Exp $ + +*openafs-kernel-1.6.5-r2 (05 Sep 2013) + + 05 Sep 2013; Ian Stakenvicius <axs@gentoo.org> + +files/openafs-1.6.5-kernel-3.11-1.patch, + +files/openafs-1.6.5-kernel-3.11-2.patch, +openafs-kernel-1.6.5-r2.ebuild: + committed revbump with patches to support 3.11 kernels, thanks to johnfg_ 03 Sep 2013; Vicente Olivert Riera <vincent@gentoo.org> openafs-kernel-1.6.5-r1.ebuild: diff --git a/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch new file mode 100644 index 000000000000..5047b1f4ecee --- /dev/null +++ b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch @@ -0,0 +1,102 @@ +From 8563077e818d62a3c764caf8818d8bf24a3cb0b6 Mon Sep 17 00:00:00 2001 +From: Marc Dionne <marc.dionne@your-file-system.com> +Date: Mon, 8 Jul 2013 10:53:00 -0400 +Subject: [PATCH] Linux 3.11: Convert from readdir to iterate file operation + +Convert the readdir function so that it can be used as the new +"iterate" file operation. This new operation is passed a context +that contains a pointer to the filldir function and the offset. +The context is passed into the new dir_emit function that will +call the function specified by the context. + +The new dir_emit function returns true on success, so we must be +careful about how we check for failure since this is different +behaviour from what filldir currently does. + +Change-Id: I6b01b4c78a501bdf4f8d583b0d3b94d677c5d541 +--- + acinclude.m4 | 1 + + src/afs/LINUX/osi_vnodeops.c | 22 ++++++++++++++++++++++ + 2 files changed, 23 insertions(+), 0 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 6ffb686..15b5ad8 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -842,6 +842,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_STRUCT([inode], [i_mutex], [fs.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h]) ++ AC_CHECK_LINUX_STRUCT([file_operations], [iterate], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h]) + AC_CHECK_LINUX_STRUCT([filename], [name], [fs.h]) +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 46fbb88..25cbac2 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -271,7 +271,11 @@ extern int BlobScan(struct dcache * afile, afs_int32 ablob); + * handling and use of bulkstats will need to be reflected here as well. + */ + static int ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++afs_linux_readdir(struct file *fp, struct dir_context *ctx) ++#else + afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) ++#endif + { + struct vcache *avc = VTOAFS(FILE_INODE(fp)); + struct vrequest treq; +@@ -350,7 +354,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + * takes an offset in units of blobs, rather than bytes. + */ + code = 0; ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ offset = ctx->pos; ++#else + offset = (int) fp->f_pos; ++#endif + while (1) { + dirpos = BlobScan(tdc, offset); + if (!dirpos) +@@ -408,7 +416,13 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + * holding the GLOCK. + */ + AFS_GUNLOCK(); ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ /* dir_emit returns a bool - true when it succeeds. ++ * Inverse the result to fit with how we check "code" */ ++ code = !dir_emit(ctx, de->name, len, ino, type); ++#else + code = (*filldir) (dirbuf, de->name, len, offset, ino, type); ++#endif + AFS_GLOCK(); + } + DRelease(&entry, 0); +@@ -419,7 +433,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + /* If filldir didn't fill in the last one this is still pointing to that + * last attempt. + */ ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ ctx->pos = (loff_t) offset; ++#else + fp->f_pos = (loff_t) offset; ++#endif + + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); +@@ -748,7 +766,11 @@ out: + + struct file_operations afs_dir_fops = { + .read = generic_read_dir, ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ .iterate = afs_linux_readdir, ++#else + .readdir = afs_linux_readdir, ++#endif + #ifdef HAVE_UNLOCKED_IOCTL + .unlocked_ioctl = afs_unlocked_xioctl, + #else +-- +1.7.2.5 + diff --git a/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch new file mode 100644 index 000000000000..3ffddf083e24 --- /dev/null +++ b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch @@ -0,0 +1,99 @@ +From 6482f944119254da9cdea533d7ca89d3d46f0559 Mon Sep 17 00:00:00 2001 +From: Marc Dionne <marc.dionne@your-file-system.com> +Date: Tue, 3 Sep 2013 07:55:14 -0400 +Subject: [PATCH] Linux 3.11: Adapt to d_count changes + +In preparation for upcoming changes in the 3.12 cycle, d_lockref +was introduced late in the 3.11 cycle. The dentry's d_lock and +d_count are moved to this new structure. A new d_lock macro makes +the change transparent for locking, but direct users of d_count +must adapt. A new d_count() helper function is provided and +should now be used. + +Use the new d_count() helper function if available, and move +some of the ifdef logic into a helper compatibility function. + +Change-Id: I32a21a174d763fb7df8f1e04da3bb7260684571d +--- + acinclude.m4 | 3 +++ + src/afs/LINUX/osi_compat.h | 28 ++++++++++++++++++++++++++++ + src/afs/LINUX/osi_vnodeops.c | 12 +----------- + 3 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 15b5ad8..800333b 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -897,6 +897,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_FUNC([d_alloc_anon], + [#include <linux/fs.h>], + [d_alloc_anon(NULL);]) ++ AC_CHECK_LINUX_FUNC([d_count], ++ [#include <linux/dcache.h>], ++ [d_count(NULL);]) + AC_CHECK_LINUX_FUNC([d_make_root], + [#include <linux/fs.h>], + [d_make_root(NULL);]) +diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h +index ce9178e..fdddf59 100644 +--- a/src/afs/LINUX/osi_compat.h ++++ b/src/afs/LINUX/osi_compat.h +@@ -608,4 +608,32 @@ afs_proc_create(char *name, umode_t mode, struct proc_dir_entry *parent, struct + #endif + } + ++static inline int ++afs_dentry_count(struct dentry *dp) ++{ ++#if defined(HAVE_LINUX_D_COUNT) ++ return d_count(dp); ++#elif defined(D_COUNT_INT) ++ return dp->d_count; ++#else ++ return atomic_read(&dp->d_count); ++#endif ++} ++ ++static inline void ++afs_maybe_shrink_dcache(struct dentry *dp) ++{ ++#if defined(HAVE_LINUX_D_COUNT) || defined(D_COUNT_INT) ++ spin_lock(&dp->d_lock); ++ if (afs_dentry_count(dp) > 1) { ++ spin_unlock(&dp->d_lock); ++ shrink_dcache_parent(dp); ++ } else ++ spin_unlock(&dp->d_lock); ++#else ++ if (afs_dentry_count(dp) > 1) ++ shrink_dcache_parent(dp); ++#endif ++} ++ + #endif /* AFS_LINUX_OSI_COMPAT_H */ +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index e9191ae..a60027e 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -1684,17 +1684,7 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, + rehash = newdp; + } + +-#if defined(D_COUNT_INT) +- spin_lock(&olddp->d_lock); +- if (olddp->d_count > 1) { +- spin_unlock(&olddp->d_lock); +- shrink_dcache_parent(olddp); +- } else +- spin_unlock(&olddp->d_lock); +-#else +- if (atomic_read(&olddp->d_count) > 1) +- shrink_dcache_parent(olddp); +-#endif ++ afs_maybe_shrink_dcache(olddp); + + AFS_GLOCK(); + code = afs_rename(VTOAFS(oldip), (char *)oldname, VTOAFS(newip), (char *)newname, credp); +-- +1.7.2.5 + diff --git a/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild b/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild new file mode 100644 index 000000000000..a99ab2698173 --- /dev/null +++ b/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild,v 1.1 2013/09/05 20:10:46 axs Exp $ + +EAPI="5" + +inherit autotools eutils multilib linux-mod versionator toolchain-funcs + +MY_PV=$(delete_version_separator '_') +MY_PN=${PN/-kernel} +MY_P2="${MY_PN}-${PV}" +MY_P="${MY_PN}-${MY_PV}" +PVER="1" +DESCRIPTION="The OpenAFS distributed file system kernel module" +HOMEPAGE="http://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +SRC_URI="http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-src.tar.bz2 + mirror://gentoo/${MY_P2}-patches-${PVER}.tar.bz2" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="" + +S=${WORKDIR}/${MY_P} + +CONFIG_CHECK="!DEBUG_RODATA ~!AFS_FS KEYS" +ERROR_DEBUG_RODATA="OpenAFS is incompatible with linux' CONFIG_DEBUG_RODATA option" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko" +QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko" + +pkg_setup() { + if use kernel_linux; then + linux-mod_pkg_setup + fi +} + +src_prepare() { + EPATCH_EXCLUDE="012_all_kbuild.patch" \ + EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}"/gentoo/patches + epatch "${FILESDIR}"/${P/-kernel/}-kernel-3.11-{1..2}.patch + + # packaging is f-ed up, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + eaclocal -I src/cf + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache +} + +src_configure() { + ARCH="$(tc-arch-kernel)" \ + econf \ + --with-linux-kernel-headers=${KV_DIR} \ + --with-linux-kernel-build=${KV_OUT_DIR} +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 -j1 only_libafs || die +} + +src_install() { + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module" + + MODULE_NAMES="libafs(fs/openafs:${srcdir})" + + linux-mod_src_install + elif use kernel_FreeBSD; then + insinto /boot/modules + doins "${S}"/src/libafs/MODLOAD/libafs.ko + fi +} + +pkg_postinst() { + # Update linker.hints file + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules" + use kernel_linux && linux-mod_pkg_postinst +} + +pkg_postrm() { + # Update linker.hints file + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules" + use kernel_linux && linux-mod_pkg_postrm +} |