aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/fusefs-kmod/Makefile2
-rw-r--r--sysutils/fusefs-kmod/files/patch-fuse_io.c30
-rw-r--r--sysutils/fusefs-kmod/files/patch-fuse_vfsops.c63
-rw-r--r--sysutils/fusefs-kmod/files/patch-fuse_vnops.c123
4 files changed, 196 insertions, 22 deletions
diff --git a/sysutils/fusefs-kmod/Makefile b/sysutils/fusefs-kmod/Makefile
index 03bf5e1c11d..6772865b2af 100644
--- a/sysutils/fusefs-kmod/Makefile
+++ b/sysutils/fusefs-kmod/Makefile
@@ -17,13 +17,13 @@ DISTNAME= fuse4bsd-${DISTVERSION}
MAINTAINER= amistry@am-productions.biz
COMMENT= Kernel module for fuse
-USE_BZIP2= yes
BUILD_DEPENDS= fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
.if !defined(NOPORTDOCS)
BUILD_DEPENDS+= deplate:${PORTSDIR}/textproc/ruby-deplate
.endif
+USE_BZIP2= yes
MAKE_ENV= BINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man/man"
SRC_BASE?= /usr/src
diff --git a/sysutils/fusefs-kmod/files/patch-fuse_io.c b/sysutils/fusefs-kmod/files/patch-fuse_io.c
index 4d8abbd5ec2..11797d84884 100644
--- a/sysutils/fusefs-kmod/files/patch-fuse_io.c
+++ b/sysutils/fusefs-kmod/files/patch-fuse_io.c
@@ -1,6 +1,18 @@
---- fuse_module/fuse_io.c.orig Tue Jun 19 09:35:22 2007
-+++ fuse_module/fuse_io.c Thu Dec 13 02:46:05 2007
-@@ -148,7 +148,7 @@
+--- fuse_module/fuse_io.c.orig 2007-06-19 16:35:22.000000000 +0400
++++ fuse_module/fuse_io.c 2008-01-20 20:47:05.000000000 +0300
+@@ -139,7 +139,11 @@
+ struct vnode *vp = fp->f_vnode;
+ int err = 0;
+
++#if __FreeBSD_version > 800009
++ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
++#else
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
++#endif
+
+ ASSERT_VOP_LOCKED__FH(vp);
+ if (_file_is_bad(fp) || ! _file_is_fat(fp)) {
+@@ -148,7 +152,7 @@
}
if (uio->uio_resid == 0)
@@ -9,3 +21,15 @@
if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) {
if ((err = VOP_GETATTR(vp, &va, cred, td)))
+@@ -166,7 +170,11 @@
+ fp->f_nextoff = uio->uio_offset;
+
+ out:
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(vp, 0);
++#else
+ VOP_UNLOCK(vp, 0, td);
++#endif
+
+ DEBUG("leaving with %d\n", err);
+ return (err);
diff --git a/sysutils/fusefs-kmod/files/patch-fuse_vfsops.c b/sysutils/fusefs-kmod/files/patch-fuse_vfsops.c
index b57a73828ac..194a910effb 100644
--- a/sysutils/fusefs-kmod/files/patch-fuse_vfsops.c
+++ b/sysutils/fusefs-kmod/files/patch-fuse_vfsops.c
@@ -1,6 +1,6 @@
---- fuse_module/fuse_vfsops.c Sat Jul 14 13:13:55 2007
-+++ fuse_module/fuse_vfsops.c Sat Jul 14 13:13:55 2007
-@@ -23,6 +23,20 @@
+--- fuse_module/fuse_vfsops.c.orig 2007-06-19 16:35:22.000000000 +0400
++++ fuse_module/fuse_vfsops.c 2008-01-20 20:39:38.000000000 +0300
+@@ -23,6 +23,18 @@
#include "fuse_session.h"
#include "fuse_vnode.h"
@@ -8,7 +8,6 @@
+#include <sys/priv.h>
+#endif
+
-+
+/* This will do for privilege types for now */
+#ifndef PRIV_VFS_FUSE_ALLOWOTHER
+#define PRIV_VFS_FUSE_ALLOWOTHER PRIV_VFS_MOUNT_NONUSER
@@ -17,11 +16,10 @@
+#define PRIV_VFS_FUSE_MOUNT_NONUSER PRIV_VFS_MOUNT_NONUSER
+#endif
+
-+
static int fuse_init_handler(struct fuse_ticket *tick, struct uio *uio);
static void fuse_send_init(struct fuse_data *data, struct thread *td);
static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp;
-@@ -207,10 +221,8 @@ fuse_mount(struct mount *mp, struct thre
+@@ -207,10 +219,8 @@
KASSERT(fuse_useco >= 0,
("negative fuse usecount despite Giant"));
@@ -33,7 +31,7 @@
mp->mnt_flag |= MNT_SYNCHRONOUS;
/* Get the new options passed to mount */
-@@ -293,10 +305,8 @@ fuse_mount(struct mount *mp, struct thre
+@@ -293,10 +303,8 @@
if (fdata_kick_get(data))
err = ENOTCONN;
@@ -46,7 +44,7 @@
slock = &data->mhierlock;
/* Note that sx_try_xlock returns 0 on _failure_ */
-@@ -334,10 +344,9 @@ fuse_mount(struct mount *mp, struct thre
+@@ -334,10 +342,9 @@
*/
err = EINVAL;
} else {
@@ -60,4 +58,51 @@
}
if (err) {
-
+@@ -370,7 +377,11 @@
+
+ err = getnewvnode("fuse", mp, &fuse_vnops, &rvp);
+ if (! err) {
++#if __FreeBSD_version > 800009
++ err = vn_lock(rvp, LK_EXCLUSIVE | LK_RETRY);
++#else
+ err = vn_lock(rvp, LK_EXCLUSIVE | LK_RETRY, td);
++#endif
+ #if NEW_VNODES_ADJUSTED_MANUALLY
+ if (err)
+ printf("fuse4bsd: leaking vnode %p\n", rvp);
+@@ -398,7 +409,11 @@
+ free(fvdat, M_FUSEVN);
+ goto out;
+ } else
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(rvp, 0);
++#else
+ VOP_UNLOCK(rvp, 0, td);
++#endif
+
+ data->mp = mp;
+ data->mpri = FM_PRIMARY;
+@@ -582,7 +597,11 @@
+
+ vp = data->rvp;
+ vref(vp);
++#if __FreeBSD_version > 800009
++ vn_lock(vp, flags | LK_RETRY);
++#else
+ vn_lock(vp, flags | LK_RETRY, td);
++#endif
+ if (vp->v_type == VNON) {
+ struct vattr va;
+
+@@ -808,7 +827,11 @@
+ }
+
+ #if NEW_VNODES_ADJUSTED_MANUALLY
++#if __FreeBSD_version > 800009
++ err = vn_lock(*vpp, myflags);
++#else
+ err = vn_lock(*vpp, myflags, td);
++#endif
+ if (err)
+ printf("fuse4bsd: leaking vnode %p\n", *vpp);
+ else
diff --git a/sysutils/fusefs-kmod/files/patch-fuse_vnops.c b/sysutils/fusefs-kmod/files/patch-fuse_vnops.c
index a6e6b031b3a..905630bcb35 100644
--- a/sysutils/fusefs-kmod/files/patch-fuse_vnops.c
+++ b/sysutils/fusefs-kmod/files/patch-fuse_vnops.c
@@ -1,5 +1,5 @@
---- fuse_module/fuse_vnops.c Sat Jul 14 13:14:27 2007
-+++ fuse_module/fuse_vnops.c Sat Jul 14 13:14:27 2007
+--- fuse_module/fuse_vnops.c.orig 2007-06-19 16:35:22.000000000 +0400
++++ fuse_module/fuse_vnops.c 2008-01-20 20:45:28.000000000 +0300
@@ -42,6 +42,10 @@
#include "fuse_vnode.h"
#include "fuse_io.h"
@@ -11,7 +11,7 @@
/* function prototype for iterators over filehandles (of a vp) */
typedef int fuse_metrics_t(struct vnode *vp, struct thread *td,
struct ucred *cred, struct fuse_filehandle *fufh,
-@@ -63,7 +67,9 @@ struct fuse_access_param {
+@@ -63,7 +67,9 @@
#define FACCESS_CHOWN 0x08 /* do permission check for owner changing */
#define FACCESS_NOCHECKSPY 0x10 /* don't check if daemon is allowed to spy on
user */
@@ -22,7 +22,7 @@
#define FVP_ACCESS_NOOP 0x01 /* vnode based control flag for doing access check */
-@@ -855,6 +861,7 @@ fuse_access(ap)
+@@ -855,6 +861,7 @@
/*
* Attribute caching hasn't yet been implemented.
@@ -30,7 +30,7 @@
* However, within one function we don't wanna query attributes
* several times. Now it's enough pull the attributes once, and throw
* it into the following routine with various modes.
-@@ -929,12 +936,16 @@ fuse_access_i(struct vnode *vp, mode_t m
+@@ -929,12 +936,16 @@
mode == VWRITE) {
if (cred->cr_uid != facp->xuid &&
cred->cr_uid != VTOVA(vp)->va_uid)
@@ -48,7 +48,7 @@
return (err);
}
-@@ -947,10 +958,21 @@ fuse_access_i(struct vnode *vp, mode_t m
+@@ -947,10 +958,21 @@
(cred->cr_gid != facp->xgid &&
facp->xgid != (gid_t)VNOVAL &&
! groupmember(facp->xgid, cred)))
@@ -72,7 +72,7 @@
} else {
#if FUSE_HAS_ACCESS
-@@ -1234,7 +1256,13 @@ fuse_lookup(ap)
+@@ -1234,7 +1256,13 @@
*/
if (nameiop == RENAME && wantparent && islastcn) {
DEBUG("something to rename...\n");
@@ -87,7 +87,113 @@
goto out;
/*
-@@ -2948,8 +2976,14 @@ fuse_setattr(ap)
+@@ -1270,12 +1298,20 @@
+ * If doing dotdot, we unlock dvp for vget time
+ * to conform lock order regulations.
+ */
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(dvp, 0);
++#else
+ VOP_UNLOCK(dvp, 0, td);
++#endif
+ err = fuse_vget_i(dvp->v_mount, td, nid,
+ IFTOVT(fattr->mode), &vp, VG_NORMAL,
+ parentid);
+ if (flags & ISDOTDOT)
++#if __FreeBSD_version > 800009
++ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
++#else
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
++#endif
+ if (err)
+ goto out;
+ *vpp = vp;
+@@ -1540,7 +1576,11 @@
+ cache_attrs(vp, feo);
+
+ try_insert:
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(vp, 0);
++#else
+ VOP_UNLOCK(vp, 0, td);
++#endif
+ /*
+ * We can't let the vnode being vput() here, the caller wants
+ * that do by herself.
+@@ -1555,7 +1595,11 @@
+
+ #if NEW_VNODES_ADJUSTED_MANUALLY
+ if (! err) {
++#if __FreeBSD_version > 800009
++ err = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
++#else
+ err = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
++#endif
+ if (err)
+ printf("fuse4bsd: leaking vnode %p\n", vp);
+ else {
+@@ -1928,7 +1972,11 @@
+ if (! _file_is_fat(fp))
+ panic("non-fat file passed to close routine");
+
++#if __FreeBSD_version > 800009
++ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
++#else
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
++#endif
+
+ if (_file_is_bad(fp)) {
+ DEBUG2G("fp %p, vnode #%llu: went bad, giving up\n",
+@@ -2371,8 +2419,11 @@
+ */
+ if ((err = getnewvnode("fuse", dvp->v_mount, &fuse_vnops, vpp)))
+ return (err);
+-
++#if __FreeBSD_version > 800009
++ if ((err = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY))) {
++#else
+ if ((err = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread))) {
++#endif
+ #if NEW_VNODES_ADJUSTED_MANUALLY
+ printf("fuse4bsd: leaking vnode %p\n", *vpp);
+ #endif
+@@ -2719,7 +2770,11 @@
+ * No LK_RETRY. See discussion in thread
+ * http://thread.gmane.org/gmane.os.dragonfly-bsd.kernel/8952/focus=8964
+ */
++#if __FreeBSD_version > 800009
++ err = vn_lock(fvp, LK_EXCLUSIVE);
++#else
+ err = vn_lock(fvp, LK_EXCLUSIVE, td);
++#endif
+ if (err)
+ goto out;
+
+@@ -2730,7 +2785,11 @@
+ if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.')
+ || fdvp == fvp
+ || ((fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT)) {
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(fvp, 0);
++#else
+ VOP_UNLOCK(fvp, 0, td);
++#endif
+ err = EINVAL;
+ goto out;
+ }
+@@ -2748,7 +2807,11 @@
+ */
+ err = fuse_access_i(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread, &facp);
+ fnid = VTOI(fvp);
++#if __FreeBSD_version > 800009
++ VOP_UNLOCK(fvp, 0);
++#else
+ VOP_UNLOCK(fvp, 0, td);
++#endif
+ if (err)
+ goto out;
+
+@@ -2948,8 +3011,14 @@
}
if (vap->va_mode != (mode_t)VNOVAL) {
@@ -103,4 +209,3 @@
fsai->FUSEATTR(mode) = vap->va_mode & ALLPERMS;
fsai->valid |= FATTR_MODE;
}
-