[Midnightbsd-cvs] mports: sysutils/fusefs-kmod: update fusefs kernel module
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Apr 3 02:07:02 EDT 2009
Log Message:
-----------
update fusefs kernel module
Modified Files:
--------------
mports/sysutils/fusefs-kmod:
Makefile (r1.4 -> r1.5)
distinfo (r1.1 -> r1.2)
pkg-plist (r1.1 -> r1.2)
mports/sysutils/fusefs-kmod/files:
fusefs.in (r1.1 -> r1.2)
Added Files:
-----------
mports/sysutils/fusefs-kmod/files:
patch-fuse_module__Makefile (r1.1)
patch-fuse_module__fuse.h (r1.1)
patch-fuse_module__fuse_dev.c (r1.1)
patch-fuse_module__fuse_io.c (r1.1)
patch-fuse_module__fuse_vfsops.c (r1.1)
patch-fuse_module__fuse_vnops.c (r1.1)
pkg-message.in (r1.1)
setup.sh.in (r1.1)
Removed Files:
-------------
mports/sysutils/fusefs-kmod:
pkg-message
mports/sysutils/fusefs-kmod/files:
patch-fuse_module_fmaster.c
patch-fuse_module_fuse.c
patch-fuse_module_fuse.h
setup.sh
-------------- next part --------------
--- sysutils/fusefs-kmod/pkg-message
+++ /dev/null
@@ -1,11 +0,0 @@
-In order to automatically load the fuse module on startup, you need to
-set the following settings:
-
- - Set the module path in /etc/sysctl.conf:
- kern.module_path=%%MODULE_PATH%%
-
- - Add fusefs_enable="YES" to your /etc/rc.conf
-
-%%PREFIX%%/etc/rc.d/fusefs start will load the module for the first time
-after the installation. Set "sysctl vfs.usermount=1" if you want to be able
-to mount fuse devices as an ordinary user.
Index: pkg-plist
===================================================================
RCS file: /home/cvs/mports/sysutils/fusefs-kmod/pkg-plist,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/fusefs-kmod/pkg-plist -L sysutils/fusefs-kmod/pkg-plist -u -r1.1 -r1.2
--- sysutils/fusefs-kmod/pkg-plist
+++ sysutils/fusefs-kmod/pkg-plist
@@ -1,23 +1,7 @@
-modules/fuse.ko
sbin/mount_fusefs
- at unexec kldxref %D/modules
- at dirrmtry modules
-%%PORTDOCS%%%%DOCSDIR%%/kmod/doc.txt
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Implementation.html
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Quickstart.html
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/article.css
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/deplate-mini.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/deplate.css
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/doc.html
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/heading-navbar.css
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/home-grey.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/mailto.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/next-grey.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/prev-grey.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/remote.png
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/serif.css
-%%PORTDOCS%%%%DOCSDIR%%/kmod/html/tabbar-right.css
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod/html
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod
- at dirrmtry %%DOCSDIR%%
+ at exec ln -fs %D/%F /usr/sbin
+ at unexec rm -f /usr/sbin/mount_fusefs 2>&1 >/dev/null || true
+ at cwd %%KMODDIR%%
+fuse.ko
+ at unexec kldxref %%KMODDIR%%
+ at unexec rmdir %%KMODDIR%% 2>/dev/null || true
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/sysutils/fusefs-kmod/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -L sysutils/fusefs-kmod/Makefile -L sysutils/fusefs-kmod/Makefile -u -r1.4 -r1.5
--- sysutils/fusefs-kmod/Makefile
+++ sysutils/fusefs-kmod/Makefile
@@ -1,19 +1,12 @@
-# New ports collection makefile for: fusefs-kmod
-# Date created: 08 October 2005
-# Whom: Anish Mistry <amistry at am-productions.biz>
-#
# $MidnightBSD$
-# $FreeBSD: ports/sysutils/fusefs-kmod/Makefile,v 1.8 2006/08/12 21:11:12 pav Exp $
-#
PORTNAME= fusefs
-PORTVERSION= 0.3.0
-PORTREVISION= 2
-CATEGORIES= sysutils
-MASTER_SITES= http://fuse4bsd.creo.hu/downloads/ \
- http://am-productions.biz/docs/
+DISTVERSION= 0.3.9-pre1.20080208
+CATEGORIES= sysutils kld
+MASTER_SITES= http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/
PKGNAMESUFFIX= -kmod
-DISTNAME= fuse4bsd-${PORTVERSION}
+DISTNAME= ${HG_SHORTREV}
+DIST_SUBDIR= fuse4bsd
MAINTAINER= ports at MidnightBSD.org
COMMENT= Kernel module for fuse
@@ -21,17 +14,23 @@
BUILD_DEPENDS= fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
-MAKE_ENV= BINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man/man"
+FAKE_OPTS= trueprefix
-SRC_BASE?= /usr/src
-KMODDIR= ${PREFIX}/modules
-MAKE_ARGS= KMODDIR=${KMODDIR}
-MODULE_PATH= `/sbin/sysctl -n kern.module_path`;${KMODDIR}
USE_RC_SUBR= fusefs
+KMODDIR?= ${PREFIX}/modules
+PLIST_SUB= KMODDIR=${KMODDIR}
+MAKE_ENV= BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
+ KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \
+ MOUNT="${SRC_BASE}/sbin/mount"
+WRKSRC= ${WRKDIR}/fuse4bsd-${HG_SHORTREV}
+DISABLE_SIZE= yes
+
+SRC_BASE?= /usr/src
SETUP= setup.sh
+HG_SHORTREV= 498acaef33b0
MAN8= mount_fusefs.8
-TXT_DOCS= doc.txt
+TXT_DOCS= doc.text
HTML_DOCS= Faq.html \
Implementation.html \
Quickstart.html \
@@ -55,6 +54,19 @@
.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE= requires the Kernel source to be installed. Set SRC_BASE if it is not in /usr/src
.endif
+.if !exists(${SRC_BASE}/sbin/mount)
+IGNORE= requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src
+.endif
+
+.if defined(WITH_AUTOSETUP)
+SUB_FILES+= ${SETUP}
+.else
+SUB_FILES+= pkg-message
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's/deplate.rb/deplate/g' \
+ ${WRKSRC}/doc/Makefile
post-configure:
@${CP} ${LOCALBASE}/include/fuse/fuse_kernel.h ${WRKSRC}/fuse_module
@@ -63,25 +75,10 @@
@${MKDIR} ${KMODDIR}
post-install:
-.if (defined(WITH_AUTOSETUP) && !defined(BATCH) && !defined(PACKAGE_BUILDING)) \
- || (defined(WITH_AUTOSETUP) && defined(BATCH) && !defined(PACKAGE_BUILDING))
- @${SED} -e 's|@@PREFIX@@|${PREFIX}|g' \
- ${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
- @${ECHO} "Modifying global startup config files and loading module...";
- ${SH} ${WRKDIR}/${SETUP}
-.else
- @${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
- -e "s|%%MODULE_PATH%%|${MODULE_PATH}|g" ${PKGMESSAGE}
-.endif
-
-.if !defined(NOPORTDOCS)
- @${MKDIR} ${DOCSDIR}/kmod/html
-.for i in ${TXT_DOCS}
- @${INSTALL_DATA} ${WRKSRC}/doc/plaintext_out/$i ${DOCSDIR}/kmod
-.endfor
-.for i in ${HTML_DOCS}
- @${INSTALL_DATA} ${WRKSRC}/doc/html_chunked_out/$i ${DOCSDIR}/kmod/html
-.endfor
+ @${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
+.if defined(WITH_AUTOSETUP) && !defined(PACKAGE_BUILDING)
+ @${ECHO} "Modifying global startup config files and loading module..."
+ @${SH} ${WRKDIR}/${SETUP}
.endif
.include <bsd.port.post.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/mports/sysutils/fusefs-kmod/distinfo,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/fusefs-kmod/distinfo -L sysutils/fusefs-kmod/distinfo -u -r1.1 -r1.2
--- sysutils/fusefs-kmod/distinfo
+++ sysutils/fusefs-kmod/distinfo
@@ -1,3 +1,4 @@
-MD5 (fuse4bsd-0.3.0.tar.gz) = 4295afdfb53133308abb7abf21f330c8
-SHA256 (fuse4bsd-0.3.0.tar.gz) = 5ed1d9b0542d6962c135f6f2e8d296ab3feb51f239954cc6acc50833318854fe
-SIZE (fuse4bsd-0.3.0.tar.gz) = 168068
+MD5 (fuse4bsd/498acaef33b0.tar.gz) = fe90644d6bd7d05b76748422b09efc1e
+SHA256 (fuse4bsd/498acaef33b0.tar.gz) = 3fff52dc292f481b4c51cad3e9cf5f8982e38a25e809ee986e8406c81aff0119
+RMD160 (fuse4bsd/498acaef33b0.tar.gz) = 7c80d410e735c8c98ba3c96cc6a4be691a80ad58
+SIZE (fuse4bsd/498acaef33b0.tar.gz) = 116035
--- sysutils/fusefs-kmod/files/patch-fuse_module_fuse.c
+++ /dev/null
@@ -1,321 +0,0 @@
---- fuse_module/fuse.c.orig Fri Feb 10 17:31:53 2006
-+++ fuse_module/fuse.c Sun Jul 16 14:48:43 2006
-@@ -75,7 +75,7 @@
- };
-
-
--#if USE_OLD_CLONEHANDLER_API
-+#ifdef USE_OLD_CLONEHANDLER_API
- static void fusedev_clone(void *arg, char *name, int namelen, struct cdev **dev);
- #else
- static void fusedev_clone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev);
-@@ -120,7 +120,7 @@
- __static void fuse_insert_message(struct fuse_ticket *tick);
- __static fuse_handler_t fuse_standard_handler;
- static fuse_handler_t fuse_fsync_handler;
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static fuse_handler_t fuse_forgetful_handler;
- #endif
-
-@@ -852,27 +852,27 @@
- case FUSE_FSYNCDIR:
- err = blen == 0 ? 0 : EINVAL;
- break;
--#if FUSE_HAS_GETLK
-+#ifdef FUSE_HAS_GETLK
- case FUSE_GETLK:
- panic("FUSE_GETLK implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_SETLK
-+#ifdef FUSE_HAS_SETLK
- case FUSE_SETLK:
- panic("FUSE_SETLK implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_SETLKW
-+#ifdef FUSE_HAS_SETLKW
- case FUSE_SETLKW:
- panic("FUSE_SETLKW implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_ACCESS
-+#ifdef FUSE_HAS_ACCESS
- case FUSE_ACCESS:
- err = blen == 0 ? 0 : EINVAL;
- break;
- #endif
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- case FUSE_CREATE:
- err = blen == sizeof(struct fuse_entry_out) + sizeof(struct fuse_open_out) ? 0 : EINVAL;
- break;
-@@ -881,7 +881,7 @@
- panic("fuse opcodes out of sync");
- }
-
--#if _DEBUG2G
-+#ifdef _DEBUG2G
- if (err)
- DEBUG2G("op %s (#%d) with body size %d: invalid body size\n",
- (0 <= opcode && opcode <= fuse_opnames_entries) ? fuse_opnames[opcode] : "???",
-@@ -988,7 +988,7 @@
- return (0);
- }
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static int
- fuse_forgetful_handler(struct fuse_callback_node *caliban, struct uio *uio)
- {
-@@ -1242,7 +1242,7 @@
- static int
- fusedev_write(struct cdev *dev, struct uio *uio, int ioflag)
- {
--#if _DEBUG_MSGING
-+#ifdef _DEBUG_MSGING
- static int counter=0;
- #endif
- struct fuse_out_header *ohead;
-@@ -1415,7 +1415,7 @@
- if ((err = fuse_callbn_wait_answer(&fdip->tick->callbn))) {
- /* Uh-huh, we got interrupted... */
-
--#if ! DONT_TRY_HARD_PREVENT_IO_IN_VAIN
-+#ifndef DONT_TRY_HARD_PREVENT_IO_IN_VAIN
- struct fuse_callback_node *fcallbn;
- unsigned age;
- #endif
-@@ -1438,7 +1438,7 @@
- age = fdip->tick->age;
- fuse_callbn_set_answered(&fdip->tick->callbn);
- mtx_unlock(&fdip->tick->callbn.answer_mtx);
--#if ! DONT_TRY_HARD_PREVENT_IO_IN_VAIN
-+#ifndef DONT_TRY_HARD_PREVENT_IO_IN_VAIN
- /*
- * If we are willing to pay with one more locking, we
- * can save on I/O by getting the device write handler
-@@ -1662,7 +1662,7 @@
- /* static vop_pathconf_t fuse_pathconf; */
- static vfs_hash_cmp_t fuse_vnode_cmp;
- static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp;
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static vfs_hash_cmp_t fuse_vnode_fgdrop_cmp;
- #endif
- /* static vfs_vget_t fuse_vget; */
-@@ -1683,7 +1683,7 @@
- static vop_lookup_t fuse_lookup;
- static int iterate_filehandles(struct vnode *vp, struct thread *td, struct ucred *cred, fuse_metrics_t fmetr, void *param);
- static fuse_metrics_t fuse_standard_metrics;
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static __inline int create_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred, int mode, struct fuse_dispatcher *fdip);
- #endif
- static struct fuse_filehandle *get_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred, int mode, struct get_filehandle_param *gefhp);
-@@ -1729,7 +1729,7 @@
-
- static b_strategy_t fuse_bufstrategy;
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static vop_access_t fuse_germ_access;
- #endif
-
-@@ -1773,7 +1773,7 @@
- .vop_unlock = fuse_unlock,
- };
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static struct vop_vector fuse_germ_vnops;
- #endif
-
-@@ -2092,7 +2092,7 @@
-
- if (! (fmnt->mntopts & FUSEFS_SECONDARY)) {
- data->mp = mp;
--#if ! REALTIME_TRACK_UNPRIVPROCDBG
-+#ifndef REALTIME_TRACK_UNPRIVPROCDBG
- fmnt->mntopts &= ~FUSEFS_UNPRIVPROCDBG;
- fmnt->mntopts |= get_unprivileged_proc_debug(td) ? FUSEFS_UNPRIVPROCDBG : 0;
- #endif
-@@ -2380,7 +2380,7 @@
- return (0);
- }
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- /*
- * Vnode comparison function with which the given vnode always
- * gets inserted, but got marked invalid upon a clash. Caller
-@@ -2654,7 +2654,7 @@
-
- fuse_filehandle_gc(vp, td, NULL);
-
--#if ! DONT_STORE_FS_MAP
-+#ifndef DONT_STORE_FS_MAP
- /*
- * Dropping vnodes when they are not in use would mean that
- * the respective inode must be freed on the daemon's side
-@@ -2751,7 +2751,7 @@
- int denied;
-
- if ((denied = cr_candebug(
--#if REALTIME_TRACK_UNPRIVPROCDBG
-+#ifdef REALTIME_TRACK_UNPRIVPROCDBG
- get_unprivileged_proc_debug(td),
- #else
- fmnt->mntopts & FUSEFS_UNPRIVPROCDBG,
-@@ -2948,7 +2948,7 @@
-
- } else {
- struct sx *devlock = fdi.slock;
--#if FUSE_HAS_ACCESS
-+#ifdef FUSE_HAS_ACCESS
- struct fuse_access_in *fai;
-
- if (! (facp->facc_flags & FACCESS_DO_ACCESS))
-@@ -3056,7 +3056,7 @@
-
- bzero(&facp, sizeof(facp));
- if (
--#if NO_EARLY_PERM_CHECK_HACK
-+#ifdef NO_EARLY_PERM_CHECK_HACK
- 1
- #else
- dvp->v_vflag & VV_ROOT
-@@ -3281,8 +3281,12 @@
- DEBUG("we peacefully found that file\n");
-
- if (flags & ISDOTDOT) {
-- vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
-+ VOP_UNLOCK(dvp, 0, td);
-+ err = vn_lock(pdp, cnp->cn_lkflags, td);
- VREF(pdp);
-+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
-+ if (err)
-+ goto out;
- *vpp = pdp;
- } else if (nid == VTOI(dvp)) {
- VREF(dvp); /* We want ourself, ie "." */
-@@ -3347,7 +3351,7 @@
- if (islastcn && flags & ISOPEN)
- ((struct fuse_vnode_data *)(*vpp)->v_data)->flags |= FVP_ACCESS_NOOP;
-
--#if ! NO_EARLY_PERM_CHECK_HACK
-+#ifndef NO_EARLY_PERM_CHECK_HACK
- if (! islastcn) {
- /* We have the attributes of the next item
- * *now*, and it's a fact, and we do not have
-@@ -3486,7 +3490,7 @@
- return (0);
- }
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static __inline int
- create_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred,
- int mode, struct fuse_dispatcher *fdip)
-@@ -3643,7 +3647,7 @@
- * the vnode... if the vnode is a germ, it will be tried to be initialized
- * via a dedicated method, but from that on we go on as usual.)
- */
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- if (vp->v_op == &fuse_germ_vnops) {
- KASSERT(gefhp, ("create_filehandle called without get_filehandle_param"));
- gone_create = 1;
-@@ -3709,7 +3713,7 @@
- if ((err = fdisp_wait_answ(&fdi)))
- goto out;
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- setup_filehandle:
- #endif
- foo = fdi.answ;
-@@ -4184,7 +4188,7 @@
- #define BSD_FUSE_PAGENO_BOUND MIN(FUSE_MAX_PAGES_PER_REQ, MAXBSIZE / PAGE_SIZE)
-
- bcount = MIN(MAXBSIZE, biosize * BSD_FUSE_PAGENO_BOUND);
--#if BIOREAD_CONSIDER_FILE_SIZE
-+#ifdef BIOREAD_CONSIDER_FILE_SIZE
- if (vp->v_type != VDIR) {
- /*
- * for directories we can't predict the size, in fact
-@@ -4493,7 +4497,7 @@
- break;
- }
-
--#if ZERO_PAD_INCOMPLETE_BUFS
-+#ifdef ZERO_PAD_INCOMPLETE_BUFS
- if (isbzero(buf), FUSE_NAME_OFFSET) {
- err = -1;
- break;
-@@ -4658,7 +4662,7 @@
- struct vnode *dvp = ap->a_dvp;
- struct vnode **vpp = ap->a_vpp;
- struct vattr *vap = ap->a_vap;
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- struct fuse_dispatcher fdi;
- struct fuse_vnode_data *fvdat;
- int err;
-@@ -4949,7 +4953,7 @@
- if (err)
- goto out;
-
--#if ! DONT_DO_CHECKPATH
-+#ifndef DONT_DO_CHECKPATH
- if (doingdirectory && fdvp != tdvp) {
- /*
- * Check for pathname conflict.
-@@ -5741,7 +5745,7 @@
- chunksize, (long long unsigned)fri->offset, respsize);
-
- if (respsize < chunksize) {
--#if ZERO_PAD_INCOMPLETE_BUFS
-+#ifdef ZERO_PAD_INCOMPLETE_BUFS
- /*
- * "if we don't get enough data, just fill the
- * rest with zeros."
-@@ -5888,7 +5892,7 @@
- "vp=%p, rc=%d", bp, vp, rc));
- }
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- static int
- fuse_germ_access(struct vop_access_args *ap)
- {
-@@ -5908,7 +5912,7 @@
-
- /* Modeled after tunclone() of net/if_tun.c
- */
--#if USE_OLD_CLONEHANDLER_API
-+#ifdef USE_OLD_CLONEHANDLER_API
- static void
- fusedev_clone(void *arg, char *name, int namelen, struct cdev **dev)
- #else
-@@ -6019,7 +6023,7 @@
- fuse_fileops.fo_close = fuse_close_f;
- fuse_fileops.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE;
-
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- memcpy(&fuse_germ_vnops, &dead_vnodeops, sizeof(struct vop_vector));
- fuse_germ_vnops.vop_access = fuse_germ_access;
- fuse_germ_vnops.vop_open = fuse_open;
---- fuse_module/fuse.c.orig Thu Aug 3 02:08:04 2006
-+++ fuse_module/fuse.c Thu Aug 3 02:08:35 2006
-@@ -904,7 +904,7 @@
- uint64_t nid, enum fuse_opcode op, size_t blen,
- struct thread* td, struct ucred *cred)
- {
-- ihead->len = sizeof(ihead) + blen; /* actually not used by lib */
-+ ihead->len = sizeof(*ihead) + blen; /* actually not used by lib */
- ihead->unique = tick->unique;
- ihead->nodeid = nid;
- ihead->opcode = op;
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vfsops.c
@@ -0,0 +1,23 @@
+--- fuse_module/fuse_vfsops.c.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse_vfsops.c 2008-09-26 12:53:33.000000000 -0400
+@@ -18,6 +18,7 @@
+ #include <sys/namei.h>
+ #include <sys/mount.h>
+ #include <sys/sysctl.h>
++#include <sys/fcntl.h>
+
+ #include "fuse.h"
+ #include "fuse_session.h"
+@@ -667,7 +668,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
--- /dev/null
+++ sysutils/fusefs-kmod/files/setup.sh.in
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Automatically setup the loading of the module without polluting /boot/modules
+SYSCTL_CONFIG=/etc/sysctl.conf
+LOADER_CONFIG=/etc/rc.conf
+
+sysctl kern.module_path | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 1 ]; then
+ MODULE_PATH="`sysctl -n kern.module_path`;%%PREFIX%%/modules"
+ sysctl "kern.module_path=${MODULE_PATH}"
+else
+ MODULE_PATH=`sysctl -n kern.module_path`
+fi
+
+grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 0 ]; then
+ # Variable present
+ grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
+ if [ ${RESULT} -eq 1 ]; then
+ # Not present in variable, so add
+ ESC_PREFIX=`echo '%%PREFIX%%' | sed -e 's/\//\\\\\//g'`
+ sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
+ fi
+else
+ # Not present.
+ echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
+fi
+
+
+kldstat -n fuse > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 0 ]; then
+ kldunload -n fuse > /dev/null 2>&1; RESULT=$?
+ if [ ${RESULT} -ne 0 ]; then
+ echo 'NOTICE: Failed to unload the Fuse module!'
+ echo 'NOTICE: Is fuse.ko in use?'
+ fi
+fi
+
+grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 0 ]; then
+ # Present, we should leave it alone
+# sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
+else
+ # Not present. First time install, so lets start it up
+ echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
+fi
+
+kldload fuse > /dev/null 2>&1 ; RESULT=$?
+if [ ${RESULT} -ne 0 ]; then
+ echo 'NOTICE: Failed to load the Fuse module!'
+ echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
+fi
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse.h
@@ -0,0 +1,32 @@
+--- fuse_module/fuse.h.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse.h 2008-10-29 19:18:43.000000000 -0400
+@@ -25,6 +25,14 @@
+ #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 +57,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
--- sysutils/fusefs-kmod/files/patch-fuse_module_fuse.h
+++ /dev/null
@@ -1,112 +0,0 @@
---- fuse_module/fuse.h.orig Fri Feb 10 17:31:53 2006
-+++ fuse_module/fuse.h Sun Jul 16 14:43:20 2006
-@@ -8,7 +8,7 @@
-
- #ifndef USE_OLD_CLONEHANDLER_API
- #if __FreeBSD_version < 600034 || ( __FreeBSD_version >= 700000 && __FreeBSD_version < 700002 )
--#define USE_OLD_CLONEHANDLER_API 1
-+#define USE_OLD_CLONEHANDLER_API
- #endif
- #endif
-
-@@ -19,10 +19,10 @@
- */
- #if FUSE_KERNELABI_GEQ(7, 3)
- #ifndef FUSE_HAS_ACCESS
--#define FUSE_HAS_ACCESS 1
-+#define FUSE_HAS_ACCESS
- #endif
- #ifndef FUSE_HAS_CREATE
--#define FUSE_HAS_CREATE 1
-+#define FUSE_HAS_CREATE
- #endif
- #endif
-
-@@ -75,7 +75,7 @@
- size_t len; /* To keep track of size of the data pushed into base, =< len, of course */
- };
-
--#if ! FUSE_AUX
-+#ifndef FUSE_AUX
- #ifndef FUSE_MAX_STORED_FREE_TICKETS
- #define FUSE_MAX_STORED_FREE_TICKETS 0
- #endif
-@@ -251,7 +251,7 @@
- int flags;
- LIST_HEAD(, fuse_filehandle) fh_head;
- int fh_counter;
--#if FUSE_HAS_CREATE
-+#ifdef FUSE_HAS_CREATE
- struct componentname *germcnp;
- #endif
- };
-@@ -260,6 +260,9 @@
-
- /* Debug related stuff */
-
-+#ifndef DEBUGTOLOG
-+#define DEBUGTOLOG 0
-+#endif
- #if DEBUGTOLOG
- #define dprintf(args ...) log(LOG_DEBUG, args)
- #else
-@@ -267,6 +270,9 @@
- #endif
-
- #define DEBLABEL "[fuse-debug] "
-+#ifndef _DEBUG
-+#define _DEBUG 0
-+#endif
- #if _DEBUG
- #ifndef _DEBUG2G
- #define _DEBUG2G 1
-@@ -280,6 +286,9 @@
- #define DEBUG(args ...)
- #endif
-
-+#ifndef _DEBUG2G
-+#define _DEBUG2G 0
-+#endif
- #if _DEBUG2G
- #ifndef _DEBUG3G
- #define _DEBUG3G 1
-@@ -290,6 +299,9 @@
- #define DEBUG2G(args ...)
- #endif
-
-+#ifndef _DEBUG3G
-+#define _DEBUG3G 0
-+#endif
- #if _DEBUG3G
- #define DEBUG3G(args, ...) \
- printf(DEBLABEL "%s:%d: " args, __func__, __LINE__, ## __VA_ARGS__)
-@@ -297,13 +309,19 @@
- #define DEBUG3G(args ...)
- #endif
-
-+#ifndef FMASTER
-+#define FMASTER 0
-+#endif
- #if FMASTER
- #ifndef _DEBUG_MSGING
- #define _DEBUG_MSGING 1
- #endif
- #endif
-
--#if _DEBUG_MSGING
-+#ifndef _DEBUG_MSG
-+#define _DEBUG_MSG 0
-+#endif
-+#ifdef _DEBUG_MSGING
- #define fuprintf(args...) \
- uprintf("[kern] " args)
- #else
-@@ -319,7 +337,7 @@
- void fprettyprint(struct fuse_iov *fiov, size_t dlen);
- #endif
-
--#if IGNORE_INLINE
-+#ifdef IGNORE_INLINE
- #define __inline
- #endif
-
--- sysutils/fusefs-kmod/files/setup.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-# $MidnightBSD: mports/sysutils/fusefs-kmod/files/setup.sh,v 1.2 2007/07/29 21:54:11 laffer1 Exp $
-# Automatically setup the loading of the module without polluting /boot/modules
-SYSCTL_CONFIG=/etc/sysctl.conf
-LOADER_CONFIG=/etc/rc.conf
-
-sysctl kern.module_path | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
-if [ ${RESULT} -eq 1 ]; then
- MODULE_PATH="`sysctl -n kern.module_path`;@@PREFIX@@/modules"
- sysctl "kern.module_path=${MODULE_PATH}"
-else
- MODULE_PATH=`sysctl -n kern.module_path`
-fi
-
-grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
-if [ ${RESULT} -eq 0 ]; then
- # Variable present
- grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
- if [ ${RESULT} -eq 1 ]; then
- # Not present in variable, so add
- ESC_PREFIX=`echo '@@PREFIX@@' | sed -e 's/\//\\\\\//g'`
- sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
- fi
-else
- # Not present.
- echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
-fi
-
-
-kldstat -n fuse > /dev/null 2>&1; RESULT=$?
-if [ ${RESULT} -eq 0 ]; then
- kldunload -n fuse > /dev/null 2>&1; RESULT=$?
- if [ ${RESULT} -ne 0 ]; then
- echo 'NOTICE: Failed to unload the Fuse module!'
- echo 'NOTICE: Is fuse.ko in use?'
- fi
-fi
-
-grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
-if [ ${RESULT} -eq 0 ]; then
- # Present, we should leave it alone
-# sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
-else
- # Not present. First time install, so lets start it up
- echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
-fi
-
-@@PREFIX@@/etc/rc.d/fusefs start > /dev/null 2>&1 ; RESULT=$?
-if [ ${RESULT} -ne 0 ]; then
- echo 'NOTICE: Failed to load the Fuse module!'
- echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
-fi
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__Makefile
@@ -0,0 +1,18 @@
+--- 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)
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse_io.c
@@ -0,0 +1,28 @@
+--- fuse_module/fuse_io.c.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse_io.c 2008-09-26 13:15:56.000000000 -0400
+@@ -157,7 +157,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)
+@@ -823,7 +827,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
+
--- /dev/null
+++ sysutils/fusefs-kmod/files/pkg-message.in
@@ -0,0 +1,15 @@
+In order to automatically load the fuse module on startup, you need to:
+
+ - Add fusefs_enable="YES" to your /etc/rc.conf.
+ - Run "%%PREFIX%%/etc/rc.d/fusefs start" (for the first time).
+
+Set "sysctl vfs.usermount=1" if you want to be able to mount fuse devices as
+an ordinary user.
+
+Now fuse filesystems (sysutils/fusefs-*) can be mounted at startup from
+/etc/fstab with the "late" parameter. This requires a symlink in /usr/sbin
+named "mount_<fstype>", which is not created by all the fusefs ports.
+
+Note that the rc.d script will unmount all fuse filesystems when called with
+"stop" (in reverse order in case of nested mounts), so it can unload the
+kernel module.
Index: fusefs.in
===================================================================
RCS file: /home/cvs/mports/sysutils/fusefs-kmod/files/fusefs.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/fusefs-kmod/files/fusefs.in -L sysutils/fusefs-kmod/files/fusefs.in -u -r1.1 -r1.2
--- sysutils/fusefs-kmod/files/fusefs.in
+++ sysutils/fusefs-kmod/files/fusefs.in
@@ -1,9 +1,10 @@
#!/bin/sh
#
-# $FreeBSD: ports/sysutils/fusefs-kmod/files/fusefs.in,v 1.1 2006/04/05 02:53:39 mnag Exp $
+# $MidnightBSD$
#
# PROVIDE: fusefs
# REQUIRE: sysctl
+# BEFORE: mountlate
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
@@ -12,10 +13,18 @@
# fusefs_enable (bool): Set to NO by default.
# Set it to YES to enable fusefs.
#
+# fusefs_safe (bool): Set to NO by default.
+# Set it to YES to wait for all write operations
+# to finish before terminating.
+#
+# fusefs_safe_evil (bool): Set to NO by default.
+# Set it to YES to pause the watchdog timer
+# while waiting for write operations.
+#
. %%RC_SUBR%%
-kmod="fuse.ko"
+kmod="%%PREFIX%%/modules/fuse.ko"
name="fusefs"
rcvar=${name}_enable
@@ -24,17 +33,57 @@
fusefs_start()
{
+ if kldstat | grep -q fuse\\.ko; then
+ echo "${name} is already running."
+ return 0
+ fi
echo "Starting ${name}."
kldload $kmod
}
fusefs_stop()
{
+ if ! kldstat | grep -q fuse\\.ko; then
+ echo "${name} is not running."
+ return 1
+ fi
echo "Stopping ${name}."
- kldunload $kmod
+# Unmount FUSE filesystems in reverse order (in case they are nested) to
+# allow recent FUSE implementation to synchronize disks before shutdown.
+ mount | sed -e '1!G;h;$!d' | while read dev d1 mountpoint d2; do
+ case "$dev" in
+ /dev/fuse[0-9]*)
+ echo "fusefs: unmounting ${mountpoint}."
+ umount -f $mountpoint
+ ;;
+ esac
+ done
+ if checkyesno "${name}_safe_evil"; then
+ if [ -n "$_rcshutdown_watchdog" ]; then
+ echo "fusefs: pausing watchdog timer."
+ kill -STOP "$_rcshutdown_watchdog"
+ fi
+ fi
+ if checkyesno "${name}_safe"; then
+ printf "fusefs: unloading $kmod... "
+ while ! kldunload $kmod 2> /dev/null; do
+ sleep 0.25
+ done
+ echo "done."
+ else
+ kldunload $kmod
+ fi
+ if checkyesno "${name}_safe_evil"; then
+ if [ -n "$_rcshutdown_watchdog" ]; then
+ echo "fusefs: continuing watchdog timer."
+ kill -CONT "$_rcshutdown_watchdog"
+ fi
+ fi
}
load_rc_config $name
: ${fusefs_enable="NO"}
+: ${fusefs_safe="NO"}
+: ${fusefs_safe_evil="NO"}
run_rc_command "$1"
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vnops.c
@@ -0,0 +1,80 @@
+--- fuse_module/fuse_vnops.c.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse_vnops.c 2008-10-29 19:21:51.000000000 -0400
+@@ -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;
+@@ -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;
--- sysutils/fusefs-kmod/files/patch-fuse_module_fmaster.c
+++ /dev/null
@@ -1,29 +0,0 @@
---- fuse_module/fmaster.c Mon Jun 19 22:10:26 2006 +0200
-+++ fuse_module/fmaster.c Mon Jun 19 22:23:08 2006 +0200
-@@ -506,22 +506,22 @@ fuse_response_prettyprint(enum fuse_opco
- case FUSE_FSYNCDIR:
- //pp_buf(fresp);
- break;
--#if FUSE_HAS_GETLK
-+#ifdef FUSE_HAS_GETLK
- case FUSE_GETLK:
- panic("FUSE_GETLK implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_SETLK
-+#ifdef FUSE_HAS_SETLK
- case FUSE_SETLK:
- panic("FUSE_SETLK implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_SETLKW
-+#ifdef FUSE_HAS_SETLKW
- case FUSE_SETLKW:
- panic("FUSE_SETLKW implementor has forgotten to define a response body format check");
- break;
- #endif
--#if FUSE_HAS_ACCESS
-+#ifdef FUSE_HAS_ACCESS
- case FUSE_ACCESS:
- break;
- #endif
\ No newline at end of file
--- /dev/null
+++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse_dev.c
@@ -0,0 +1,31 @@
+--- 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);
More information about the Midnightbsd-cvs
mailing list