Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2014 22:04:34 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r363947 - in head/sysutils/fusefs-kmod: . files
Message-ID:  <53deb1f2.5eb0.65be542d@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Sun Aug  3 22:04:34 2014
New Revision: 363947
URL: http://svnweb.freebsd.org/changeset/ports/363947
QAT: https://qat.redports.org/buildarchive/r363947/

Log:
  sysutils/fusefs-kmod: backport 10.x-integrated code for 8.x and 9.x
  
  submitter takes over as maintainer
  
  PR:		184042
  Submitted by:	dpejesh@yahoo.com
  Approved by:	mirror176@cox.net (maintainer timeout)

Added:
  head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vfsops.c   (contents, props changed)
  head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vnops.c   (contents, props changed)
  head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vfsops.c   (contents, props changed)
  head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vnops.c   (contents, props changed)
  head/sysutils/fusefs-kmod/files/patch-fuse_io.c   (contents, props changed)
  head/sysutils/fusefs-kmod/files/patch-fuse_node.c   (contents, props changed)
Deleted:
  head/sysutils/fusefs-kmod/files/extra-patch-fuse_module__fuse_vnops.c
  head/sysutils/fusefs-kmod/files/extrapatch-fuse_module__fuse_vnops.c
  head/sysutils/fusefs-kmod/files/patch-fuse_module__Makefile
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse.h
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_dev.c
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_io.c
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_main.c
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vfsops.c
  head/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vnops.c
  head/sysutils/fusefs-kmod/files/patch-mount_fusefs__mount_fusefs.c
  head/sysutils/fusefs-kmod/files/setup.sh.in
Modified:
  head/sysutils/fusefs-kmod/Makefile
  head/sysutils/fusefs-kmod/distinfo
  head/sysutils/fusefs-kmod/files/fusefs.in
  head/sysutils/fusefs-kmod/pkg-descr
  head/sysutils/fusefs-kmod/pkg-plist

Modified: head/sysutils/fusefs-kmod/Makefile
==============================================================================
--- head/sysutils/fusefs-kmod/Makefile	Sun Aug  3 21:47:23 2014	(r363946)
+++ head/sysutils/fusefs-kmod/Makefile	Sun Aug  3 22:04:34 2014	(r363947)
@@ -1,113 +1,70 @@
-# Created by: Anish Mistry <amistry@am-productions.biz>
 # $FreeBSD$
 
-PORTNAME=	fusefs
-DISTVERSION=	0.3.9-pre1.20080208
-PORTREVISION=	11
-CATEGORIES=	sysutils
-MASTER_SITES=	http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/ \
-    		http://mirrors.rit.edu/zi/fuse4bsd/ \
-  		LOCAL/bdrewery/${PORTNAME}/
-PKGNAMESUFFIX=	-kmod
-DISTNAME=	${HG_SHORTREV}
-DIST_SUBDIR=	fuse4bsd
+PORTNAME=	fusefs-kmod
+PORTVERSION=	0.263233
+CATEGORIES=	sysutils kld
 
-MAINTAINER=	mirror176@cox.net
-COMMENT=	Kernel module for fuse
+MAINTAINER=	dpejesh@yahoo.com
+COMMENT=	FUSE kernel module
 
-BUILD_DEPENDS=	fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
+MASTER_SITES=	https://googledrive.com/host/0B0OQnKtejJEMQlpoTy11SG1nN2s/
 
-USE_RC_SUBR=	fusefs
-KMODDIR=	${PREFIX}/modules
-MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
-		MOUNT="${SRC_BASE}/sbin/mount"
-WRKSRC=		${WRKDIR}/fuse4bsd-${HG_SHORTREV}
-DISABLE_SIZE=	yes
+ONLY_FOR_ARCHS=	amd64 i386
 
-OPTIONS_DEFINE=	AUTOSETUP DOCS
-AUTOSETUP_DESC=	Automatic global config file setup
+WRKSRC=		${WRKDIR}
 
+USE_RC_SUBR=	fusefs
 USES=		kmod uidfix
 
-DOCS_BUILD_DEPENDS=	deplate:${PORTSDIR}/textproc/ruby-deplate
-
-.include <bsd.port.pre.mk>
+BUILD_DEPENDS=	fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
 
-SETUP=		setup.sh
-HG_SHORTREV=	498acaef33b0
+MAKE_ENV=	BINDIR="${PREFIX}/sbin" \
+		MANDIR="${MANPREFIX}/man/man"
 
-TXT_DOCS=	doc.text
-HTML_DOCS=	Faq.html \
-		Implementation.html \
-		Quickstart.html \
-		article.css \
-		deplate-mini.png \
-		deplate.css \
-		doc.html \
-		heading-navbar.css \
-		home-grey.png \
-		mailto.png \
-		next-grey.png \
-		prev-grey.png \
-		remote.png \
-		serif.css \
-		tabbar-right.css
+SUB_LIST+=	KMODDIR=${KMODDIR}
+SUB_FILES=	pkg-message
 
-.if ${OSVERSION} >= 900040
-EXTRA_PATCHES+=	${FILESDIR}/extra-patch-fuse_module__fuse_vnops.c
-.endif
+.include <bsd.port.pre.mk>
 
-.if ${OSVERSION} >= 1000011
-EXTRA_PATCHES+=	${FILESDIR}/extrapatch-fuse_module__fuse_vnops.c
+.if ${OSVERSION} >= 800000 && ${OSVERSION} < 900000
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-8-fuse_vfsops.c
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-8-fuse_vnops.c
+.endif
+.if ${OSVERSION} >= 900000 && ${OSVERSION} < 1000000
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-9-fuse_vfsops.c
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-9-fuse_vnops.c
 .endif
-
-.if exists(${SRC_BASE}/sys/fs/fuse)
+.if ${OSVERSION} >= 1000000
 IGNORE=		integrated into base
 .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 ${ARCH} != "i386" && ${ARCH} != "amd64"
-BROKEN=		Does not compile on other than i386/amd64
-.endif
 
-.if ${PORT_OPTIONS:MAUTOSETUP}
-SUB_FILES+=	${SETUP}
-.else
-SUB_FILES+=	pkg-message
-.endif
-post-patch:
-	@${REINPLACE_CMD} -e 's/deplate.rb/deplate/g' \
-		${WRKSRC}/doc/Makefile
-	@${REINPLACE_CMD} -e 's|-I../inc|-I${SRC_BASE}/sys -I../inc|g' \
-		${WRKSRC}/mount_fusefs/Makefile
-
-post-configure:
-	@${CP} ${LOCALBASE}/include/fuse/fuse_kernel.h ${WRKSRC}/fuse_module
-
-post-build:
-.if ${PORT_OPTIONS:MDOCS}
-	@cd ${WRKSRC}/doc && make plaintext html_chunked
-.endif
+do-build:
+	cd ${WRKDIR}/modules/fuse; ${MAKE}
+	cd ${WRKDIR}/mount_fusefs; ${MAKE}
+
+do-install:
+	${INSTALL_KLD} ${WRKSRC}/modules/fuse/fuse.ko ${STAGEDIR}${KMODDIR}
+	${INSTALL_MAN} ${WRKSRC}/mount_fusefs/mount_fusefs.8 ${STAGEDIR}${PREFIX}/man/man8
+	${INSTALL_PROGRAM} ${WRKSRC}/mount_fusefs/mount_fusefs ${STAGEDIR}${PREFIX}/sbin
 
 post-install:
-	${MKDIR} ${STAGEDIR}/usr/sbin
-	(cd ${STAGEDIR} && ${LN} -fs ${PREFIX}/sbin/mount_fusefs \
-		usr/sbin/mount_fusefs)
-.if ${PORT_OPTIONS:MAUTOSETUP} && !defined(PACKAGE_BUILDING)
-	@${ECHO} "Modifying global startup config files and loading module..."
-	@${SH} ${WRKDIR}/${SETUP}
-.endif
+	${CAT} ${PKGMESSAGE}
 
-.if ${PORT_OPTIONS:MDOCS}
-	${MKDIR} ${STAGEDIR}${DOCSDIR}/kmod/html
-.for i in ${TXT_DOCS}
-	${INSTALL_DATA} ${WRKSRC}/doc/plaintext_out/$i ${STAGEDIR}${DOCSDIR}/kmod
-.endfor
-.for i in ${HTML_DOCS}
-	${INSTALL_DATA} ${WRKSRC}/doc/html_chunked_out/$i ${STAGEDIR}${DOCSDIR}/kmod/html
-.endfor
-.endif
+SVN_REV=	263233
+SVN_MIRROR?=	http://svn.freebsd.org/base
+EXPDIR=		${WRKSRC}/src
+maintainer-tar:
+	${MKDIR} ${EXPDIR}
+	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sys/fs/fuse/ fs/fuse
+	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sys/modules/fuse/ modules/fuse
+	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount_fusefs mount_fusefs
+	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount/getmntopts.c mount_fusefs/getmntopts.c
+	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount/mntopts.h mount_fusefs/
+	cd ${EXPDIR} && ${TAR} --uname root --uid 0 --gname wheel --gid 0 -zcvf ${DISTDIR}/${PORTNAME}-0.${SVN_REV}${EXTRACT_SUFX} fs modules mount_fusefs
+
+maintainer-check:
+	@new=`svn log -ql 1 ${SVN_MIRROR}@HEAD head/sys/fs/fuse | ${GREP} -v ^- | ${SED} -e 's| .*||; s|r||'`;\
+	old="${SVN_REV}";\
+	if [ "$${new}" -gt "$${old}" ]; then ${ECHO_MSG} "New fuse rev: r$${new} (was $${old})"; fi
 
 .include <bsd.port.post.mk>

Modified: head/sysutils/fusefs-kmod/distinfo
==============================================================================
--- head/sysutils/fusefs-kmod/distinfo	Sun Aug  3 21:47:23 2014	(r363946)
+++ head/sysutils/fusefs-kmod/distinfo	Sun Aug  3 22:04:34 2014	(r363947)
@@ -1,2 +1,2 @@
-SHA256 (fuse4bsd/498acaef33b0.tar.gz) = 3fff52dc292f481b4c51cad3e9cf5f8982e38a25e809ee986e8406c81aff0119
-SIZE (fuse4bsd/498acaef33b0.tar.gz) = 116035
+SHA256 (fusefs-kmod-0.263233.tar.gz) = 68e0e5505cab651d089e6b0824b779676ae2a07d264724844f4980ffd6032933
+SIZE (fusefs-kmod-0.263233.tar.gz) = 58262

Added: head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vfsops.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vfsops.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,47 @@
+--- fs/fuse/fuse_vfsops.c.orig
++++ fs/fuse/fuse_vfsops.c
+@@ -62,8 +62,8 @@
+ #include <sys/errno.h>
+ #include <sys/param.h>
+ #include <sys/kernel.h>
+-#include <sys/capsicum.h>
+ #include <sys/conf.h>
++#include <sys/file.h>
+ #include <sys/filedesc.h>
+ #include <sys/uio.h>
+ #include <sys/malloc.h>
+@@ -206,7 +206,7 @@
+ {
+ 	int err;
+ 
+-	uint64_t mntopts, __mntopts;
++	u_int mntopts, __mntopts;
+ 	int max_read_set;
+ 	uint32_t max_read;
+ 	int daemon_timeout;
+@@ -220,7 +220,6 @@
+ 	struct file *fp, *fptmp;
+ 	char *fspec, *subtype;
+ 	struct vfsoptlist *opts;
+-	cap_rights_t rights;
+ 
+ 	subtype = NULL;
+ 	max_read_set = 0;
+@@ -290,7 +289,7 @@
+ 
+ 	FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
+ 
+-	err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
++	err = fget(td, fd, &fp);
+ 	if (err != 0) {
+ 		FS_DEBUG("invalid or not opened device: data=%p\n", data);
+ 		goto out;
+@@ -459,7 +458,7 @@
+ 				FUSE_UNLOCK();
+ 				VOP_UNLOCK(*vpp, 0);
+ 				vrele(*vpp);
+-				vrecycle(*vpp);
++				vrecycle(*vpp, curthread);
+ 				*vpp = data->vroot;
+ 			} else
+ 				FUSE_UNLOCK();

Added: head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vnops.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vnops.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,146 @@
+--- fs/fuse/fuse_vnops.c.orig
++++ fs/fuse/fuse_vnops.c
+@@ -190,10 +190,10 @@
+ 
+ int	fuse_pbuf_freecnt = -1;
+ 
+-#define fuse_vm_page_lock(m)		vm_page_lock((m));
+-#define fuse_vm_page_unlock(m)		vm_page_unlock((m));
+-#define fuse_vm_page_lock_queues()	((void)0)
+-#define fuse_vm_page_unlock_queues()	((void)0)
++#define fuse_vm_page_lock(m)		((void)0)
++#define fuse_vm_page_unlock(m)		((void)0)
++#define fuse_vm_page_lock_queues()	vm_page_lock_queues()
++#define fuse_vm_page_unlock_queues()	vm_page_unlock_queues()
+ 
+ /*
+     struct vnop_access_args {
+@@ -579,7 +579,7 @@
+ 	}
+ 
+ 	if ((fvdat->flag & FN_REVOKED) != 0 && fuse_reclaim_revoked) {
+-		vrecycle(vp);
++		vrecycle(vp, curthread);
+ 	}
+ 	return 0;
+ }
+@@ -706,7 +706,7 @@
+ 		op = FUSE_GETATTR;
+ 		goto calldaemon;
+ 	} else if (fuse_lookup_cache_enable) {
+-		err = cache_lookup(dvp, vpp, cnp, NULL, NULL);
++		err = cache_lookup(dvp, vpp, cnp);
+ 		switch (err) {
+ 
+ 		case -1:		/* positive match */
+@@ -1758,7 +1758,7 @@
+ 	 * can only occur at the file EOF.
+ 	 */
+ 
+-	VM_OBJECT_WLOCK(vp->v_object);
++	VM_OBJECT_LOCK(vp->v_object);
+ 	fuse_vm_page_lock_queues();
+ 	if (pages[ap->a_reqpage]->valid != 0) {
+ 		for (i = 0; i < npages; ++i) {
+@@ -1769,11 +1769,11 @@
+ 			}
+ 		}
+ 		fuse_vm_page_unlock_queues();
+-		VM_OBJECT_WUNLOCK(vp->v_object);
++		VM_OBJECT_UNLOCK(vp->v_object);
+ 		return 0;
+ 	}
+ 	fuse_vm_page_unlock_queues();
+-	VM_OBJECT_WUNLOCK(vp->v_object);
++	VM_OBJECT_UNLOCK(vp->v_object);
+ 
+ 	/*
+ 	 * We use only the kva address for the buffer, but this is extremely
+@@ -1803,7 +1803,7 @@
+ 
+ 	if (error && (uio.uio_resid == count)) {
+ 		FS_DEBUG("error %d\n", error);
+-		VM_OBJECT_WLOCK(vp->v_object);
++		VM_OBJECT_LOCK(vp->v_object);
+ 		fuse_vm_page_lock_queues();
+ 		for (i = 0; i < npages; ++i) {
+ 			if (i != ap->a_reqpage) {
+@@ -1813,7 +1813,7 @@
+ 			}
+ 		}
+ 		fuse_vm_page_unlock_queues();
+-		VM_OBJECT_WUNLOCK(vp->v_object);
++		VM_OBJECT_UNLOCK(vp->v_object);
+ 		return VM_PAGER_ERROR;
+ 	}
+ 	/*
+@@ -1823,7 +1823,7 @@
+ 	 */
+ 
+ 	size = count - uio.uio_resid;
+-	VM_OBJECT_WLOCK(vp->v_object);
++	VM_OBJECT_LOCK(vp->v_object);
+ 	fuse_vm_page_lock_queues();
+ 	for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
+ 		vm_page_t m;
+@@ -1843,7 +1843,7 @@
+ 			 * Read operation filled a partial page.
+ 			 */
+ 			m->valid = 0;
+-			vm_page_set_valid_range(m, 0, size - toff);
++			vm_page_set_valid(m, 0, size - toff);
+ 			KASSERT(m->dirty == 0,
+ 			    ("fuse_getpages: page %p is dirty", m));
+ 		} else {
+@@ -1854,11 +1854,36 @@
+ 			 */
+ 			;
+ 		}
+-		if (i != ap->a_reqpage)
+-			vm_page_readahead_finish(m);
++		if (i != ap->a_reqpage) {
++			/*
++			 * whether or not to leave the page activated is up in
++			 * the air, but we should put the page on a page queue
++			 * somewhere. (it already is in the object). Result:
++			 * It appears that empirical results show that
++			 * deactivating pages is best.
++			 */
++
++			/*
++			 * just in case someone was asking for this page we
++			 * now tell them that it is ok to use
++			 */
++			if (!error) {
++#ifdef VPO_WANTED
++				if (m->oflags & VPO_WANTED)
++#else
++				if (m->flags & PG_WANTED)
++#endif
++					vm_page_activate(m);
++				else
++					vm_page_deactivate(m);
++				vm_page_wakeup(m);
++			} else {
++				vm_page_free(m);
++			}
++		}
+ 	}
+ 	fuse_vm_page_unlock_queues();
+-	VM_OBJECT_WUNLOCK(vp->v_object);
++	VM_OBJECT_UNLOCK(vp->v_object);
+ 	return 0;
+ }
+ 
+@@ -1947,9 +1972,9 @@
+ 
+ 		for (i = 0; i < nwritten; i++) {
+ 			rtvals[i] = VM_PAGER_OK;
+-			VM_OBJECT_WLOCK(pages[i]->object);
++			VM_OBJECT_LOCK(pages[i]->object);
+ 			vm_page_undirty(pages[i]);
+-			VM_OBJECT_WUNLOCK(pages[i]->object);
++			VM_OBJECT_UNLOCK(pages[i]->object);
+ 		}
+ 	}
+ 	return rtvals[0];

Added: head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vfsops.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vfsops.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,37 @@
+--- fs/fuse/fuse_vfsops.c.orig
++++ fs/fuse/fuse_vfsops.c
+@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
+ #include <sys/errno.h>
+ #include <sys/param.h>
+ #include <sys/kernel.h>
+-#include <sys/capsicum.h>
++#include <sys/capability.h>
+ #include <sys/conf.h>
+ #include <sys/filedesc.h>
+ #include <sys/uio.h>
+@@ -220,7 +220,6 @@ fuse_vfsop_mount(struct mount *mp)
+ 	struct file *fp, *fptmp;
+ 	char *fspec, *subtype;
+ 	struct vfsoptlist *opts;
+-	cap_rights_t rights;
+ 
+ 	subtype = NULL;
+ 	max_read_set = 0;
+@@ -290,7 +289,7 @@ fuse_vfsop_mount(struct mount *mp)
+ 
+ 	FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
+ 
+-	err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
++	err = fget(td, fd, CAP_READ, &fp);
+ 	if (err != 0) {
+ 		FS_DEBUG("invalid or not opened device: data=%p\n", data);
+ 		goto out;
+@@ -459,7 +458,7 @@ fuse_vfsop_root(struct mount *mp, int lkflags, struct vnode **vpp)
+ 				FUSE_UNLOCK();
+ 				VOP_UNLOCK(*vpp, 0);
+ 				vrele(*vpp);
+-				vrecycle(*vpp);
++				vrecycle(*vpp, curthread);
+ 				*vpp = data->vroot;
+ 			} else
+ 				FUSE_UNLOCK();

Added: head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vnops.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vnops.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,134 @@
+--- fs/fuse/fuse_vnops.c.orig
++++ fs/fuse/fuse_vnops.c
+@@ -579,7 +579,7 @@ fuse_vnop_inactive(struct vop_inactive_args *ap)
+ 	}
+ 
+ 	if ((fvdat->flag & FN_REVOKED) != 0 && fuse_reclaim_revoked) {
+-		vrecycle(vp);
++		vrecycle(vp, curthread);
+ 	}
+ 	return 0;
+ }
+@@ -706,7 +706,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap)
+ 		op = FUSE_GETATTR;
+ 		goto calldaemon;
+ 	} else if (fuse_lookup_cache_enable) {
+-		err = cache_lookup(dvp, vpp, cnp, NULL, NULL);
++		err = cache_lookup(dvp, vpp, cnp);
+ 		switch (err) {
+ 
+ 		case -1:		/* positive match */
+@@ -1758,7 +1758,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 	 * can only occur at the file EOF.
+ 	 */
+ 
+-	VM_OBJECT_WLOCK(vp->v_object);
++	VM_OBJECT_LOCK(vp->v_object);
+ 	fuse_vm_page_lock_queues();
+ 	if (pages[ap->a_reqpage]->valid != 0) {
+ 		for (i = 0; i < npages; ++i) {
+@@ -1769,11 +1769,11 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 			}
+ 		}
+ 		fuse_vm_page_unlock_queues();
+-		VM_OBJECT_WUNLOCK(vp->v_object);
++		VM_OBJECT_UNLOCK(vp->v_object);
+ 		return 0;
+ 	}
+ 	fuse_vm_page_unlock_queues();
+-	VM_OBJECT_WUNLOCK(vp->v_object);
++	VM_OBJECT_UNLOCK(vp->v_object);
+ 
+ 	/*
+ 	 * We use only the kva address for the buffer, but this is extremely
+@@ -1803,7 +1803,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 
+ 	if (error && (uio.uio_resid == count)) {
+ 		FS_DEBUG("error %d\n", error);
+-		VM_OBJECT_WLOCK(vp->v_object);
++		VM_OBJECT_LOCK(vp->v_object);
+ 		fuse_vm_page_lock_queues();
+ 		for (i = 0; i < npages; ++i) {
+ 			if (i != ap->a_reqpage) {
+@@ -1813,7 +1813,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 			}
+ 		}
+ 		fuse_vm_page_unlock_queues();
+-		VM_OBJECT_WUNLOCK(vp->v_object);
++		VM_OBJECT_UNLOCK(vp->v_object);
+ 		return VM_PAGER_ERROR;
+ 	}
+ 	/*
+@@ -1823,7 +1823,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 	 */
+ 
+ 	size = count - uio.uio_resid;
+-	VM_OBJECT_WLOCK(vp->v_object);
++	VM_OBJECT_LOCK(vp->v_object);
+ 	fuse_vm_page_lock_queues();
+ 	for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
+ 		vm_page_t m;
+@@ -1843,7 +1843,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 			 * Read operation filled a partial page.
+ 			 */
+ 			m->valid = 0;
+-			vm_page_set_valid_range(m, 0, size - toff);
++			vm_page_set_valid(m, 0, size - toff);
+ 			KASSERT(m->dirty == 0,
+ 			    ("fuse_getpages: page %p is dirty", m));
+ 		} else {
+@@ -1854,11 +1854,39 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
+ 			 */
+ 			;
+ 		}
+-		if (i != ap->a_reqpage)
+-			vm_page_readahead_finish(m);
++		if (i != ap->a_reqpage) {
++			/*
++			 * whether or not to leave the page activated is up in
++			 * the air, but we should put the page on a page queue
++			 * somewhere. (it already is in the object). Result:
++			 * It appears that empirical results show that
++			 * deactivating pages is best.
++			 */
++
++			/*
++			 * just in case someone was asking for this page we
++			 * now tell them that it is ok to use
++			 */
++			if (!error) {
++				if (m->oflags & VPO_WANTED) {
++					vm_page_lock(m);
++					vm_page_activate(m);
++					vm_page_unlock(m);
++				} else {
++					vm_page_lock(m);
++					vm_page_deactivate(m);
++					vm_page_unlock(m);
++				}
++				vm_page_wakeup(m);
++			} else {
++				vm_page_lock(m);
++				vm_page_free(m);
++				vm_page_unlock(m);
++			}
++		}
+ 	}
+ 	fuse_vm_page_unlock_queues();
+-	VM_OBJECT_WUNLOCK(vp->v_object);
++	VM_OBJECT_UNLOCK(vp->v_object);
+ 	return 0;
+ }
+ 
+@@ -1947,9 +1975,9 @@ fuse_vnop_putpages(struct vop_putpages_args *ap)
+ 
+ 		for (i = 0; i < nwritten; i++) {
+ 			rtvals[i] = VM_PAGER_OK;
+-			VM_OBJECT_WLOCK(pages[i]->object);
++			VM_OBJECT_LOCK(pages[i]->object);
+ 			vm_page_undirty(pages[i]);
+-			VM_OBJECT_WUNLOCK(pages[i]->object);
++			VM_OBJECT_UNLOCK(pages[i]->object);
+ 		}
+ 	}
+ 	return rtvals[0];

Modified: head/sysutils/fusefs-kmod/files/fusefs.in
==============================================================================
--- head/sysutils/fusefs-kmod/files/fusefs.in	Sun Aug  3 21:47:23 2014	(r363946)
+++ head/sysutils/fusefs-kmod/files/fusefs.in	Sun Aug  3 22:04:34 2014	(r363947)
@@ -27,7 +27,7 @@
 name="fusefs"
 rcvar=fusefs_enable
 
-kmod="%%PREFIX%%/modules/fuse.ko"
+kmod="%%KMODDIR%%/fuse.ko"
 
 start_cmd="fusefs_start"
 stop_cmd="fusefs_stop"

Added: head/sysutils/fusefs-kmod/files/patch-fuse_io.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/patch-fuse_io.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,14 @@
+--- fs/fuse/fuse_io.c.orig
++++ fs/fuse/fuse_io.c
+@@ -785,9 +785,9 @@ fuse_io_invalbuf(struct vnode *vp, struct thread *td)
+ 	fvdat->flag |= FN_FLUSHINPROG;
+ 
+ 	if (vp->v_bufobj.bo_object != NULL) {
+-		VM_OBJECT_WLOCK(vp->v_bufobj.bo_object);
++		VM_OBJECT_LOCK(vp->v_bufobj.bo_object);
+ 		vm_object_page_clean(vp->v_bufobj.bo_object, 0, 0, OBJPC_SYNC);
+-		VM_OBJECT_WUNLOCK(vp->v_bufobj.bo_object);
++		VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object);
+ 	}
+ 	error = vinvalbuf(vp, V_SAVE, PCATCH, 0);
+ 	while (error) {

Added: head/sysutils/fusefs-kmod/files/patch-fuse_node.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/fusefs-kmod/files/patch-fuse_node.c	Sun Aug  3 22:04:34 2014	(r363947)
@@ -0,0 +1,11 @@
+--- fs/fuse/fuse_node.c.orig
++++ fs/fuse/fuse_node.c
+@@ -362,7 +362,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize)
+ 	fvdat->flag |= FN_SIZECHANGE;
+ 
+ 	if (newsize < oldsize) {
+-		err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp));
++		err = vtruncbuf(vp, cred, curthread, newsize, fuse_iosize(vp));
+ 	}
+ 	vnode_pager_setsize(vp, newsize);
+ 	return err;

Modified: head/sysutils/fusefs-kmod/pkg-descr
==============================================================================
--- head/sysutils/fusefs-kmod/pkg-descr	Sun Aug  3 21:47:23 2014	(r363946)
+++ head/sysutils/fusefs-kmod/pkg-descr	Sun Aug  3 22:04:34 2014	(r363947)
@@ -1,3 +1,3 @@
-Kernel module for fusefs based filesystems.
+Kernel module for fusefs based filesystems,
+backported from 10.x to 8.x and 9.x.
 
-WWW: http://fuse4bsd.creo.hu/

Modified: head/sysutils/fusefs-kmod/pkg-plist
==============================================================================
--- head/sysutils/fusefs-kmod/pkg-plist	Sun Aug  3 21:47:23 2014	(r363946)
+++ head/sysutils/fusefs-kmod/pkg-plist	Sun Aug  3 22:04:34 2014	(r363947)
@@ -1,24 +1,6 @@
-sbin/mount_fusefs
 man/man8/mount_fusefs.8.gz
-%%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
-%%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
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%
+sbin/mount_fusefs
+@exec ln -fs %D/%F /usr/sbin
+@unexec rm -f /usr/sbin/mount_fusefs
 @cwd /
-usr/sbin/mount_fusefs
 %%KMODDIR%%/fuse.ko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53deb1f2.5eb0.65be542d>