View | Details | Raw Unified | Return to bug 184042
Collapse All | Expand All

(-)b/sysutils/fusefs-kmod/Makefile (-96 / +49 lines)
Lines 1-118 Link Here
1
# Created by: Anish Mistry <amistry@am-productions.biz>
1
# Created by: David Shane Holden <dpejesh@yahoo.com>
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	fusefs
4
PORTNAME=	fusefs-kmod
5
DISTVERSION=	0.3.9-pre1.20080208
5
PORTVERSION=	0.${SVN_REV}
6
PORTREVISION=	11
7
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
8
MASTER_SITES=	http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/ \
9
    		http://mirrors.rit.edu/zi/fuse4bsd/ \
10
  		LOCAL/bdrewery/${PORTNAME}/
11
PKGNAMESUFFIX=	-kmod
12
DISTNAME=	${HG_SHORTREV}
13
DIST_SUBDIR=	fuse4bsd
14
7
15
MAINTAINER=	mirror176@cox.net
8
MAINTAINER=	ports@FreeBSD.org
16
COMMENT=	Kernel module for fuse
9
COMMENT=	FUSE kernel module
17
10
18
BUILD_DEPENDS=	fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
11
MASTER_SITES=	https://googledrive.com/host/0B0OQnKtejJEMQlpoTy11SG1nN2s/
19
20
USE_RC_SUBR=	fusefs
21
KMODDIR=	${PREFIX}/modules
22
MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
23
		MOUNT="${SRC_BASE}/sbin/mount"
24
WRKSRC=		${WRKDIR}/fuse4bsd-${HG_SHORTREV}
25
DISABLE_SIZE=	yes
26
12
27
OPTIONS_DEFINE=	AUTOSETUP DOCS
13
ONLY_FOR_ARCHS=	amd64 i386
28
AUTOSETUP_DESC=	Automatic global config file setup
29
14
30
NO_STAGE=	yes
15
WRKSRC=		${WRKDIR}
31
16
17
USE_RC_SUBR=	fusefs
32
USES=		kmod
18
USES=		kmod
33
.include <bsd.port.pre.mk>
34
19
35
.if ${PORT_OPTIONS:MDOCS}
20
BUILD_DEPENDS=	fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs
36
BUILD_DEPENDS+=	deplate:${PORTSDIR}/textproc/ruby-deplate
37
.endif
38
21
39
SETUP=		setup.sh
22
MAKE_ENV=	BINDIR="${PREFIX}/sbin" \
40
HG_SHORTREV=	498acaef33b0
23
		MANDIR="${MANPREFIX}/man/man"
41
42
MAN8=		mount_fusefs.8
43
TXT_DOCS=	doc.text
44
HTML_DOCS=	Faq.html \
45
		Implementation.html \
46
		Quickstart.html \
47
		article.css \
48
		deplate-mini.png \
49
		deplate.css \
50
		doc.html \
51
		heading-navbar.css \
52
		home-grey.png \
53
		mailto.png \
54
		next-grey.png \
55
		prev-grey.png \
56
		remote.png \
57
		serif.css \
58
		tabbar-right.css
59
60
.if ${OSVERSION} >= 900040
61
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-fuse_module__fuse_vnops.c
62
.endif
63
24
64
.if ${OSVERSION} >= 1000011
25
SUB_LIST+=	KMODDIR=${KMODDIR}
65
EXTRA_PATCHES+=	${FILESDIR}/extrapatch-fuse_module__fuse_vnops.c
26
SUB_FILES=	pkg-message
66
.endif
67
27
68
.if exists(${SRC_BASE}/sys/fs/fuse)
28
.include <bsd.port.pre.mk>
69
IGNORE=		Integrated into base
70
.endif
71
.if !exists(${SRC_BASE}/sbin/mount)
72
IGNORE=		requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src
73
.endif
74
29
75
.if ${ARCH} != "i386" && ${ARCH} != "amd64"
30
.if ${OSVERSION} >= 800000 && ${OSVERSION} < 900000
76
BROKEN=		Does not compile on other than i386/amd64
31
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-8-fuse_vfsops.c
32
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-8-fuse_vnops.c
77
.endif
33
.endif
78
34
.if ${OSVERSION} >= 900000 && ${OSVERSION} < 1000000
79
.if ${PORT_OPTIONS:MAUTOSETUP}
35
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-9-fuse_vfsops.c
80
SUB_FILES+=	${SETUP}
36
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-9-fuse_vnops.c
81
.else
37
.endif
82
SUB_FILES+=	pkg-message
38
.if ${OSVERSION} >= 1000000
39
IGNORE=		integrated into base
83
.endif
40
.endif
84
41
85
post-patch:
42
do-build:
86
	@${REINPLACE_CMD} -e 's/deplate.rb/deplate/g' \
43
	cd ${WRKDIR}/modules/fuse; ${MAKE}
87
		${WRKSRC}/doc/Makefile
44
	cd ${WRKDIR}/mount_fusefs; ${MAKE}
88
	@${REINPLACE_CMD} -e 's|-I../inc|-I${SRC_BASE}/sys -I../inc|g' \
89
		${WRKSRC}/mount_fusefs/Makefile
90
45
91
post-configure:
46
do-install:
92
	@${CP} ${LOCALBASE}/include/fuse/fuse_kernel.h ${WRKSRC}/fuse_module
47
	${INSTALL_KLD} ${WRKSRC}/modules/fuse/fuse.ko ${STAGEDIR}${KMODDIR}
93
48
	${INSTALL_MAN} ${WRKSRC}/mount_fusefs/mount_fusefs.8 ${STAGEDIR}${PREFIX}/man/man8
94
post-build:
49
	${INSTALL_PROGRAM} ${WRKSRC}/mount_fusefs/mount_fusefs ${STAGEDIR}${PREFIX}/sbin
95
.if ${PORT_OPTIONS:MDOCS}
96
	@cd ${WRKSRC}/doc && make plaintext html_chunked
97
.endif
98
50
99
post-install:
51
post-install:
100
	@${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
52
	${CAT} ${PKGMESSAGE}
101
.if ${PORT_OPTIONS:MAUTOSETUP} && !defined(PACKAGE_BUILDING)
53
102
	@${ECHO} "Modifying global startup config files and loading module..."
54
SVN_REV=	255219
103
	@${SH} ${WRKDIR}/${SETUP}
55
SVN_MIRROR?=	http://svn.freebsd.org/base
104
.else
56
EXPDIR=		${WRKSRC}/src
105
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
57
maintainer-tar:
106
.endif
58
	${MKDIR} ${EXPDIR}
107
59
	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sys/fs/fuse/ fs/fuse
108
.if ${PORT_OPTIONS:MDOCS}
60
	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sys/modules/fuse/ modules/fuse
109
	@${MKDIR} ${DOCSDIR}/kmod/html
61
	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount_fusefs mount_fusefs
110
.for i in ${TXT_DOCS}
62
	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount/getmntopts.c mount_fusefs/getmntopts.c
111
	@${INSTALL_DATA} ${WRKSRC}/doc/plaintext_out/$i ${DOCSDIR}/kmod
63
	cd ${EXPDIR} && svn export -r ${SVN_REV} ${SVN_MIRROR}/head/sbin/mount/mntopts.h mount_fusefs/
112
.endfor
64
	cd ${EXPDIR} && ${TAR} --uname root --uid 0 --gname wheel --gid 0 -zcvf ${DISTDIR}/${PORTNAME}-0.${SVN_REV}${EXTRACT_SUFX} fs modules mount_fusefs
113
.for i in ${HTML_DOCS}
65
114
	@${INSTALL_DATA} ${WRKSRC}/doc/html_chunked_out/$i ${DOCSDIR}/kmod/html
66
maintainer-check:
115
.endfor
67
	@new=`svn log -ql 1 ${SVN_MIRROR}@HEAD head/sys/fs/fuse | ${GREP} -v ^- | ${SED} -e 's| .*||; s|r||'`;\
116
.endif
68
	old="${SVN_REV}";\
69
	if [ "$${new}" -gt "$${old}" ]; then ${ECHO_MSG} "New fuse rev: r$${new} (was $${old})"; fi
117
70
118
.include <bsd.port.post.mk>
71
.include <bsd.port.post.mk>
(-)b/sysutils/fusefs-kmod/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (fuse4bsd/498acaef33b0.tar.gz) = 3fff52dc292f481b4c51cad3e9cf5f8982e38a25e809ee986e8406c81aff0119
1
SHA256 (fusefs-kmod-0.255219.tar.gz) = 1e8a92f1b39fc53b95fbc8c338aa60fa0cacf67b06ca3f57190581348a9b75f7
2
SIZE (fuse4bsd/498acaef33b0.tar.gz) = 116035
2
SIZE (fusefs-kmod-0.255219.tar.gz) = 58408
(-)b/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vfsops.c (+47 lines)
Added Link Here
1
--- fs/fuse/fuse_vfsops.c.orig
2
+++ fs/fuse/fuse_vfsops.c
3
@@ -62,8 +62,8 @@
4
 #include <sys/errno.h>
5
 #include <sys/param.h>
6
 #include <sys/kernel.h>
7
-#include <sys/capability.h>
8
 #include <sys/conf.h>
9
+#include <sys/file.h>
10
 #include <sys/filedesc.h>
11
 #include <sys/uio.h>
12
 #include <sys/malloc.h>
13
@@ -206,7 +206,7 @@
14
 {
15
 	int err;
16
 
17
-	uint64_t mntopts, __mntopts;
18
+	u_int mntopts, __mntopts;
19
 	int max_read_set;
20
 	uint32_t max_read;
21
 	int daemon_timeout;
22
@@ -220,7 +220,6 @@
23
 	struct file *fp, *fptmp;
24
 	char *fspec, *subtype;
25
 	struct vfsoptlist *opts;
26
-	cap_rights_t rights;
27
 
28
 	subtype = NULL;
29
 	max_read_set = 0;
30
@@ -290,7 +289,7 @@
31
 
32
 	FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
33
 
34
-	err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
35
+	err = fget(td, fd, &fp);
36
 	if (err != 0) {
37
 		FS_DEBUG("invalid or not opened device: data=%p\n", data);
38
 		goto out;
39
@@ -459,7 +458,7 @@
40
 				FUSE_UNLOCK();
41
 				VOP_UNLOCK(*vpp, 0);
42
 				vrele(*vpp);
43
-				vrecycle(*vpp);
44
+				vrecycle(*vpp, curthread);
45
 				*vpp = data->vroot;
46
 			} else
47
 				FUSE_UNLOCK();
(-)b/sysutils/fusefs-kmod/files/extra-patch-8-fuse_vnops.c (+146 lines)
Added Link Here
1
--- fs/fuse/fuse_vnops.c.orig
2
+++ fs/fuse/fuse_vnops.c
3
@@ -190,10 +190,10 @@
4
 
5
 int	fuse_pbuf_freecnt = -1;
6
 
7
-#define fuse_vm_page_lock(m)		vm_page_lock((m));
8
-#define fuse_vm_page_unlock(m)		vm_page_unlock((m));
9
-#define fuse_vm_page_lock_queues()	((void)0)
10
-#define fuse_vm_page_unlock_queues()	((void)0)
11
+#define fuse_vm_page_lock(m)		((void)0)
12
+#define fuse_vm_page_unlock(m)		((void)0)
13
+#define fuse_vm_page_lock_queues()	vm_page_lock_queues()
14
+#define fuse_vm_page_unlock_queues()	vm_page_unlock_queues()
15
 
16
 /*
17
     struct vnop_access_args {
18
@@ -579,7 +579,7 @@
19
 	}
20
 
21
 	if ((fvdat->flag & FN_REVOKED) != 0 && fuse_reclaim_revoked) {
22
-		vrecycle(vp);
23
+		vrecycle(vp, curthread);
24
 	}
25
 	return 0;
26
 }
27
@@ -706,7 +706,7 @@
28
 		op = FUSE_GETATTR;
29
 		goto calldaemon;
30
 	} else if (fuse_lookup_cache_enable) {
31
-		err = cache_lookup(dvp, vpp, cnp, NULL, NULL);
32
+		err = cache_lookup(dvp, vpp, cnp);
33
 		switch (err) {
34
 
35
 		case -1:		/* positive match */
36
@@ -1758,7 +1758,7 @@
37
 	 * can only occur at the file EOF.
38
 	 */
39
 
40
-	VM_OBJECT_WLOCK(vp->v_object);
41
+	VM_OBJECT_LOCK(vp->v_object);
42
 	fuse_vm_page_lock_queues();
43
 	if (pages[ap->a_reqpage]->valid != 0) {
44
 		for (i = 0; i < npages; ++i) {
45
@@ -1769,11 +1769,11 @@
46
 			}
47
 		}
48
 		fuse_vm_page_unlock_queues();
49
-		VM_OBJECT_WUNLOCK(vp->v_object);
50
+		VM_OBJECT_UNLOCK(vp->v_object);
51
 		return 0;
52
 	}
53
 	fuse_vm_page_unlock_queues();
54
-	VM_OBJECT_WUNLOCK(vp->v_object);
55
+	VM_OBJECT_UNLOCK(vp->v_object);
56
 
57
 	/*
58
 	 * We use only the kva address for the buffer, but this is extremely
59
@@ -1803,7 +1803,7 @@
60
 
61
 	if (error && (uio.uio_resid == count)) {
62
 		FS_DEBUG("error %d\n", error);
63
-		VM_OBJECT_WLOCK(vp->v_object);
64
+		VM_OBJECT_LOCK(vp->v_object);
65
 		fuse_vm_page_lock_queues();
66
 		for (i = 0; i < npages; ++i) {
67
 			if (i != ap->a_reqpage) {
68
@@ -1813,7 +1813,7 @@
69
 			}
70
 		}
71
 		fuse_vm_page_unlock_queues();
72
-		VM_OBJECT_WUNLOCK(vp->v_object);
73
+		VM_OBJECT_UNLOCK(vp->v_object);
74
 		return VM_PAGER_ERROR;
75
 	}
76
 	/*
77
@@ -1823,7 +1823,7 @@
78
 	 */
79
 
80
 	size = count - uio.uio_resid;
81
-	VM_OBJECT_WLOCK(vp->v_object);
82
+	VM_OBJECT_LOCK(vp->v_object);
83
 	fuse_vm_page_lock_queues();
84
 	for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
85
 		vm_page_t m;
86
@@ -1843,7 +1843,7 @@
87
 			 * Read operation filled a partial page.
88
 			 */
89
 			m->valid = 0;
90
-			vm_page_set_valid_range(m, 0, size - toff);
91
+			vm_page_set_valid(m, 0, size - toff);
92
 			KASSERT(m->dirty == 0,
93
 			    ("fuse_getpages: page %p is dirty", m));
94
 		} else {
95
@@ -1854,11 +1854,36 @@
96
 			 */
97
 			;
98
 		}
99
-		if (i != ap->a_reqpage)
100
-			vm_page_readahead_finish(m);
101
+		if (i != ap->a_reqpage) {
102
+			/*
103
+			 * whether or not to leave the page activated is up in
104
+			 * the air, but we should put the page on a page queue
105
+			 * somewhere. (it already is in the object). Result:
106
+			 * It appears that empirical results show that
107
+			 * deactivating pages is best.
108
+			 */
109
+
110
+			/*
111
+			 * just in case someone was asking for this page we
112
+			 * now tell them that it is ok to use
113
+			 */
114
+			if (!error) {
115
+#ifdef VPO_WANTED
116
+				if (m->oflags & VPO_WANTED)
117
+#else
118
+				if (m->flags & PG_WANTED)
119
+#endif
120
+					vm_page_activate(m);
121
+				else
122
+					vm_page_deactivate(m);
123
+				vm_page_wakeup(m);
124
+			} else {
125
+				vm_page_free(m);
126
+			}
127
+		}
128
 	}
129
 	fuse_vm_page_unlock_queues();
130
-	VM_OBJECT_WUNLOCK(vp->v_object);
131
+	VM_OBJECT_UNLOCK(vp->v_object);
132
 	return 0;
133
 }
134
 
135
@@ -1947,9 +1972,9 @@
136
 
137
 		for (i = 0; i < nwritten; i++) {
138
 			rtvals[i] = VM_PAGER_OK;
139
-			VM_OBJECT_WLOCK(pages[i]->object);
140
+			VM_OBJECT_LOCK(pages[i]->object);
141
 			vm_page_undirty(pages[i]);
142
-			VM_OBJECT_WUNLOCK(pages[i]->object);
143
+			VM_OBJECT_UNLOCK(pages[i]->object);
144
 		}
145
 	}
146
 	return rtvals[0];
(-)b/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vfsops.c (+28 lines)
Added Link Here
1
--- fs/fuse/fuse_vfsops.c.orig
2
+++ fs/fuse/fuse_vfsops.c
3
@@ -220,7 +220,6 @@ fuse_vfsop_mount(struct mount *mp)
4
 	struct file *fp, *fptmp;
5
 	char *fspec, *subtype;
6
 	struct vfsoptlist *opts;
7
-	cap_rights_t rights;
8
 
9
 	subtype = NULL;
10
 	max_read_set = 0;
11
@@ -290,7 +289,7 @@ fuse_vfsop_mount(struct mount *mp)
12
 
13
 	FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts);
14
 
15
-	err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
16
+	err = fget(td, fd, CAP_READ, &fp);
17
 	if (err != 0) {
18
 		FS_DEBUG("invalid or not opened device: data=%p\n", data);
19
 		goto out;
20
@@ -459,7 +458,7 @@ fuse_vfsop_root(struct mount *mp, int lkflags, struct vnode **vpp)
21
 				FUSE_UNLOCK();
22
 				VOP_UNLOCK(*vpp, 0);
23
 				vrele(*vpp);
24
-				vrecycle(*vpp);
25
+				vrecycle(*vpp, curthread);
26
 				*vpp = data->vroot;
27
 			} else
28
 				FUSE_UNLOCK();
(-)b/sysutils/fusefs-kmod/files/extra-patch-9-fuse_vnops.c (+134 lines)
Added Link Here
1
--- fs/fuse/fuse_vnops.c.orig
2
+++ fs/fuse/fuse_vnops.c
3
@@ -579,7 +579,7 @@ fuse_vnop_inactive(struct vop_inactive_args *ap)
4
 	}
5
 
6
 	if ((fvdat->flag & FN_REVOKED) != 0 && fuse_reclaim_revoked) {
7
-		vrecycle(vp);
8
+		vrecycle(vp, curthread);
9
 	}
10
 	return 0;
11
 }
12
@@ -706,7 +706,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap)
13
 		op = FUSE_GETATTR;
14
 		goto calldaemon;
15
 	} else if (fuse_lookup_cache_enable) {
16
-		err = cache_lookup(dvp, vpp, cnp, NULL, NULL);
17
+		err = cache_lookup(dvp, vpp, cnp);
18
 		switch (err) {
19
 
20
 		case -1:		/* positive match */
21
@@ -1758,7 +1758,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
22
 	 * can only occur at the file EOF.
23
 	 */
24
 
25
-	VM_OBJECT_WLOCK(vp->v_object);
26
+	VM_OBJECT_LOCK(vp->v_object);
27
 	fuse_vm_page_lock_queues();
28
 	if (pages[ap->a_reqpage]->valid != 0) {
29
 		for (i = 0; i < npages; ++i) {
30
@@ -1769,11 +1769,11 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
31
 			}
32
 		}
33
 		fuse_vm_page_unlock_queues();
34
-		VM_OBJECT_WUNLOCK(vp->v_object);
35
+		VM_OBJECT_UNLOCK(vp->v_object);
36
 		return 0;
37
 	}
38
 	fuse_vm_page_unlock_queues();
39
-	VM_OBJECT_WUNLOCK(vp->v_object);
40
+	VM_OBJECT_UNLOCK(vp->v_object);
41
 
42
 	/*
43
 	 * We use only the kva address for the buffer, but this is extremely
44
@@ -1803,7 +1803,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
45
 
46
 	if (error && (uio.uio_resid == count)) {
47
 		FS_DEBUG("error %d\n", error);
48
-		VM_OBJECT_WLOCK(vp->v_object);
49
+		VM_OBJECT_LOCK(vp->v_object);
50
 		fuse_vm_page_lock_queues();
51
 		for (i = 0; i < npages; ++i) {
52
 			if (i != ap->a_reqpage) {
53
@@ -1813,7 +1813,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
54
 			}
55
 		}
56
 		fuse_vm_page_unlock_queues();
57
-		VM_OBJECT_WUNLOCK(vp->v_object);
58
+		VM_OBJECT_UNLOCK(vp->v_object);
59
 		return VM_PAGER_ERROR;
60
 	}
61
 	/*
62
@@ -1823,7 +1823,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
63
 	 */
64
 
65
 	size = count - uio.uio_resid;
66
-	VM_OBJECT_WLOCK(vp->v_object);
67
+	VM_OBJECT_LOCK(vp->v_object);
68
 	fuse_vm_page_lock_queues();
69
 	for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
70
 		vm_page_t m;
71
@@ -1843,7 +1843,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
72
 			 * Read operation filled a partial page.
73
 			 */
74
 			m->valid = 0;
75
-			vm_page_set_valid_range(m, 0, size - toff);
76
+			vm_page_set_valid(m, 0, size - toff);
77
 			KASSERT(m->dirty == 0,
78
 			    ("fuse_getpages: page %p is dirty", m));
79
 		} else {
80
@@ -1854,11 +1854,39 @@ fuse_vnop_getpages(struct vop_getpages_args *ap)
81
 			 */
82
 			;
83
 		}
84
-		if (i != ap->a_reqpage)
85
-			vm_page_readahead_finish(m);
86
+		if (i != ap->a_reqpage) {
87
+			/*
88
+			 * whether or not to leave the page activated is up in
89
+			 * the air, but we should put the page on a page queue
90
+			 * somewhere. (it already is in the object). Result:
91
+			 * It appears that empirical results show that
92
+			 * deactivating pages is best.
93
+			 */
94
+
95
+			/*
96
+			 * just in case someone was asking for this page we
97
+			 * now tell them that it is ok to use
98
+			 */
99
+			if (!error) {
100
+				if (m->oflags & VPO_WANTED) {
101
+					vm_page_lock(m);
102
+					vm_page_activate(m);
103
+					vm_page_unlock(m);
104
+				} else {
105
+					vm_page_lock(m);
106
+					vm_page_deactivate(m);
107
+					vm_page_unlock(m);
108
+				}
109
+				vm_page_wakeup(m);
110
+			} else {
111
+				vm_page_lock(m);
112
+				vm_page_free(m);
113
+				vm_page_unlock(m);
114
+			}
115
+		}
116
 	}
117
 	fuse_vm_page_unlock_queues();
118
-	VM_OBJECT_WUNLOCK(vp->v_object);
119
+	VM_OBJECT_UNLOCK(vp->v_object);
120
 	return 0;
121
 }
122
 
123
@@ -1947,9 +1975,9 @@ fuse_vnop_putpages(struct vop_putpages_args *ap)
124
 
125
 		for (i = 0; i < nwritten; i++) {
126
 			rtvals[i] = VM_PAGER_OK;
127
-			VM_OBJECT_WLOCK(pages[i]->object);
128
+			VM_OBJECT_LOCK(pages[i]->object);
129
 			vm_page_undirty(pages[i]);
130
-			VM_OBJECT_WUNLOCK(pages[i]->object);
131
+			VM_OBJECT_UNLOCK(pages[i]->object);
132
 		}
133
 	}
134
 	return rtvals[0];
(-)a/sysutils/fusefs-kmod/files/extra-patch-fuse_module__fuse_vnops.c (-11 lines)
Removed Link Here
1
--- fuse_module/fuse_vfsops.c.orig	2008-02-05 07:25:57.000000000 +0200
2
+++ fuse_module/fuse_vfsops.c	2011-09-08 10:27:43.000000000 +0300
3
@@ -224,7 +231,7 @@
4
 	struct cdev *fdev;
5
 	struct sx *slock;
6
 	struct fuse_data *data;
7
-	int mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0;
8
+	uint64_t mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0;
9
 	unsigned max_read = ~0;
10
 	struct vnode *rvp;
11
 	struct fuse_vnode_data *fvdat;
(-)a/sysutils/fusefs-kmod/files/extrapatch-fuse_module__fuse_vnops.c (-11 lines)
Removed Link Here
1
--- fuse_module/fuse_vnops.c.orig	2012-05-11 14:59:59.000000000 +0800
2
+++ fuse_module/fuse_vnops.c	2012-05-11 15:00:05.000000000 +0800
3
@@ -663,7 +663,7 @@
4
 	if ((err = fuse_recyc_backend(vp, td)))
5
 		return err;
6
 
7
-	vrecycle(vp, td);
8
+	vrecycle(vp);
9
 
10
 	return (0);
11
 }
(-)b/sysutils/fusefs-kmod/files/fusefs.in (-1 / +1 lines)
Lines 27-33 Link Here
27
name="fusefs"
27
name="fusefs"
28
rcvar=fusefs_enable
28
rcvar=fusefs_enable
29
29
30
kmod="%%PREFIX%%/modules/fuse.ko"
30
kmod="%%KMODDIR%%/fuse.ko"
31
31
32
start_cmd="fusefs_start"
32
start_cmd="fusefs_start"
33
stop_cmd="fusefs_stop"
33
stop_cmd="fusefs_stop"
(-)b/sysutils/fusefs-kmod/files/patch-fuse_io.c (+14 lines)
Added Link Here
1
--- fs/fuse/fuse_io.c.orig
2
+++ fs/fuse/fuse_io.c
3
@@ -785,9 +785,9 @@ fuse_io_invalbuf(struct vnode *vp, struct thread *td)
4
 	fvdat->flag |= FN_FLUSHINPROG;
5
 
6
 	if (vp->v_bufobj.bo_object != NULL) {
7
-		VM_OBJECT_WLOCK(vp->v_bufobj.bo_object);
8
+		VM_OBJECT_LOCK(vp->v_bufobj.bo_object);
9
 		vm_object_page_clean(vp->v_bufobj.bo_object, 0, 0, OBJPC_SYNC);
10
-		VM_OBJECT_WUNLOCK(vp->v_bufobj.bo_object);
11
+		VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object);
12
 	}
13
 	error = vinvalbuf(vp, V_SAVE, PCATCH, 0);
14
 	while (error) {
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__Makefile (-18 lines)
Removed Link Here
1
--- fuse_module/Makefile.orig	2008-02-05 08:25:57.000000000 +0300
2
+++ fuse_module/Makefile	2009-01-14 00:29:13.000000000 +0300
3
@@ -1,3 +1,5 @@
4
+.undef KERNCONF
5
+
6
 .include "../Makefile.common"
7
 
8
 SRCS = fuse_main.c    \
9
@@ -22,7 +24,8 @@
10
 
11
 .if defined(KERNCONF)
12
 KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g'
13
-KERNCONFDIR= /usr/obj/usr/src/sys/${KERNCONF1}
14
+KRNLOBJDIR!=	make -C /usr/src -f /usr/src/Makefile.inc1 -V KRNLOBJDIR
15
+KERNCONFDIR= ${KRNLOBJDIR}/${KERNCONF1}
16
 .endif
17
 
18
 .if defined(KERNCONFDIR)
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse.h (-40 lines)
Removed Link Here
1
--- fuse_module/fuse.h.orig	2008-02-05 00:25:57.000000000 -0500
2
+++ fuse_module/fuse.h	2009-05-13 18:40:19.000000000 -0400
3
@@ -25,6 +25,22 @@
4
 #endif
5
 #endif
6
 
7
+#ifndef VFSOPS_TAKES_THREAD
8
+#if __FreeBSD_version >= 800087
9
+#define VFSOPS_TAKES_THREAD 0
10
+#else
11
+#define VFSOPS_TAKES_THREAD 1
12
+#endif
13
+#endif
14
+
15
+#ifndef VOP_ACCESS_TAKES_ACCMODE_T
16
+#if __FreeBSD_version >= 800052
17
+#define VOP_ACCESS_TAKES_ACCMODE_T 1
18
+#else
19
+#define VOP_ACCESS_TAKES_ACCMODE_T 0
20
+#endif
21
+#endif
22
+
23
 #ifndef VOP_OPEN_TAKES_FP
24
 #if __FreeBSD_version >= 700044
25
 #define VOP_OPEN_TAKES_FP 1
26
@@ -49,6 +65,14 @@
27
 #endif
28
 #endif
29
 
30
+#ifndef VOP_GETATTR_TAKES_THREAD
31
+#if __FreeBSD_version >= 800046
32
+#define VOP_GETATTR_TAKES_THREAD 0
33
+#else
34
+#define VOP_GETATTR_TAKES_THREAD 1
35
+#endif
36
+#endif
37
+
38
 #ifndef USE_PRIVILEGE_API
39
 /*
40
  * __FreeBSD_version bump was omitted for introduction of
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_dev.c (-31 lines)
Removed Link Here
1
--- fuse_module/fuse_dev.c
2
+++ fuse_module/fuse_dev.c
3
@@ -52,8 +52,13 @@
4
 	.d_read = fusedev_read,
5
 	.d_write = fusedev_write,
6
 	.d_version = D_VERSION,
7
+#ifndef D_NEEDMINOR
8
+#define D_NEEDMINOR 0
9
+#endif
10
 #if ! DO_GIANT_MANUALLY
11
-	.d_flags = D_NEEDGIANT,
12
+	.d_flags = D_NEEDMINOR|D_NEEDGIANT,
13
+#else
14
+	.d_flags = D_NEEDMINOR,
15
 #endif
16
 };
17
 
18
@@ -548,7 +553,12 @@
19
 	/* find any existing device, or allocate new unit number */
20
 	i = clone_create(&fuseclones, &fuse_cdevsw, &unit, dev, 0);
21
 	if (i) {
22
-		*dev = make_dev(&fuse_cdevsw, unit2minor(unit),
23
+		*dev = make_dev(&fuse_cdevsw,
24
+#if __FreeBSD_version < 800062
25
+				unit2minor(unit),
26
+#else /* __FreeBSD_version >= 800062 */
27
+				unit,
28
+#endif /* __FreeBSD_version < 800062 */
29
 			        UID_ROOT, GID_OPERATOR,
30
 		                S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
31
                                 "fuse%d", unit);
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_io.c (-133 lines)
Removed Link Here
1
--- fuse_module/fuse_io.c.orig	2008-02-05 00:25:57.000000000 -0500
2
+++ fuse_module/fuse_io.c	2009-07-13 09:31:24.000000000 -0400
3
@@ -35,6 +35,10 @@
4
 #include <vm/vnode_pager.h>
5
 #include <vm/vm_object.h>
6
 
7
+#if (__FreeBSD_version >= 800000)
8
+#define vfs_bio_set_validclean vfs_bio_set_valid
9
+#endif
10
+
11
 #include "fuse.h"
12
 #include "fuse_session.h"
13
 #include "fuse_vnode.h"
14
@@ -157,7 +161,11 @@
15
 		goto out;
16
 
17
 	if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) {
18
-		if ((err = VOP_GETATTR(vp, &va, cred, td)))
19
+		if ((err = VOP_GETATTR(vp, &va, cred
20
+#if VOP_GETATTR_TAKES_THREAD
21
+		    , td
22
+#endif
23
+		    )))
24
 			goto out;
25
 		uio->uio_offset = va.va_size;
26
 	} else if ((flags & FOF_OFFSET) == 0)
27
@@ -227,7 +235,7 @@
28
 		return (0);
29
 
30
 	biosize = vp->v_mount->mnt_stat.f_iosize;
31
-	bcount = min(MAXBSIZE, biosize);
32
+	bcount = MIN(MAXBSIZE, biosize);
33
 
34
 	DEBUG2G("entering loop\n");
35
 	do {
36
@@ -352,7 +360,7 @@
37
 		fri = fdi.indata;
38
 		fri->fh = fufh->fh_id;
39
 		fri->offset = uio->uio_offset;
40
-		fri->size = min(uio->uio_resid,
41
+		fri->size = MIN(uio->uio_resid,
42
 		                fusefs_get_data(vp->v_mount)->max_read);
43
 	
44
 		DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n",
45
@@ -399,7 +407,7 @@
46
 	while (uio->uio_resid > 0) {
47
 		int transfersize;
48
 
49
-		chunksize = min(iov->iov_len, nmax);
50
+		chunksize = MIN(iov->iov_len, nmax);
51
 
52
 		if (uio->uio_rw == UIO_READ) {
53
 			struct fuse_read_in *fri;
54
@@ -464,7 +472,7 @@
55
 {
56
 		int err;
57
 
58
-		if ((err = uiomove(buf, min(reqsize, bufsize), uio)))
59
+		if ((err = uiomove(buf, MIN(reqsize, bufsize), uio)))
60
 			return (err);
61
 
62
 		if (bufsize < reqsize)
63
@@ -502,7 +510,7 @@
64
 	}
65
 
66
 	while (uio->uio_resid > 0) {
67
-		chunksize = min(uio->uio_resid,
68
+		chunksize = MIN(uio->uio_resid,
69
 		                fusefs_get_data(vp->v_mount)->max_write);
70
 
71
 		fdi.iosize = sizeof(*fwi) + chunksize;
72
@@ -569,7 +577,7 @@
73
 	do {
74
 		lbn = uio->uio_offset / biosize;
75
 		on = uio->uio_offset & (biosize-1);
76
-		n = min((unsigned)(biosize - on), uio->uio_resid);
77
+		n = MIN((unsigned)(biosize - on), uio->uio_resid);
78
 		
79
 		DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n",
80
 		        (int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid);
81
@@ -739,8 +747,8 @@
82
 		 */
83
 		if (n) {
84
 			if (bp->b_dirtyend > 0) {
85
-				bp->b_dirtyoff = min(on, bp->b_dirtyoff);
86
-				bp->b_dirtyend = max((on + n), bp->b_dirtyend);
87
+				bp->b_dirtyoff = MIN(on, bp->b_dirtyoff);
88
+				bp->b_dirtyend = MAX((on + n), bp->b_dirtyend);
89
 			} else {
90
 				bp->b_dirtyoff = on;
91
 				bp->b_dirtyend = on + n;
92
@@ -823,7 +831,11 @@
93
 #if FUSELIB_CONFORM_BIOREAD
94
 		struct vattr va;
95
 
96
-		if ((err = VOP_GETATTR(vp, &va, cred, curthread)))
97
+		if ((err = VOP_GETATTR(vp, &va, cred
98
+#if VOP_GETATTR_TAKES_THREAD
99
+		    , curthread
100
+#endif
101
+		    )))
102
 			goto out;
103
 #endif
104
 
105
@@ -831,7 +843,7 @@
106
 		bp->b_resid = bp->b_bcount;
107
 		while (bp->b_resid > 0) {
108
 			DEBUG2G("starting bio with resid %ld\n", bp->b_resid);	
109
-			chunksize = min(bp->b_resid,
110
+			chunksize = MIN(bp->b_resid,
111
 			                fusefs_get_data(vp->v_mount)->max_read);
112
 			fdi.iosize = sizeof(*fri);
113
 			if (! op)
114
@@ -842,8 +854,8 @@
115
 			fri->fh = fufh->fh_id;
116
 			fri->offset = ((off_t)bp->b_blkno) * biosize + ioff;
117
 #if FUSELIB_CONFORM_BIOREAD
118
-			chunksize = min(chunksize,
119
-			                min(fri->offset + bp->b_resid,
120
+			chunksize = MIN(chunksize,
121
+			                MIN(fri->offset + bp->b_resid,
122
 			                    va.va_size) - fri->offset);
123
 			if (chunksize == 0) {
124
 				respsize = -1;
125
@@ -901,7 +913,7 @@
126
 
127
 		bufdat = bp->b_data + bp->b_dirtyoff;
128
 		while (bp->b_dirtyend > bp->b_dirtyoff) {
129
-			chunksize = min(bp->b_dirtyend - bp->b_dirtyoff,
130
+			chunksize = MIN(bp->b_dirtyend - bp->b_dirtyoff,
131
 			                fusefs_get_data(vp->v_mount)->max_write);
132
 	
133
 			fdi.iosize = sizeof(*fwi);
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_main.c (-14 lines)
Removed Link Here
1
--- fuse_module/fuse_main.c.00	2010-08-15 14:40:29.000000000 +0400
2
+++ fuse_module/fuse_main.c	2010-08-15 15:56:56.000000000 +0400
3
@@ -108,6 +108,9 @@
4
 	switch (what) {
5
 	case MOD_LOAD:                /* kldload */
6
 
7
+#if __FreeBSD_version > 800009
8
+	        fuse_fileops.fo_truncate = vnops.fo_truncate;
9
+#endif
10
 		fuse_fileops.fo_ioctl    = vnops.fo_ioctl;
11
 		fuse_fileops.fo_poll     = vnops.fo_poll;
12
 		fuse_fileops.fo_kqfilter = vnops.fo_kqfilter;
13
14
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vfsops.c (-122 lines)
Removed Link Here
1
--- fuse_module/fuse_vfsops.c.orig	2008-02-05 00:25:57.000000000 -0500
2
+++ fuse_module/fuse_vfsops.c	2009-05-13 18:54:01.000000000 -0400
3
@@ -18,6 +18,7 @@
4
 #include <sys/namei.h>
5
 #include <sys/mount.h>
6
 #include <sys/sysctl.h>
7
+#include <sys/fcntl.h>
8
 
9
 #include "fuse.h"
10
 #include "fuse_session.h"
11
@@ -213,8 +214,14 @@
12
  * Mount system call
13
  */
14
 static int
15
+#if VFSOPS_TAKES_THREAD
16
 fuse_mount(struct mount *mp, struct thread *td)
17
 {
18
+#else
19
+fuse_mount(struct mount *mp)
20
+{
21
+	struct thread *td = curthread;
22
+#endif
23
 	int err = 0;
24
 	size_t len;
25
 	char *fspec, *subtype = NULL;
26
@@ -529,8 +536,14 @@
27
  * Unmount system call
28
  */
29
 static int
30
+#if VFSOPS_TAKES_THREAD
31
 fuse_unmount(struct mount *mp, int mntflags, struct thread *td)
32
 {
33
+#else
34
+fuse_unmount(struct mount *mp, int mntflags)
35
+{
36
+	struct thread *td = curthread;
37
+#endif
38
 	int flags = 0, err = 0;
39
 	struct fuse_data *data;
40
 	struct fuse_secondary_data *fsdat = NULL;
41
@@ -633,8 +646,14 @@
42
 
43
 /* stolen from portalfs */
44
 static int
45
+#if VFSOPS_TAKES_THREAD
46
 fuse_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td)
47
 {
48
+#else
49
+fuse_root(struct mount *mp, int flags, struct vnode **vpp)
50
+{
51
+	struct thread *td = curthread;
52
+#endif
53
 	/*
54
 	 * Return locked reference to root.
55
 	 */
56
@@ -650,7 +669,11 @@
57
 		data = fsdat->master;
58
 		sx_slock(&data->mhierlock);
59
 		if (data->mpri == FM_PRIMARY)
60
-			err = fuse_root(data->mp, flags, vpp, td);
61
+			err = fuse_root(data->mp, flags, vpp
62
+#if VFSOPS_TAKES_THREAD
63
+			    , td
64
+#endif
65
+			    );
66
 		else
67
 			err = ENXIO;
68
 		sx_sunlock(&data->mhierlock);
69
@@ -667,7 +690,11 @@
70
 	if (vp->v_type == VNON) {
71
 		struct vattr va;
72
 
73
-		(void)VOP_GETATTR(vp, &va, td->td_ucred, td);
74
+		(void)VOP_GETATTR(vp, &va, td->td_ucred
75
+#if VOP_GETATTR_TAKES_THREAD
76
+		    , td
77
+#endif
78
+		);
79
 	}
80
 	*vpp = vp;
81
 #if _DEBUG2G
82
@@ -678,8 +705,14 @@
83
 }
84
 
85
 static int
86
+#if VFSOPS_TAKES_THREAD
87
 fuse_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
88
 {
89
+#else
90
+fuse_statfs(struct mount *mp, struct statfs *sbp)
91
+{
92
+	struct thread *td = curthread;
93
+#endif
94
 	struct fuse_dispatcher fdi;
95
 	struct fuse_statfs_out *fsfo;
96
 	struct fuse_data *data;
97
@@ -696,7 +729,11 @@
98
 
99
 		sx_slock(&data->mhierlock);
100
 		if (data->mpri == FM_PRIMARY)
101
-			err = fuse_statfs(data->mp, sbp, td);
102
+			err = fuse_statfs(data->mp, sbp
103
+#if VFSOPS_TAKES_THREAD
104
+			    , td
105
+#endif
106
+			    );
107
 		else
108
 			err = ENXIO;
109
 		sx_sunlock(&data->mhierlock);
110
@@ -794,7 +831,11 @@
111
 	if (nodeid == FUSE_ROOT_ID) {
112
 		if (parentid != FUSE_NULL_ID)
113
 			return (ENOENT);
114
-		err = VFS_ROOT(mp, myflags, vpp, td);
115
+		err = VFS_ROOT(mp, myflags, vpp
116
+#if VFSOPS_TAKES_THREAD
117
+		    , td
118
+#endif
119
+		    );
120
 		if (err)
121
 			return (err);
122
 		KASSERT(*vpp, ("we neither err'd nor found the root node"));
(-)a/sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vnops.c (-89 lines)
Removed Link Here
1
--- ./fuse_module/fuse_vnops.c.orig	2012-09-19 06:04:10.512413490 +0200
2
+++ ./fuse_module/fuse_vnops.c	2012-09-19 06:20:44.949613892 +0200
3
@@ -799,8 +799,11 @@
4
 	struct vnode *vp = ap->a_vp;
5
 	struct vattr *vap = ap->a_vap;
6
 	struct ucred *cred = ap->a_cred;
7
+#if VOP_GETATTR_TAKES_THREAD
8
 	struct thread *td = ap->a_td;
9
-
10
+#else
11
+	struct thread *td = curthread;
12
+#endif
13
 	struct fuse_dispatcher fdi;
14
 	struct timespec uptsp;
15
 	int err = 0;
16
@@ -871,7 +874,11 @@
17
 fuse_access(ap)
18
 	struct vop_access_args /* {
19
 		struct vnode *a_vp;
20
+#if VOP_ACCESS_TAKES_ACCMODE_T
21
+		accmode_t a_accmode;
22
+#else
23
 		int a_mode;
24
+#endif
25
 		struct ucred *a_cred;
26
 		struct thread *a_td;
27
 	} */ *ap;
28
@@ -886,7 +893,13 @@
29
 	else
30
 		facp.facc_flags |= FACCESS_DO_ACCESS;
31
 
32
-	return fuse_access_i(vp, ap->a_mode, ap->a_cred, ap->a_td, &facp);
33
+	return fuse_access_i(vp,
34
+#if VOP_ACCESS_TAKES_ACCMODE_T
35
+	    ap->a_accmode,
36
+#else
37
+	    ap->a_mode,
38
+#endif
39
+	    ap->a_cred, ap->a_td, &facp);
40
 }
41
 
42
 /*
43
@@ -946,7 +959,11 @@
44
 		/* We are to do the check in-kernel */
45
 
46
 		if (! (facp->facc_flags & FACCESS_VA_VALID)) {
47
-			err = VOP_GETATTR(vp, VTOVA(vp), cred, td);
48
+			err = VOP_GETATTR(vp, VTOVA(vp), cred
49
+#if VOP_GETATTR_TAKES_THREAD
50
+			    , td
51
+#endif
52
+			    );
53
 			if (err)
54
 				return (err);
55
 			facp->facc_flags |= FACCESS_VA_VALID;
56
@@ -1544,7 +1561,7 @@
57
 	struct fuse_vnode_data *fvdat = VTOFUD(vp);
58
 	uint64_t parentid = fvdat->parent_nid;
59
 	struct componentname *cnp = fvdat->germcnp;
60
-	struct fuse_open_in *foi;
61
+	struct fuse_create_in *foi;
62
 	struct fuse_entry_out *feo;
63
 	struct fuse_mknod_in fmni;
64
 	int err;
65
@@ -1929,7 +1946,11 @@
66
 		 * It will not invalidate pages which are dirty, locked, under
67
 		 * writeback or mapped into pagetables.") 
68
 		 */
69
+#if VOP_GETATTR_TAKES_THREAD
70
 		err = vinvalbuf(vp, 0, td, PCATCH, 0);
71
+#else
72
+		err = vinvalbuf(vp, 0, PCATCH, 0);
73
+#endif
74
 		fufh->flags |= FOPEN_KEEP_CACHE;
75
 	}
76
 
77
@@ -3005,8 +3026,11 @@
78
 	struct vattr *vap = ap->a_vap;
79
 	struct vnode *vp = ap->a_vp;
80
 	struct ucred *cred = ap->a_cred;
81
+#if VOP_GETATTR_TAKES_THREAD
82
 	struct thread *td = ap->a_td;
83
-
84
+#else
85
+	struct thread *td = curthread;
86
+#endif
87
 	int err = 0;
88
 	struct fuse_dispatcher fdi;
89
 	struct fuse_setattr_in *fsai;
(-)b/sysutils/fusefs-kmod/files/patch-fuse_node.c (+11 lines)
Added Link Here
1
--- fs/fuse/fuse_node.c.orig
2
+++ fs/fuse/fuse_node.c
3
@@ -362,7 +362,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize)
4
 	fvdat->flag |= FN_SIZECHANGE;
5
 
6
 	if (newsize < oldsize) {
7
-		err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp));
8
+		err = vtruncbuf(vp, cred, curthread, newsize, fuse_iosize(vp));
9
 	}
10
 	vnode_pager_setsize(vp, newsize);
11
 	return err;
(-)a/sysutils/fusefs-kmod/files/patch-mount_fusefs__mount_fusefs.c (-23 lines)
Removed Link Here
1
--- mount_fusefs/mount_fusefs.c	2008-02-05 07:25:57.000000000 +0200
2
+++ mount_fusefs/mount_fusefs.c	2012-01-07 21:07:35.000000000 +0200
3
@@ -44,6 +44,7 @@
4
 #include <getopt.h>
5
 #include <libgen.h>
6
 #include <limits.h>
7
+#include <osreldate.h>
8
 #include <paths.h>
9
 
10
 #include "fuse4bsd.h"
11
@@ -312,7 +313,12 @@
12
 	 * Resolve the mountpoint with realpath(3) and remove unnecessary
13
 	 * slashes from the devicename if there are any.
14
 	 */
15
+#if __FreeBSD_version >= 1000005
16
+	if (checkpath(dir, mntpath) != 0)
17
+		err(1, "%s", mntpath);
18
+#else
19
 	(void)checkpath(dir, mntpath);
20
+#endif
21
 	(void)rmslashes(dev, dev);
22
 
23
 	if (strcmp(dev, "auto") == 0)
(-)a/sysutils/fusefs-kmod/files/setup.sh.in (-52 lines)
Removed Link Here
1
#!/bin/sh
2
#
3
# Automatically setup the loading of the module without polluting /boot/modules
4
SYSCTL_CONFIG=/etc/sysctl.conf
5
LOADER_CONFIG=/etc/rc.conf
6
7
sysctl kern.module_path | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
8
if [ ${RESULT} -eq 1 ]; then
9
	MODULE_PATH="`sysctl -n kern.module_path`;%%PREFIX%%/modules"
10
	sysctl "kern.module_path=${MODULE_PATH}"
11
else
12
	MODULE_PATH=`sysctl -n kern.module_path`
13
fi
14
15
grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
16
if [ ${RESULT} -eq 0 ]; then
17
	# Variable present
18
	grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]%%PREFIX%%/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
19
	if [ ${RESULT} -eq 1 ]; then
20
		# Not present in variable, so add
21
		ESC_PREFIX=`echo '%%PREFIX%%' | sed -e 's/\//\\\\\//g'`
22
		sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
23
	fi
24
else
25
	# Not present.
26
	echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
27
fi
28
29
30
kldstat -n fuse > /dev/null 2>&1; RESULT=$?
31
if [ ${RESULT} -eq 0 ]; then
32
	kldunload -n fuse > /dev/null 2>&1; RESULT=$?
33
	if [ ${RESULT} -ne 0 ]; then
34
		echo 'NOTICE: Failed to unload the Fuse module!'
35
		echo 'NOTICE: Is fuse.ko in use?'
36
	fi
37
fi
38
39
grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
40
if [ ${RESULT} -eq 0 ]; then
41
	# Present, we should leave it alone
42
#	sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
43
else
44
	# Not present. First time install, so lets start it up
45
	echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
46
fi
47
48
kldload fuse > /dev/null 2>&1 ; RESULT=$?
49
if [ ${RESULT} -ne 0 ]; then
50
	echo 'NOTICE: Failed to load the Fuse module!'
51
	echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
52
fi
(-)b/sysutils/fusefs-kmod/pkg-descr (-3 / +1 lines)
Lines 1-3 Link Here
1
Kernel module for fusefs based filesystems.
1
FUSE kernel module
2
3
WWW: http://fuse4bsd.creo.hu/
(-)b/sysutils/fusefs-kmod/pkg-plist (-22 / +4 lines)
Lines 1-24 Link Here
1
man/man8/mount_fusefs.8.gz
1
sbin/mount_fusefs
2
sbin/mount_fusefs
2
@exec ln -fs %D/%F /usr/sbin
3
@exec ln -fs %D/%F /usr/sbin
3
@unexec rm -f /usr/sbin/mount_fusefs
4
@unexec rm -f %D/usr/sbin/mount_fusefs
4
%%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
5
@cwd /
5
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html
6
%%KMODDIR%%/fuse.ko
6
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Implementation.html
7
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/Quickstart.html
8
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/article.css
9
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/deplate-mini.png
10
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/deplate.css
11
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/doc.html
12
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/heading-navbar.css
13
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/home-grey.png
14
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/mailto.png
15
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/next-grey.png
16
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/prev-grey.png
17
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/remote.png
18
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/serif.css
19
%%PORTDOCS%%%%DOCSDIR%%/kmod/html/tabbar-right.css
20
%%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod/html
21
%%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod
22
@dirrmtry %%DOCSDIR%%
23
@cwd /%%KMODDIR%%
24
fuse.ko

Return to bug 184042