Sun May 3 20:26:42 2009 UTC ()
make it possible to disable puffs caches


(pooka)
diff -r1.3 -r1.4 src/lib/libp2k/p2k.3
diff -r1.12 -r1.13 src/lib/libp2k/p2k.c

cvs diff -r1.3 -r1.4 src/lib/libp2k/p2k.3 (expand / switch to unified diff)

--- src/lib/libp2k/p2k.3 2009/02/10 14:40:30 1.3
+++ src/lib/libp2k/p2k.3 2009/05/03 20:26:42 1.4
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1.\" $NetBSD: p2k.3,v 1.3 2009/02/10 14:40:30 pooka Exp $ 1.\" $NetBSD: p2k.3,v 1.4 2009/05/03 20:26:42 pooka Exp $
2.\" 2.\"
3.\" Copyright (c) 2008 Antti Kantee. All rights reserved. 3.\" Copyright (c) 2008 Antti Kantee. All rights reserved.
4.\" 4.\"
5.\" Redistribution and use in source and binary forms, with or without 5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions 6.\" modification, are permitted provided that the following conditions
7.\" are met: 7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright 8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer. 9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the 11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution. 12.\" documentation and/or other materials provided with the distribution.
13.\" 13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE. 24.\" SUCH DAMAGE.
25.\" 25.\"
26.Dd February 10, 2009 26.Dd May 3, 2009
27.Dt P2K 3 27.Dt P2K 3
28.Os 28.Os
29.Sh NAME 29.Sh NAME
30.Nm p2k 30.Nm p2k
31.Nd puffs to kernel vfs translation library 31.Nd puffs to kernel vfs translation library
32.Sh LIBRARY 32.Sh LIBRARY
33p2k Library (libp2k, \-lp2k) 33p2k Library (libp2k, \-lp2k)
34.Sh SYNOPSIS 34.Sh SYNOPSIS
35.In rump/p2k.h 35.In rump/p2k.h
36.Ft int 36.Ft int
37.Fo p2k_run_fs 37.Fo p2k_run_fs
38.Fa "const char *vfsname" "const char *devpath" "const char *mountpath" 38.Fa "const char *vfsname" "const char *devpath" "const char *mountpath"
39.Fa "int mntflags" "void *arg" "size_t alen" "uint32_t puffs_flags" 39.Fa "int mntflags" "void *arg" "size_t alen" "uint32_t puffs_flags"
@@ -59,31 +59,37 @@ and @@ -59,31 +59,37 @@ and
59are handled by 59are handled by
60.Xr puffs 3 . 60.Xr puffs 3 .
61.Pp 61.Pp
62The following environment variables affect the behaviour of puffs. 62The following environment variables affect the behaviour of puffs.
63They are useful mostly for debugging purposes. 63They are useful mostly for debugging purposes.
64The flags are environment variables because typically the command line 64The flags are environment variables because typically the command line
65arguments to 65arguments to
66.Nm 66.Nm
67utilities are parsed using versions not aware of possible puffs flags: 67utilities are parsed using versions not aware of possible puffs flags:
68for example, the 68for example, the
69.Xr rump_cd9660 8 69.Xr rump_cd9660 8
70arguments are really parsed by 70arguments are really parsed by
71.Xr mount_cd9660 8 . 71.Xr mount_cd9660 8 .
72.Bl -tag -width "XXXP2K_NODETACH" 72.Bl -tag -width "XP2K_NOCACHE_PAGE"
73.It Dv P2K_DEBUG 73.It Dv P2K_DEBUG
74Do not detach from tty and print information about each puffs operation. 74Do not detach from tty and print information about each puffs operation.
75.It Dv P2K_NODETACH 75.It Dv P2K_NODETACH
76Do not detach from tty. 76Do not detach from tty.
 77.It Dv P2K_NOCACHE_PAGE
 78Do not use the puffs page cache.
 79.It Dv P2K_NOCACHE_NAME
 80Do not use the puffs name cache.
 81.It Dv P2K_NOCACHE
 82Do not use the puffs page or name cache.
77.El 83.El
78.Sh SEE ALSO 84.Sh SEE ALSO
79.Xr puffs 3 , 85.Xr puffs 3 ,
80.Xr rump 3 , 86.Xr rump 3 ,
81.Xr ukfs 3 , 87.Xr ukfs 3 ,
82.Xr rump_cd9660 8 , 88.Xr rump_cd9660 8 ,
83.Xr rump_efs 8 , 89.Xr rump_efs 8 ,
84.Xr rump_ext2fs 8 , 90.Xr rump_ext2fs 8 ,
85.Xr rump_ffs 8 , 91.Xr rump_ffs 8 ,
86.Xr rump_hfs 8 , 92.Xr rump_hfs 8 ,
87.Xr rump_lfs 8 , 93.Xr rump_lfs 8 ,
88.Xr rump_msdos 8 , 94.Xr rump_msdos 8 ,
89.Xr rump_nfs 8 , 95.Xr rump_nfs 8 ,

cvs diff -r1.12 -r1.13 src/lib/libp2k/p2k.c (expand / switch to unified diff)

--- src/lib/libp2k/p2k.c 2009/05/03 17:10:20 1.12
+++ src/lib/libp2k/p2k.c 2009/05/03 20:26:42 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: p2k.c,v 1.12 2009/05/03 17:10:20 pooka Exp $ */ 1/* $NetBSD: p2k.c,v 1.13 2009/05/03 20:26:42 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by Google Summer of Code. 6 * Development of this software was supported by Google Summer of Code.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -199,26 +199,35 @@ p2k_run_fs(const char *vfsname, const ch @@ -199,26 +199,35 @@ p2k_run_fs(const char *vfsname, const ch
199 PUFFSOP_SET(pops, p2k, node, write); 199 PUFFSOP_SET(pops, p2k, node, write);
200 200
201 PUFFSOP_SET(pops, p2k, node, inactive); 201 PUFFSOP_SET(pops, p2k, node, inactive);
202 PUFFSOP_SET(pops, p2k, node, reclaim); 202 PUFFSOP_SET(pops, p2k, node, reclaim);
203 203
204 dodaemon = true; 204 dodaemon = true;
205 if (getenv("P2K_DEBUG") != NULL) { 205 if (getenv("P2K_DEBUG") != NULL) {
206 puffs_flags |= PUFFS_FLAG_OPDUMP; 206 puffs_flags |= PUFFS_FLAG_OPDUMP;
207 dodaemon = false; 207 dodaemon = false;
208 } 208 }
209 if (getenv("P2K_NODETACH") != NULL) { 209 if (getenv("P2K_NODETACH") != NULL) {
210 dodaemon = false; 210 dodaemon = false;
211 } 211 }
 212 if (getenv("P2K_NOCACHE_PAGE") != NULL) {
 213 puffs_flags |= PUFFS_KFLAG_NOCACHE_PAGE;
 214 }
 215 if (getenv("P2K_NOCACHE_NAME") != NULL) {
 216 puffs_flags |= PUFFS_KFLAG_NOCACHE_NAME;
 217 }
 218 if (getenv("P2K_NOCACHE") != NULL) {
 219 puffs_flags |= PUFFS_KFLAG_NOCACHE;
 220 }
212 221
213 strcpy(typebuf, "p2k|"); 222 strcpy(typebuf, "p2k|");
214 if (strcmp(vfsname, "puffs") == 0) { /* XXX */ 223 if (strcmp(vfsname, "puffs") == 0) { /* XXX */
215 struct puffs_kargs *args = arg; 224 struct puffs_kargs *args = arg;
216 strlcat(typebuf, args->pa_typename, sizeof(typebuf)); 225 strlcat(typebuf, args->pa_typename, sizeof(typebuf));
217 dodaemon = false; 226 dodaemon = false;
218 } else { 227 } else {
219 strlcat(typebuf, vfsname, sizeof(typebuf)); 228 strlcat(typebuf, vfsname, sizeof(typebuf));
220 } 229 }
221 230
222 pu = puffs_init(pops, devpath, typebuf, NULL, puffs_flags); 231 pu = puffs_init(pops, devpath, typebuf, NULL, puffs_flags);
223 if (pu == NULL) 232 if (pu == NULL)
224 goto out; 233 goto out;