From da0fe314a279d597815dc21af66fc5f144808ca4 Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Sat, 4 May 2013 12:41:15 +0000 Subject: version bump wrt #442708 (Portage version: 2.2.0_alpha171/cvs/Linux x86_64, signed Manifest commit with key F8551514) --- sys-fs/fuse4bsd/ChangeLog | 12 +- .../files/fuse4bsd-0.3.9_pre1-fbsd91.patch | 15 + .../fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch | 475 +++++++++++++++++++++ sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild | 72 ++++ 4 files changed, 571 insertions(+), 3 deletions(-) create mode 100644 sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch create mode 100644 sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch create mode 100644 sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild (limited to 'sys-fs/fuse4bsd') diff --git a/sys-fs/fuse4bsd/ChangeLog b/sys-fs/fuse4bsd/ChangeLog index c79facfa648b..6367d5f92278 100644 --- a/sys-fs/fuse4bsd/ChangeLog +++ b/sys-fs/fuse4bsd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-fs/fuse4bsd -# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/fuse4bsd/ChangeLog,v 1.5 2007/03/02 12:44:36 drizzt Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/fuse4bsd/ChangeLog,v 1.6 2013/05/04 12:41:15 naota Exp $ + +*fuse4bsd-0.3.9_pre1 (04 May 2013) + + 04 May 2013; Naohiro Aota + +files/fuse4bsd-0.3.9_pre1-fbsd91.patch, + +files/fuse4bsd-0.3.9_pre1-ports.patch, +fuse4bsd-0.3.9_pre1.ebuild: + version bump wrt #442708 02 Mar 2007; Timothy Redaelli fuse4bsd-0.3.0.ebuild: Use FreeBSD 6.2 sbin instead of 6.1. @@ -24,4 +31,3 @@ +fuse4bsd-0.3.0.ebuild: Add fuse4bsd ebuild, for FUSE's FreeBSD kernel module and userland. Ebuild by Robert Sebastian Gerus (bug #133548). - diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch new file mode 100644 index 000000000000..cc3ea70ec7af --- /dev/null +++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch @@ -0,0 +1,15 @@ +Taken from FreeBSD ports + +extra-patch-fuse_module__fuse_vnops.c + +--- fuse_module/fuse_vfsops.c.orig 2008-02-05 07:25:57.000000000 +0200 ++++ fuse_module/fuse_vfsops.c 2011-09-08 10:27:43.000000000 +0300 +@@ -224,7 +231,7 @@ + struct cdev *fdev; + struct sx *slock; + struct fuse_data *data; +- int mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0; ++ uint64_t mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0; + unsigned max_read = ~0; + struct vnode *rvp; + struct fuse_vnode_data *fvdat; diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch new file mode 100644 index 000000000000..cf4cf4441196 --- /dev/null +++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch @@ -0,0 +1,475 @@ +Taken from FreeBSD Ports + +cat sysutils/fusefs-kmod/files/patch-* > fuse4bsd-0.3.9_pre20080208-ports.patch + + +--- fuse_module/Makefile.orig 2008-02-05 08:25:57.000000000 +0300 ++++ fuse_module/Makefile 2009-01-14 00:29:13.000000000 +0300 +@@ -1,3 +1,5 @@ ++.undef KERNCONF ++ + .include "../Makefile.common" + + SRCS = fuse_main.c \ +@@ -22,7 +24,8 @@ + + .if defined(KERNCONF) + KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g' +-KERNCONFDIR= /usr/obj/usr/src/sys/${KERNCONF1} ++KRNLOBJDIR!= make -C /usr/src -f /usr/src/Makefile.inc1 -V KRNLOBJDIR ++KERNCONFDIR= ${KRNLOBJDIR}/${KERNCONF1} + .endif + + .if defined(KERNCONFDIR) +--- fuse_module/fuse.h.orig 2008-02-05 00:25:57.000000000 -0500 ++++ fuse_module/fuse.h 2009-05-13 18:40:19.000000000 -0400 +@@ -25,6 +25,22 @@ + #endif + #endif + ++#ifndef VFSOPS_TAKES_THREAD ++#if __FreeBSD_version >= 800087 ++#define VFSOPS_TAKES_THREAD 0 ++#else ++#define VFSOPS_TAKES_THREAD 1 ++#endif ++#endif ++ ++#ifndef VOP_ACCESS_TAKES_ACCMODE_T ++#if __FreeBSD_version >= 800052 ++#define VOP_ACCESS_TAKES_ACCMODE_T 1 ++#else ++#define VOP_ACCESS_TAKES_ACCMODE_T 0 ++#endif ++#endif ++ + #ifndef VOP_OPEN_TAKES_FP + #if __FreeBSD_version >= 700044 + #define VOP_OPEN_TAKES_FP 1 +@@ -49,6 +65,14 @@ + #endif + #endif + ++#ifndef VOP_GETATTR_TAKES_THREAD ++#if __FreeBSD_version >= 800046 ++#define VOP_GETATTR_TAKES_THREAD 0 ++#else ++#define VOP_GETATTR_TAKES_THREAD 1 ++#endif ++#endif ++ + #ifndef USE_PRIVILEGE_API + /* + * __FreeBSD_version bump was omitted for introduction of +--- fuse_module/fuse_dev.c ++++ fuse_module/fuse_dev.c +@@ -52,8 +52,13 @@ + .d_read = fusedev_read, + .d_write = fusedev_write, + .d_version = D_VERSION, ++#ifndef D_NEEDMINOR ++#define D_NEEDMINOR 0 ++#endif + #if ! DO_GIANT_MANUALLY +- .d_flags = D_NEEDGIANT, ++ .d_flags = D_NEEDMINOR|D_NEEDGIANT, ++#else ++ .d_flags = D_NEEDMINOR, + #endif + }; + +@@ -548,7 +553,12 @@ + /* find any existing device, or allocate new unit number */ + i = clone_create(&fuseclones, &fuse_cdevsw, &unit, dev, 0); + if (i) { +- *dev = make_dev(&fuse_cdevsw, unit2minor(unit), ++ *dev = make_dev(&fuse_cdevsw, ++#if __FreeBSD_version < 800062 ++ unit2minor(unit), ++#else /* __FreeBSD_version >= 800062 */ ++ unit, ++#endif /* __FreeBSD_version < 800062 */ + UID_ROOT, GID_OPERATOR, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, + "fuse%d", unit); +--- fuse_module/fuse_io.c.orig 2008-02-05 00:25:57.000000000 -0500 ++++ fuse_module/fuse_io.c 2009-07-13 09:31:24.000000000 -0400 +@@ -35,6 +35,10 @@ + #include + #include + ++#if (__FreeBSD_version >= 800000) ++#define vfs_bio_set_validclean vfs_bio_set_valid ++#endif ++ + #include "fuse.h" + #include "fuse_session.h" + #include "fuse_vnode.h" +@@ -157,7 +161,11 @@ + goto out; + + if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) { +- if ((err = VOP_GETATTR(vp, &va, cred, td))) ++ if ((err = VOP_GETATTR(vp, &va, cred ++#if VOP_GETATTR_TAKES_THREAD ++ , td ++#endif ++ ))) + goto out; + uio->uio_offset = va.va_size; + } else if ((flags & FOF_OFFSET) == 0) +@@ -227,7 +235,7 @@ + return (0); + + biosize = vp->v_mount->mnt_stat.f_iosize; +- bcount = min(MAXBSIZE, biosize); ++ bcount = MIN(MAXBSIZE, biosize); + + DEBUG2G("entering loop\n"); + do { +@@ -352,7 +360,7 @@ + fri = fdi.indata; + fri->fh = fufh->fh_id; + fri->offset = uio->uio_offset; +- fri->size = min(uio->uio_resid, ++ fri->size = MIN(uio->uio_resid, + fusefs_get_data(vp->v_mount)->max_read); + + DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n", +@@ -399,7 +407,7 @@ + while (uio->uio_resid > 0) { + int transfersize; + +- chunksize = min(iov->iov_len, nmax); ++ chunksize = MIN(iov->iov_len, nmax); + + if (uio->uio_rw == UIO_READ) { + struct fuse_read_in *fri; +@@ -464,7 +472,7 @@ + { + int err; + +- if ((err = uiomove(buf, min(reqsize, bufsize), uio))) ++ if ((err = uiomove(buf, MIN(reqsize, bufsize), uio))) + return (err); + + if (bufsize < reqsize) +@@ -502,7 +510,7 @@ + } + + while (uio->uio_resid > 0) { +- chunksize = min(uio->uio_resid, ++ chunksize = MIN(uio->uio_resid, + fusefs_get_data(vp->v_mount)->max_write); + + fdi.iosize = sizeof(*fwi) + chunksize; +@@ -569,7 +577,7 @@ + do { + lbn = uio->uio_offset / biosize; + on = uio->uio_offset & (biosize-1); +- n = min((unsigned)(biosize - on), uio->uio_resid); ++ n = MIN((unsigned)(biosize - on), uio->uio_resid); + + DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n", + (int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid); +@@ -739,8 +747,8 @@ + */ + if (n) { + if (bp->b_dirtyend > 0) { +- bp->b_dirtyoff = min(on, bp->b_dirtyoff); +- bp->b_dirtyend = max((on + n), bp->b_dirtyend); ++ bp->b_dirtyoff = MIN(on, bp->b_dirtyoff); ++ bp->b_dirtyend = MAX((on + n), bp->b_dirtyend); + } else { + bp->b_dirtyoff = on; + bp->b_dirtyend = on + n; +@@ -823,7 +831,11 @@ + #if FUSELIB_CONFORM_BIOREAD + struct vattr va; + +- if ((err = VOP_GETATTR(vp, &va, cred, curthread))) ++ if ((err = VOP_GETATTR(vp, &va, cred ++#if VOP_GETATTR_TAKES_THREAD ++ , curthread ++#endif ++ ))) + goto out; + #endif + +@@ -831,7 +843,7 @@ + bp->b_resid = bp->b_bcount; + while (bp->b_resid > 0) { + DEBUG2G("starting bio with resid %ld\n", bp->b_resid); +- chunksize = min(bp->b_resid, ++ chunksize = MIN(bp->b_resid, + fusefs_get_data(vp->v_mount)->max_read); + fdi.iosize = sizeof(*fri); + if (! op) +@@ -842,8 +854,8 @@ + fri->fh = fufh->fh_id; + fri->offset = ((off_t)bp->b_blkno) * biosize + ioff; + #if FUSELIB_CONFORM_BIOREAD +- chunksize = min(chunksize, +- min(fri->offset + bp->b_resid, ++ chunksize = MIN(chunksize, ++ MIN(fri->offset + bp->b_resid, + va.va_size) - fri->offset); + if (chunksize == 0) { + respsize = -1; +@@ -901,7 +913,7 @@ + + bufdat = bp->b_data + bp->b_dirtyoff; + while (bp->b_dirtyend > bp->b_dirtyoff) { +- chunksize = min(bp->b_dirtyend - bp->b_dirtyoff, ++ chunksize = MIN(bp->b_dirtyend - bp->b_dirtyoff, + fusefs_get_data(vp->v_mount)->max_write); + + fdi.iosize = sizeof(*fwi); +--- fuse_module/fuse_main.c.00 2010-08-15 14:40:29.000000000 +0400 ++++ fuse_module/fuse_main.c 2010-08-15 15:56:56.000000000 +0400 +@@ -108,6 +108,9 @@ + switch (what) { + case MOD_LOAD: /* kldload */ + ++#if __FreeBSD_version > 800009 ++ fuse_fileops.fo_truncate = vnops.fo_truncate; ++#endif + fuse_fileops.fo_ioctl = vnops.fo_ioctl; + fuse_fileops.fo_poll = vnops.fo_poll; + fuse_fileops.fo_kqfilter = vnops.fo_kqfilter; + + +--- fuse_module/fuse_vfsops.c.orig 2008-02-05 00:25:57.000000000 -0500 ++++ fuse_module/fuse_vfsops.c 2009-05-13 18:54:01.000000000 -0400 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "fuse.h" + #include "fuse_session.h" +@@ -213,8 +214,14 @@ + * Mount system call + */ + static int ++#if VFSOPS_TAKES_THREAD + fuse_mount(struct mount *mp, struct thread *td) + { ++#else ++fuse_mount(struct mount *mp) ++{ ++ struct thread *td = curthread; ++#endif + int err = 0; + size_t len; + char *fspec, *subtype = NULL; +@@ -529,8 +536,14 @@ + * Unmount system call + */ + static int ++#if VFSOPS_TAKES_THREAD + fuse_unmount(struct mount *mp, int mntflags, struct thread *td) + { ++#else ++fuse_unmount(struct mount *mp, int mntflags) ++{ ++ struct thread *td = curthread; ++#endif + int flags = 0, err = 0; + struct fuse_data *data; + struct fuse_secondary_data *fsdat = NULL; +@@ -633,8 +646,14 @@ + + /* stolen from portalfs */ + static int ++#if VFSOPS_TAKES_THREAD + fuse_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) + { ++#else ++fuse_root(struct mount *mp, int flags, struct vnode **vpp) ++{ ++ struct thread *td = curthread; ++#endif + /* + * Return locked reference to root. + */ +@@ -650,7 +669,11 @@ + data = fsdat->master; + sx_slock(&data->mhierlock); + if (data->mpri == FM_PRIMARY) +- err = fuse_root(data->mp, flags, vpp, td); ++ err = fuse_root(data->mp, flags, vpp ++#if VFSOPS_TAKES_THREAD ++ , td ++#endif ++ ); + else + err = ENXIO; + sx_sunlock(&data->mhierlock); +@@ -667,7 +690,11 @@ + if (vp->v_type == VNON) { + struct vattr va; + +- (void)VOP_GETATTR(vp, &va, td->td_ucred, td); ++ (void)VOP_GETATTR(vp, &va, td->td_ucred ++#if VOP_GETATTR_TAKES_THREAD ++ , td ++#endif ++ ); + } + *vpp = vp; + #if _DEBUG2G +@@ -678,8 +705,14 @@ + } + + static int ++#if VFSOPS_TAKES_THREAD + fuse_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) + { ++#else ++fuse_statfs(struct mount *mp, struct statfs *sbp) ++{ ++ struct thread *td = curthread; ++#endif + struct fuse_dispatcher fdi; + struct fuse_statfs_out *fsfo; + struct fuse_data *data; +@@ -696,7 +729,11 @@ + + sx_slock(&data->mhierlock); + if (data->mpri == FM_PRIMARY) +- err = fuse_statfs(data->mp, sbp, td); ++ err = fuse_statfs(data->mp, sbp ++#if VFSOPS_TAKES_THREAD ++ , td ++#endif ++ ); + else + err = ENXIO; + sx_sunlock(&data->mhierlock); +@@ -794,7 +831,11 @@ + if (nodeid == FUSE_ROOT_ID) { + if (parentid != FUSE_NULL_ID) + return (ENOENT); +- err = VFS_ROOT(mp, myflags, vpp, td); ++ err = VFS_ROOT(mp, myflags, vpp ++#if VFSOPS_TAKES_THREAD ++ , td ++#endif ++ ); + if (err) + return (err); + KASSERT(*vpp, ("we neither err'd nor found the root node")); +--- ./fuse_module/fuse_vnops.c.orig 2012-09-19 06:04:10.512413490 +0200 ++++ ./fuse_module/fuse_vnops.c 2012-09-19 06:20:44.949613892 +0200 +@@ -799,8 +799,11 @@ + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + struct ucred *cred = ap->a_cred; ++#if VOP_GETATTR_TAKES_THREAD + struct thread *td = ap->a_td; +- ++#else ++ struct thread *td = curthread; ++#endif + struct fuse_dispatcher fdi; + struct timespec uptsp; + int err = 0; +@@ -871,7 +874,11 @@ + fuse_access(ap) + struct vop_access_args /* { + struct vnode *a_vp; ++#if VOP_ACCESS_TAKES_ACCMODE_T ++ accmode_t a_accmode; ++#else + int a_mode; ++#endif + struct ucred *a_cred; + struct thread *a_td; + } */ *ap; +@@ -886,7 +893,13 @@ + else + facp.facc_flags |= FACCESS_DO_ACCESS; + +- return fuse_access_i(vp, ap->a_mode, ap->a_cred, ap->a_td, &facp); ++ return fuse_access_i(vp, ++#if VOP_ACCESS_TAKES_ACCMODE_T ++ ap->a_accmode, ++#else ++ ap->a_mode, ++#endif ++ ap->a_cred, ap->a_td, &facp); + } + + /* +@@ -946,7 +959,11 @@ + /* We are to do the check in-kernel */ + + if (! (facp->facc_flags & FACCESS_VA_VALID)) { +- err = VOP_GETATTR(vp, VTOVA(vp), cred, td); ++ err = VOP_GETATTR(vp, VTOVA(vp), cred ++#if VOP_GETATTR_TAKES_THREAD ++ , td ++#endif ++ ); + if (err) + return (err); + facp->facc_flags |= FACCESS_VA_VALID; +@@ -1544,7 +1561,7 @@ + struct fuse_vnode_data *fvdat = VTOFUD(vp); + uint64_t parentid = fvdat->parent_nid; + struct componentname *cnp = fvdat->germcnp; +- struct fuse_open_in *foi; ++ struct fuse_create_in *foi; + struct fuse_entry_out *feo; + struct fuse_mknod_in fmni; + int err; +@@ -1929,7 +1946,11 @@ + * It will not invalidate pages which are dirty, locked, under + * writeback or mapped into pagetables.") + */ ++#if VOP_GETATTR_TAKES_THREAD + err = vinvalbuf(vp, 0, td, PCATCH, 0); ++#else ++ err = vinvalbuf(vp, 0, PCATCH, 0); ++#endif + fufh->flags |= FOPEN_KEEP_CACHE; + } + +@@ -3005,8 +3026,11 @@ + struct vattr *vap = ap->a_vap; + struct vnode *vp = ap->a_vp; + struct ucred *cred = ap->a_cred; ++#if VOP_GETATTR_TAKES_THREAD + struct thread *td = ap->a_td; +- ++#else ++ struct thread *td = curthread; ++#endif + int err = 0; + struct fuse_dispatcher fdi; + struct fuse_setattr_in *fsai; +--- mount_fusefs/mount_fusefs.c 2008-02-05 07:25:57.000000000 +0200 ++++ mount_fusefs/mount_fusefs.c 2012-01-07 21:07:35.000000000 +0200 +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + + #include "fuse4bsd.h" +@@ -312,7 +313,12 @@ + * Resolve the mountpoint with realpath(3) and remove unnecessary + * slashes from the devicename if there are any. + */ ++#if __FreeBSD_version >= 1000005 ++ if (checkpath(dir, mntpath) != 0) ++ err(1, "%s", mntpath); ++#else + (void)checkpath(dir, mntpath); ++#endif + (void)rmslashes(dev, dev); + + if (strcmp(dev, "auto") == 0) diff --git a/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild b/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild new file mode 100644 index 000000000000..0229fbe191c1 --- /dev/null +++ b/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild,v 1.1 2013/05/04 12:41:15 naota Exp $ + +EAPI=5 + +inherit portability toolchain-funcs eutils flag-o-matic + +DESCRIPTION="Fuse for FreeBSD" +HOMEPAGE="http://fuse4bsd.creo.hu/" +# -sbin is needed for getmntopts.c, hardcoding 6.2 is nasty but can't think of +# any better solution right now +SRC_URI="http://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/fuse4bsd/498acaef33b0.tar.gz + mirror://gentoo/freebsd-sbin-9.1.tar.bz2" +S="${WORKDIR}/fuse4bsd-498acaef33b0" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~x86-fbsd" +IUSE="doc" + +DEPEND=">=sys-freebsd/freebsd-sources-9.1 + virtual/pmake + doc? ( app-text/deplate )" +RDEPEND="sys-fs/fuse" + +QA_TEXTRELS="boot/modules/fuse.ko" + +src_prepare() { + cp /usr/include/fuse/fuse_kernel.h fuse_module/ || die + cp "${WORKDIR}/sbin/mount/getmntopts.c" mount_fusefs/ || die + epatch "${FILESDIR}"/${P}-ports.patch + epatch "${FILESDIR}"/${P}-fbsd91.patch + sed -i -e "s:^DEPLATE=.*:DEPLATE=${EPREFIX}/usr/bin/deplate:" \ + doc/Makefile || die +} + +src_compile() { + filter-ldflags "-Wl,--hash-style=*" + tc-export CC + cd "${S}"/fuse_module + $(get_bmake) \ + KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \ + MOUNT="${WORKDIR}/sbin/mount" LDFLAGS="$(raw-ldflags)" \ + || die "$(get_bmake) failed" + + cd "${S}"/mount_fusefs + $(get_bmake) \ + KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \ + MOUNT="${WORKDIR}/sbin/mount" \ + || die "$(get_bmake) failed" + + if use doc; then + cd "${S}"/doc + $(get_bmake) all || die "$(get_bmake) failed" + fi +} + +src_install() { + dodir /boot/modules + $(get_bmake) \ + KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \ + DESTDIR="${ED}" install \ + || die "$(get_bmake) failed" + + dodoc doc/{CREDITS,README} + if use doc; then + dodoc doc/plaintext_out/* doc/pdf_out/*.pdf + docinto html + dodoc doc/html_chunked_out/* + fi +} -- cgit v1.2.3-65-gdbad