Sun Mar 15 17:22:38 2009 UTC ()
ansify function definitions


(cegger)
diff -r1.105 -r1.106 src/sys/miscfs/fdesc/fdesc_vnops.c
diff -r1.26 -r1.27 src/sys/miscfs/genfs/layer_subr.c
diff -r1.19 -r1.20 src/sys/miscfs/kernfs/kernfs_subr.c
diff -r1.88 -r1.89 src/sys/miscfs/kernfs/kernfs_vfsops.c
diff -r1.78 -r1.79 src/sys/miscfs/portal/portal_vfsops.c
diff -r1.94 -r1.95 src/sys/miscfs/procfs/procfs_subr.c
diff -r1.82 -r1.83 src/sys/miscfs/procfs/procfs_vfsops.c
diff -r1.39 -r1.40 src/sys/miscfs/syncfs/sync_subr.c
diff -r1.27 -r1.28 src/sys/miscfs/umapfs/umap_subr.c

cvs diff -r1.105 -r1.106 src/sys/miscfs/fdesc/fdesc_vnops.c (expand / switch to unified diff)

--- src/sys/miscfs/fdesc/fdesc_vnops.c 2009/03/14 15:36:22 1.105
+++ src/sys/miscfs/fdesc/fdesc_vnops.c 2009/03/15 17:22:37 1.106
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fdesc_vnops.c,v 1.105 2009/03/14 15:36:22 dsl Exp $ */ 1/* $NetBSD: fdesc_vnops.c,v 1.106 2009/03/15 17:22:37 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software donated to Berkeley by 7 * This code is derived from software donated to Berkeley by
8 * Jan-Simon Pendry. 8 * Jan-Simon Pendry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -31,27 +31,27 @@ @@ -31,27 +31,27 @@
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 * @(#)fdesc_vnops.c 8.17 (Berkeley) 5/22/95 34 * @(#)fdesc_vnops.c 8.17 (Berkeley) 5/22/95
35 * 35 *
36 * #Id: fdesc_vnops.c,v 1.12 1993/04/06 16:17:17 jsp Exp # 36 * #Id: fdesc_vnops.c,v 1.12 1993/04/06 16:17:17 jsp Exp #
37 */ 37 */
38 38
39/* 39/*
40 * /dev/fd Filesystem 40 * /dev/fd Filesystem
41 */ 41 */
42 42
43#include <sys/cdefs.h> 43#include <sys/cdefs.h>
44__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.105 2009/03/14 15:36:22 dsl Exp $"); 44__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.106 2009/03/15 17:22:37 cegger Exp $");
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/time.h> 48#include <sys/time.h>
49#include <sys/proc.h> 49#include <sys/proc.h>
50#include <sys/kernel.h> /* boottime */ 50#include <sys/kernel.h> /* boottime */
51#include <sys/resourcevar.h> 51#include <sys/resourcevar.h>
52#include <sys/socketvar.h> 52#include <sys/socketvar.h>
53#include <sys/filedesc.h> 53#include <sys/filedesc.h>
54#include <sys/vnode.h> 54#include <sys/vnode.h>
55#include <sys/malloc.h> 55#include <sys/malloc.h>
56#include <sys/conf.h> 56#include <sys/conf.h>
57#include <sys/file.h> 57#include <sys/file.h>
@@ -172,41 +172,41 @@ const struct vnodeopv_entry_desc fdesc_v @@ -172,41 +172,41 @@ const struct vnodeopv_entry_desc fdesc_v
172 { &vop_putpages_desc, fdesc_putpages }, /* putpages */ 172 { &vop_putpages_desc, fdesc_putpages }, /* putpages */
173 { NULL, NULL } 173 { NULL, NULL }
174}; 174};
175 175
176const struct vnodeopv_desc fdesc_vnodeop_opv_desc = 176const struct vnodeopv_desc fdesc_vnodeop_opv_desc =
177 { &fdesc_vnodeop_p, fdesc_vnodeop_entries }; 177 { &fdesc_vnodeop_p, fdesc_vnodeop_entries };
178 178
179extern const struct cdevsw ctty_cdevsw; 179extern const struct cdevsw ctty_cdevsw;
180 180
181/* 181/*
182 * Initialise cache headers 182 * Initialise cache headers
183 */ 183 */
184void 184void
185fdesc_init() 185fdesc_init(void)
186{ 186{
187 int cttymajor; 187 int cttymajor;
188 188
189 /* locate the major number */ 189 /* locate the major number */
190 cttymajor = cdevsw_lookup_major(&ctty_cdevsw); 190 cttymajor = cdevsw_lookup_major(&ctty_cdevsw);
191 devctty = makedev(cttymajor, 0); 191 devctty = makedev(cttymajor, 0);
192 fdhashtbl = hashinit(NFDCACHE, HASH_LIST, true, &fdhash); 192 fdhashtbl = hashinit(NFDCACHE, HASH_LIST, true, &fdhash);
193} 193}
194 194
195/* 195/*
196 * Free hash table. 196 * Free hash table.
197 */ 197 */
198void 198void
199fdesc_done() 199fdesc_done(void)
200{ 200{
201 hashdone(fdhashtbl, HASH_LIST, fdhash); 201 hashdone(fdhashtbl, HASH_LIST, fdhash);
202} 202}
203 203
204/* 204/*
205 * Return a locked vnode of the correct type. 205 * Return a locked vnode of the correct type.
206 */ 206 */
207int 207int
208fdesc_allocvp(fdntype ftype, int ix, struct mount *mp, struct vnode **vpp) 208fdesc_allocvp(fdntype ftype, int ix, struct mount *mp, struct vnode **vpp)
209{ 209{
210 struct fdhashhead *fc; 210 struct fdhashhead *fc;
211 struct fdescnode *fd; 211 struct fdescnode *fd;
212 int error = 0; 212 int error = 0;

cvs diff -r1.26 -r1.27 src/sys/miscfs/genfs/layer_subr.c (expand / switch to unified diff)

--- src/sys/miscfs/genfs/layer_subr.c 2009/03/14 15:36:22 1.26
+++ src/sys/miscfs/genfs/layer_subr.c 2009/03/15 17:22:38 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: layer_subr.c,v 1.26 2009/03/14 15:36:22 dsl Exp $ */ 1/* $NetBSD: layer_subr.c,v 1.27 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 National Aeronautics & Space Administration 4 * Copyright (c) 1999 National Aeronautics & Space Administration
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This software was written by William Studenmund of the 7 * This software was written by William Studenmund of the
8 * Numerical Aerospace Simulation Facility, NASA Ames Research Center. 8 * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -58,27 +58,27 @@ @@ -58,27 +58,27 @@
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE. 64 * SUCH DAMAGE.
65 * 65 *
66 * from: Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp 66 * from: Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp
67 * @(#)null_subr.c 8.7 (Berkeley) 5/14/95 67 * @(#)null_subr.c 8.7 (Berkeley) 5/14/95
68 */ 68 */
69 69
70#include <sys/cdefs.h> 70#include <sys/cdefs.h>
71__KERNEL_RCSID(0, "$NetBSD: layer_subr.c,v 1.26 2009/03/14 15:36:22 dsl Exp $"); 71__KERNEL_RCSID(0, "$NetBSD: layer_subr.c,v 1.27 2009/03/15 17:22:38 cegger Exp $");
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/time.h> 76#include <sys/time.h>
77#include <sys/vnode.h> 77#include <sys/vnode.h>
78#include <sys/mount.h> 78#include <sys/mount.h>
79#include <sys/namei.h> 79#include <sys/namei.h>
80#include <sys/kmem.h> 80#include <sys/kmem.h>
81#include <sys/malloc.h> 81#include <sys/malloc.h>
82 82
83#include <miscfs/specfs/specdev.h> 83#include <miscfs/specfs/specdev.h>
84#include <miscfs/genfs/layer.h> 84#include <miscfs/genfs/layer.h>
@@ -92,39 +92,39 @@ int layerfs_debug = 1; @@ -92,39 +92,39 @@ int layerfs_debug = 1;
92 92
93/* 93/*
94 * layer cache: 94 * layer cache:
95 * Each cache entry holds a reference to the lower vnode 95 * Each cache entry holds a reference to the lower vnode
96 * along with a pointer to the alias vnode. When an 96 * along with a pointer to the alias vnode. When an
97 * entry is added the lower vnode is VREF'd. When the 97 * entry is added the lower vnode is VREF'd. When the
98 * alias is removed the lower vnode is vrele'd. 98 * alias is removed the lower vnode is vrele'd.
99 */ 99 */
100 100
101/* 101/*
102 * Initialise cache headers 102 * Initialise cache headers
103 */ 103 */
104void 104void
105layerfs_init() 105layerfs_init(void)
106{ 106{
107#ifdef LAYERFS_DIAGNOSTIC 107#ifdef LAYERFS_DIAGNOSTIC
108 if (layerfs_debug) 108 if (layerfs_debug)
109 printf("layerfs_init\n"); /* printed during system boot */ 109 printf("layerfs_init\n"); /* printed during system boot */
110#endif 110#endif
111} 111}
112 112
113/* 113/*
114 * Free global resources of layerfs. 114 * Free global resources of layerfs.
115 */ 115 */
116void 116void
117layerfs_done() 117layerfs_done(void)
118{ 118{
119#ifdef LAYERFS_DIAGNOSTIC 119#ifdef LAYERFS_DIAGNOSTIC
120 if (layerfs_debug) 120 if (layerfs_debug)
121 printf("layerfs_done\n"); /* printed on layerfs detach */ 121 printf("layerfs_done\n"); /* printed on layerfs detach */
122#endif 122#endif
123} 123}
124 124
125/* 125/*
126 * Return a locked, VREF'ed alias for lower vnode if already exists, else NULL. 126 * Return a locked, VREF'ed alias for lower vnode if already exists, else NULL.
127 * The layermp's hashlock must be held on entry. 127 * The layermp's hashlock must be held on entry.
128 * It will be held upon return iff we return NULL. 128 * It will be held upon return iff we return NULL.
129 */ 129 */
130struct vnode * 130struct vnode *

cvs diff -r1.19 -r1.20 src/sys/miscfs/kernfs/Attic/kernfs_subr.c (expand / switch to unified diff)

--- src/sys/miscfs/kernfs/Attic/kernfs_subr.c 2009/03/14 15:36:22 1.19
+++ src/sys/miscfs/kernfs/Attic/kernfs_subr.c 2009/03/15 17:22:38 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kernfs_subr.c,v 1.19 2009/03/14 15:36:22 dsl Exp $ */ 1/* $NetBSD: kernfs_subr.c,v 1.20 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1993 4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Jan-Simon Pendry. 8 * Jan-Simon Pendry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -63,27 +63,27 @@ @@ -63,27 +63,27 @@
63 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 63 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70 * SUCH DAMAGE. 70 * SUCH DAMAGE.
71 * 71 *
72 * @(#)kernfs_subr.c 8.6 (Berkeley) 5/14/95 72 * @(#)kernfs_subr.c 8.6 (Berkeley) 5/14/95
73 */ 73 */
74 74
75#include <sys/cdefs.h> 75#include <sys/cdefs.h>
76__KERNEL_RCSID(0, "$NetBSD: kernfs_subr.c,v 1.19 2009/03/14 15:36:22 dsl Exp $"); 76__KERNEL_RCSID(0, "$NetBSD: kernfs_subr.c,v 1.20 2009/03/15 17:22:38 cegger Exp $");
77 77
78#ifdef _KERNEL_OPT 78#ifdef _KERNEL_OPT
79#include "opt_ipsec.h" 79#include "opt_ipsec.h"
80#endif 80#endif
81 81
82#include <sys/param.h> 82#include <sys/param.h>
83#include <sys/systm.h> 83#include <sys/systm.h>
84#include <sys/time.h> 84#include <sys/time.h>
85#include <sys/kernel.h> 85#include <sys/kernel.h>
86#include <sys/proc.h> 86#include <sys/proc.h>
87#include <sys/vnode.h> 87#include <sys/vnode.h>
88#include <sys/malloc.h> 88#include <sys/malloc.h>
89#include <sys/stat.h> 89#include <sys/stat.h>
@@ -244,36 +244,36 @@ kernfs_freevp(struct vnode *vp) @@ -244,36 +244,36 @@ kernfs_freevp(struct vnode *vp)
244 244
245 kernfs_hashrem(kfs); 245 kernfs_hashrem(kfs);
246 TAILQ_REMOVE(&VFSTOKERNFS(vp->v_mount)->nodelist, kfs, kfs_list); 246 TAILQ_REMOVE(&VFSTOKERNFS(vp->v_mount)->nodelist, kfs, kfs_list);
247 247
248 free(vp->v_data, M_TEMP); 248 free(vp->v_data, M_TEMP);
249 vp->v_data = 0; 249 vp->v_data = 0;
250 return (0); 250 return (0);
251} 251}
252 252
253/* 253/*
254 * Initialize kfsnode hash table. 254 * Initialize kfsnode hash table.
255 */ 255 */
256void 256void
257kernfs_hashinit() 257kernfs_hashinit(void)
258{ 258{
259 259
260 mutex_init(&kfs_hashlock, MUTEX_DEFAULT, IPL_NONE); 260 mutex_init(&kfs_hashlock, MUTEX_DEFAULT, IPL_NONE);
261 mutex_init(&kfs_ihash_lock, MUTEX_DEFAULT, IPL_NONE); 261 mutex_init(&kfs_ihash_lock, MUTEX_DEFAULT, IPL_NONE);
262 kfs_hashtbl = hashinit(desiredvnodes / 4, HASH_LIST, true, &kfs_ihash); 262 kfs_hashtbl = hashinit(desiredvnodes / 4, HASH_LIST, true, &kfs_ihash);
263} 263}
264 264
265void 265void
266kernfs_hashreinit() 266kernfs_hashreinit(void)
267{ 267{
268 struct kernfs_node *pp; 268 struct kernfs_node *pp;
269 struct kfs_hashhead *oldhash, *hash; 269 struct kfs_hashhead *oldhash, *hash;
270 u_long i, oldmask, mask, val; 270 u_long i, oldmask, mask, val;
271 271
272 hash = hashinit(desiredvnodes / 4, HASH_LIST, true, &mask); 272 hash = hashinit(desiredvnodes / 4, HASH_LIST, true, &mask);
273 273
274 mutex_enter(&kfs_ihash_lock); 274 mutex_enter(&kfs_ihash_lock);
275 oldhash = kfs_hashtbl; 275 oldhash = kfs_hashtbl;
276 oldmask = kfs_ihash; 276 oldmask = kfs_ihash;
277 kfs_hashtbl = hash; 277 kfs_hashtbl = hash;
278 kfs_ihash = mask; 278 kfs_ihash = mask;
279 for (i = 0; i <= oldmask; i++) { 279 for (i = 0; i <= oldmask; i++) {
@@ -281,27 +281,27 @@ kernfs_hashreinit() @@ -281,27 +281,27 @@ kernfs_hashreinit()
281 LIST_REMOVE(pp, kfs_hash); 281 LIST_REMOVE(pp, kfs_hash);
282 val = KFSVALUEHASH(pp->kfs_value); 282 val = KFSVALUEHASH(pp->kfs_value);
283 LIST_INSERT_HEAD(&hash[val], pp, kfs_hash); 283 LIST_INSERT_HEAD(&hash[val], pp, kfs_hash);
284 } 284 }
285 } 285 }
286 mutex_exit(&kfs_ihash_lock); 286 mutex_exit(&kfs_ihash_lock);
287 hashdone(oldhash, HASH_LIST, oldmask); 287 hashdone(oldhash, HASH_LIST, oldmask);
288} 288}
289 289
290/* 290/*
291 * Free kfsnode hash table. 291 * Free kfsnode hash table.
292 */ 292 */
293void 293void
294kernfs_hashdone() 294kernfs_hashdone(void)
295{ 295{
296 296
297 hashdone(kfs_hashtbl, HASH_LIST, kfs_ihash); 297 hashdone(kfs_hashtbl, HASH_LIST, kfs_ihash);
298 mutex_destroy(&kfs_hashlock); 298 mutex_destroy(&kfs_hashlock);
299 mutex_destroy(&kfs_ihash_lock); 299 mutex_destroy(&kfs_ihash_lock);
300} 300}
301 301
302struct vnode * 302struct vnode *
303kernfs_hashget(kfstype type, struct mount *mp, const struct kern_target *kt, u_int32_t value) 303kernfs_hashget(kfstype type, struct mount *mp, const struct kern_target *kt, u_int32_t value)
304{ 304{
305 struct kfs_hashhead *ppp; 305 struct kfs_hashhead *ppp;
306 struct kernfs_node *pp; 306 struct kernfs_node *pp;
307 struct vnode *vp; 307 struct vnode *vp;

cvs diff -r1.88 -r1.89 src/sys/miscfs/kernfs/kernfs_vfsops.c (expand / switch to unified diff)

--- src/sys/miscfs/kernfs/kernfs_vfsops.c 2009/03/14 15:36:22 1.88
+++ src/sys/miscfs/kernfs/kernfs_vfsops.c 2009/03/15 17:22:38 1.89
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kernfs_vfsops.c,v 1.88 2009/03/14 15:36:22 dsl Exp $ */ 1/* $NetBSD: kernfs_vfsops.c,v 1.89 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993, 1995 4 * Copyright (c) 1992, 1993, 1995
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software donated to Berkeley by 7 * This code is derived from software donated to Berkeley by
8 * Jan-Simon Pendry. 8 * Jan-Simon Pendry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95 34 * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95
35 */ 35 */
36 36
37/* 37/*
38 * Kernel params Filesystem 38 * Kernel params Filesystem
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.88 2009/03/14 15:36:22 dsl Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.89 2009/03/15 17:22:38 cegger Exp $");
43 43
44#ifdef _KERNEL_OPT 44#ifdef _KERNEL_OPT
45#include "opt_compat_netbsd.h" 45#include "opt_compat_netbsd.h"
46#endif 46#endif
47 47
48#include <sys/param.h> 48#include <sys/param.h>
49#include <sys/systm.h> 49#include <sys/systm.h>
50#include <sys/sysctl.h> 50#include <sys/sysctl.h>
51#include <sys/conf.h> 51#include <sys/conf.h>
52#include <sys/proc.h> 52#include <sys/proc.h>
53#include <sys/vnode.h> 53#include <sys/vnode.h>
54#include <sys/mount.h> 54#include <sys/mount.h>
55#include <sys/namei.h> 55#include <sys/namei.h>
@@ -66,49 +66,49 @@ __KERNEL_RCSID(0, "$NetBSD: kernfs_vfsop @@ -66,49 +66,49 @@ __KERNEL_RCSID(0, "$NetBSD: kernfs_vfsop
66MODULE(MODULE_CLASS_VFS, kernfs, NULL); 66MODULE(MODULE_CLASS_VFS, kernfs, NULL);
67 67
68MALLOC_JUSTDEFINE(M_KERNFSMNT, "kernfs mount", "kernfs mount structures"); 68MALLOC_JUSTDEFINE(M_KERNFSMNT, "kernfs mount", "kernfs mount structures");
69 69
70dev_t rrootdev = NODEV; 70dev_t rrootdev = NODEV;
71 71
72VFS_PROTOS(kernfs); 72VFS_PROTOS(kernfs);
73 73
74void kernfs_get_rrootdev(void); 74void kernfs_get_rrootdev(void);
75 75
76static struct sysctllog *kernfs_sysctl_log; 76static struct sysctllog *kernfs_sysctl_log;
77 77
78void 78void
79kernfs_init() 79kernfs_init(void)
80{ 80{
81 81
82 malloc_type_attach(M_KERNFSMNT); 82 malloc_type_attach(M_KERNFSMNT);
83 kernfs_hashinit(); 83 kernfs_hashinit();
84} 84}
85 85
86void 86void
87kernfs_reinit() 87kernfs_reinit(void)
88{ 88{
89 kernfs_hashreinit(); 89 kernfs_hashreinit();
90} 90}
91 91
92void 92void
93kernfs_done() 93kernfs_done(void)
94{ 94{
95 95
96 kernfs_hashdone(); 96 kernfs_hashdone();
97 malloc_type_detach(M_KERNFSMNT); 97 malloc_type_detach(M_KERNFSMNT);
98} 98}
99 99
100void 100void
101kernfs_get_rrootdev() 101kernfs_get_rrootdev(void)
102{ 102{
103 static int tried = 0; 103 static int tried = 0;
104 104
105 if (tried) { 105 if (tried) {
106 /* Already did it once. */ 106 /* Already did it once. */
107 return; 107 return;
108 } 108 }
109 tried = 1; 109 tried = 1;
110 110
111 if (rootdev == NODEV) 111 if (rootdev == NODEV)
112 return; 112 return;
113 rrootdev = devsw_blk2chr(rootdev); 113 rrootdev = devsw_blk2chr(rootdev);
114 if (rrootdev != NODEV) 114 if (rrootdev != NODEV)

cvs diff -r1.78 -r1.79 src/sys/miscfs/portal/Attic/portal_vfsops.c (expand / switch to unified diff)

--- src/sys/miscfs/portal/Attic/portal_vfsops.c 2009/03/14 15:36:23 1.78
+++ src/sys/miscfs/portal/Attic/portal_vfsops.c 2009/03/15 17:22:38 1.79
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: portal_vfsops.c,v 1.78 2009/03/14 15:36:23 dsl Exp $ */ 1/* $NetBSD: portal_vfsops.c,v 1.79 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993, 1995 4 * Copyright (c) 1992, 1993, 1995
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software donated to Berkeley by 7 * This code is derived from software donated to Berkeley by
8 * Jan-Simon Pendry. 8 * Jan-Simon Pendry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 * from: Id: portal_vfsops.c,v 1.5 1992/05/30 10:25:27 jsp Exp 34 * from: Id: portal_vfsops.c,v 1.5 1992/05/30 10:25:27 jsp Exp
35 * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 35 * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95
36 */ 36 */
37 37
38/* 38/*
39 * Portal Filesystem 39 * Portal Filesystem
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.78 2009/03/14 15:36:23 dsl Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.79 2009/03/15 17:22:38 cegger Exp $");
44 44
45#if defined(_KERNEL_OPT) 45#if defined(_KERNEL_OPT)
46#include "opt_compat_netbsd.h" 46#include "opt_compat_netbsd.h"
47#endif 47#endif
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/systm.h> 50#include <sys/systm.h>
51#include <sys/sysctl.h> 51#include <sys/sysctl.h>
52#include <sys/time.h> 52#include <sys/time.h>
53#include <sys/proc.h> 53#include <sys/proc.h>
54#include <sys/filedesc.h> 54#include <sys/filedesc.h>
55#include <sys/file.h> 55#include <sys/file.h>
56#include <sys/vnode.h> 56#include <sys/vnode.h>
@@ -68,32 +68,32 @@ __KERNEL_RCSID(0, "$NetBSD: portal_vfsop @@ -68,32 +68,32 @@ __KERNEL_RCSID(0, "$NetBSD: portal_vfsop
68#include <sys/module.h> 68#include <sys/module.h>
69 69
70#include <miscfs/genfs/genfs.h> 70#include <miscfs/genfs/genfs.h>
71 71
72#include <miscfs/portal/portal.h> 72#include <miscfs/portal/portal.h>
73 73
74MODULE(MODULE_CLASS_VFS, portal, NULL); 74MODULE(MODULE_CLASS_VFS, portal, NULL);
75 75
76VFS_PROTOS(portal); 76VFS_PROTOS(portal);
77 77
78static struct sysctllog *portal_sysctl_log; 78static struct sysctllog *portal_sysctl_log;
79 79
80void 80void
81portal_init() 81portal_init(void)
82{ 82{
83} 83}
84 84
85void 85void
86portal_done() 86portal_done(void)
87{ 87{
88} 88}
89 89
90/* 90/*
91 * Mount the per-process file descriptors (/dev/fd) 91 * Mount the per-process file descriptors (/dev/fd)
92 */ 92 */
93int 93int
94portal_mount( 94portal_mount(
95 struct mount *mp, 95 struct mount *mp,
96 const char *path, 96 const char *path,
97 void *data, 97 void *data,
98 size_t *data_len) 98 size_t *data_len)
99{ 99{

cvs diff -r1.94 -r1.95 src/sys/miscfs/procfs/procfs_subr.c (expand / switch to unified diff)

--- src/sys/miscfs/procfs/procfs_subr.c 2009/03/14 15:36:23 1.94
+++ src/sys/miscfs/procfs/procfs_subr.c 2009/03/15 17:22:38 1.95
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: procfs_subr.c,v 1.94 2009/03/14 15:36:23 dsl Exp $ */ 1/* $NetBSD: procfs_subr.c,v 1.95 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -92,27 +92,27 @@ @@ -92,27 +92,27 @@
92 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 92 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
93 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 93 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
94 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 94 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
95 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 95 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
96 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 96 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
97 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 97 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
98 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 98 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
99 * SUCH DAMAGE. 99 * SUCH DAMAGE.
100 * 100 *
101 * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95 101 * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95
102 */ 102 */
103 103
104#include <sys/cdefs.h> 104#include <sys/cdefs.h>
105__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.94 2009/03/14 15:36:23 dsl Exp $"); 105__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.95 2009/03/15 17:22:38 cegger Exp $");
106 106
107#include <sys/param.h> 107#include <sys/param.h>
108#include <sys/systm.h> 108#include <sys/systm.h>
109#include <sys/time.h> 109#include <sys/time.h>
110#include <sys/kernel.h> 110#include <sys/kernel.h>
111#include <sys/proc.h> 111#include <sys/proc.h>
112#include <sys/vnode.h> 112#include <sys/vnode.h>
113#include <sys/malloc.h> 113#include <sys/malloc.h>
114#include <sys/stat.h> 114#include <sys/stat.h>
115#include <sys/file.h> 115#include <sys/file.h>
116#include <sys/filedesc.h> 116#include <sys/filedesc.h>
117#include <sys/kauth.h> 117#include <sys/kauth.h>
118 118
@@ -529,35 +529,35 @@ vfs_findname(const vfs_namemap_t *nm, co @@ -529,35 +529,35 @@ vfs_findname(const vfs_namemap_t *nm, co
529{ 529{
530 530
531 for (; nm->nm_name; nm++) 531 for (; nm->nm_name; nm++)
532 if (memcmp(bf, nm->nm_name, buflen+1) == 0) 532 if (memcmp(bf, nm->nm_name, buflen+1) == 0)
533 return (nm); 533 return (nm);
534 534
535 return (0); 535 return (0);
536} 536}
537 537
538/* 538/*
539 * Initialize pfsnode hash table. 539 * Initialize pfsnode hash table.
540 */ 540 */
541void 541void
542procfs_hashinit() 542procfs_hashinit(void)
543{ 543{
544 mutex_init(&pfs_hashlock, MUTEX_DEFAULT, IPL_NONE); 544 mutex_init(&pfs_hashlock, MUTEX_DEFAULT, IPL_NONE);
545 mutex_init(&pfs_ihash_lock, MUTEX_DEFAULT, IPL_NONE); 545 mutex_init(&pfs_ihash_lock, MUTEX_DEFAULT, IPL_NONE);
546 pfs_hashtbl = hashinit(desiredvnodes / 4, HASH_LIST, true, &pfs_ihash); 546 pfs_hashtbl = hashinit(desiredvnodes / 4, HASH_LIST, true, &pfs_ihash);
547} 547}
548 548
549void 549void
550procfs_hashreinit() 550procfs_hashreinit(void)
551{ 551{
552 struct pfsnode *pp; 552 struct pfsnode *pp;
553 struct pfs_hashhead *oldhash, *hash; 553 struct pfs_hashhead *oldhash, *hash;
554 u_long i, oldmask, mask, val; 554 u_long i, oldmask, mask, val;
555 555
556 hash = hashinit(desiredvnodes / 4, HASH_LIST, true, &mask); 556 hash = hashinit(desiredvnodes / 4, HASH_LIST, true, &mask);
557 557
558 mutex_enter(&pfs_ihash_lock); 558 mutex_enter(&pfs_ihash_lock);
559 oldhash = pfs_hashtbl; 559 oldhash = pfs_hashtbl;
560 oldmask = pfs_ihash; 560 oldmask = pfs_ihash;
561 pfs_hashtbl = hash; 561 pfs_hashtbl = hash;
562 pfs_ihash = mask; 562 pfs_ihash = mask;
563 for (i = 0; i <= oldmask; i++) { 563 for (i = 0; i <= oldmask; i++) {
@@ -565,27 +565,27 @@ procfs_hashreinit() @@ -565,27 +565,27 @@ procfs_hashreinit()
565 LIST_REMOVE(pp, pfs_hash); 565 LIST_REMOVE(pp, pfs_hash);
566 val = PFSPIDHASH(pp->pfs_pid); 566 val = PFSPIDHASH(pp->pfs_pid);
567 LIST_INSERT_HEAD(&hash[val], pp, pfs_hash); 567 LIST_INSERT_HEAD(&hash[val], pp, pfs_hash);
568 } 568 }
569 } 569 }
570 mutex_exit(&pfs_ihash_lock); 570 mutex_exit(&pfs_ihash_lock);
571 hashdone(oldhash, HASH_LIST, oldmask); 571 hashdone(oldhash, HASH_LIST, oldmask);
572} 572}
573 573
574/* 574/*
575 * Free pfsnode hash table. 575 * Free pfsnode hash table.
576 */ 576 */
577void 577void
578procfs_hashdone() 578procfs_hashdone(void)
579{ 579{
580 hashdone(pfs_hashtbl, HASH_LIST, pfs_ihash); 580 hashdone(pfs_hashtbl, HASH_LIST, pfs_ihash);
581 mutex_destroy(&pfs_hashlock); 581 mutex_destroy(&pfs_hashlock);
582 mutex_destroy(&pfs_ihash_lock); 582 mutex_destroy(&pfs_ihash_lock);
583} 583}
584 584
585struct vnode * 585struct vnode *
586procfs_hashget(pid_t pid, pfstype type, int fd, struct mount *mp, int flags) 586procfs_hashget(pid_t pid, pfstype type, int fd, struct mount *mp, int flags)
587{ 587{
588 struct pfs_hashhead *ppp; 588 struct pfs_hashhead *ppp;
589 struct pfsnode *pp; 589 struct pfsnode *pp;
590 struct vnode *vp; 590 struct vnode *vp;
591 591

cvs diff -r1.82 -r1.83 src/sys/miscfs/procfs/procfs_vfsops.c (expand / switch to unified diff)

--- src/sys/miscfs/procfs/procfs_vfsops.c 2009/03/14 15:36:23 1.82
+++ src/sys/miscfs/procfs/procfs_vfsops.c 2009/03/15 17:22:38 1.83
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: procfs_vfsops.c,v 1.82 2009/03/14 15:36:23 dsl Exp $ */ 1/* $NetBSD: procfs_vfsops.c,v 1.83 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1993 4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Jan-Simon Pendry. 8 * Jan-Simon Pendry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE. 69 * SUCH DAMAGE.
70 * 70 *
71 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 71 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95
72 */ 72 */
73 73
74/* 74/*
75 * procfs VFS interface 75 * procfs VFS interface
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.82 2009/03/14 15:36:23 dsl Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.83 2009/03/15 17:22:38 cegger Exp $");
80 80
81#if defined(_KERNEL_OPT) 81#if defined(_KERNEL_OPT)
82#include "opt_compat_netbsd.h" 82#include "opt_compat_netbsd.h"
83#endif 83#endif
84 84
85#include <sys/param.h> 85#include <sys/param.h>
86#include <sys/time.h> 86#include <sys/time.h>
87#include <sys/kernel.h> 87#include <sys/kernel.h>
88#include <sys/systm.h> 88#include <sys/systm.h>
89#include <sys/sysctl.h> 89#include <sys/sysctl.h>
90#include <sys/proc.h> 90#include <sys/proc.h>
91#include <sys/buf.h> 91#include <sys/buf.h>
92#include <sys/syslog.h> 92#include <sys/syslog.h>
@@ -242,39 +242,39 @@ procfs_sync( @@ -242,39 +242,39 @@ procfs_sync(
242 242
243 return (0); 243 return (0);
244} 244}
245 245
246/*ARGSUSED*/ 246/*ARGSUSED*/
247int 247int
248procfs_vget(struct mount *mp, ino_t ino, 248procfs_vget(struct mount *mp, ino_t ino,
249 struct vnode **vpp) 249 struct vnode **vpp)
250{ 250{
251 return (EOPNOTSUPP); 251 return (EOPNOTSUPP);
252} 252}
253 253
254void 254void
255procfs_init() 255procfs_init(void)
256{ 256{
257 procfs_hashinit(); 257 procfs_hashinit();
258} 258}
259 259
260void 260void
261procfs_reinit() 261procfs_reinit(void)
262{ 262{
263 procfs_hashreinit(); 263 procfs_hashreinit();
264} 264}
265 265
266void 266void
267procfs_done() 267procfs_done(void)
268{ 268{
269 procfs_hashdone(); 269 procfs_hashdone();
270} 270}
271 271
272extern const struct vnodeopv_desc procfs_vnodeop_opv_desc; 272extern const struct vnodeopv_desc procfs_vnodeop_opv_desc;
273 273
274const struct vnodeopv_desc * const procfs_vnodeopv_descs[] = { 274const struct vnodeopv_desc * const procfs_vnodeopv_descs[] = {
275 &procfs_vnodeop_opv_desc, 275 &procfs_vnodeop_opv_desc,
276 NULL, 276 NULL,
277}; 277};
278 278
279struct vfsops procfs_vfsops = { 279struct vfsops procfs_vfsops = {
280 MOUNT_PROCFS, 280 MOUNT_PROCFS,

cvs diff -r1.39 -r1.40 src/sys/miscfs/syncfs/Attic/sync_subr.c (expand / switch to unified diff)

--- src/sys/miscfs/syncfs/Attic/sync_subr.c 2009/03/14 21:04:25 1.39
+++ src/sys/miscfs/syncfs/Attic/sync_subr.c 2009/03/15 17:22:38 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sync_subr.c,v 1.39 2009/03/14 21:04:25 dsl Exp $ */ 1/* $NetBSD: sync_subr.c,v 1.40 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 51 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL MARSHALL KIRK MCKUSICK BE LIABLE 53 * ARE DISCLAIMED. IN NO EVENT SHALL MARSHALL KIRK MCKUSICK BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * SUCH DAMAGE. 60 * SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: sync_subr.c,v 1.39 2009/03/14 21:04:25 dsl Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: sync_subr.c,v 1.40 2009/03/15 17:22:38 cegger Exp $");
65 65
66#include <sys/param.h> 66#include <sys/param.h>
67#include <sys/systm.h> 67#include <sys/systm.h>
68#include <sys/sysctl.h> 68#include <sys/sysctl.h>
69#include <sys/kernel.h> 69#include <sys/kernel.h>
70#include <sys/proc.h> 70#include <sys/proc.h>
71#include <sys/mount.h> 71#include <sys/mount.h>
72#include <sys/time.h> 72#include <sys/time.h>
73#include <sys/vnode.h> 73#include <sys/vnode.h>
74#include <sys/buf.h> 74#include <sys/buf.h>
75#include <sys/errno.h> 75#include <sys/errno.h>
76#include <sys/kmem.h> 76#include <sys/kmem.h>
77 77
@@ -93,27 +93,27 @@ time_t lockdelay = 1; /* time to delay @@ -93,27 +93,27 @@ time_t lockdelay = 1; /* time to delay
93kmutex_t syncer_mutex; /* used to freeze syncer, long term */ 93kmutex_t syncer_mutex; /* used to freeze syncer, long term */
94static kmutex_t syncer_data_lock; /* short term lock on data structures */ 94static kmutex_t syncer_data_lock; /* short term lock on data structures */
95 95
96static int rushjob; /* number of slots to run ASAP */ 96static int rushjob; /* number of slots to run ASAP */
97static kcondvar_t syncer_cv; /* cv for rushjob */ 97static kcondvar_t syncer_cv; /* cv for rushjob */
98static int stat_rush_requests; /* number of times I/O speeded up */ 98static int stat_rush_requests; /* number of times I/O speeded up */
99 99
100static int syncer_delayno = 0; 100static int syncer_delayno = 0;
101static long syncer_last; 101static long syncer_last;
102static struct synclist *syncer_workitem_pending; 102static struct synclist *syncer_workitem_pending;
103struct lwp *updateproc = NULL; 103struct lwp *updateproc = NULL;
104 104
105void 105void
106vn_initialize_syncerd() 106vn_initialize_syncerd(void)
107{ 107{
108 int i; 108 int i;
109 109
110 syncer_last = SYNCER_MAXDELAY + 2; 110 syncer_last = SYNCER_MAXDELAY + 2;
111 111
112 syncer_workitem_pending = 112 syncer_workitem_pending =
113 kmem_alloc(syncer_last * sizeof (struct synclist), KM_SLEEP); 113 kmem_alloc(syncer_last * sizeof (struct synclist), KM_SLEEP);
114 114
115 for (i = 0; i < syncer_last; i++) 115 for (i = 0; i < syncer_last; i++)
116 TAILQ_INIT(&syncer_workitem_pending[i]); 116 TAILQ_INIT(&syncer_workitem_pending[i]);
117 117
118 mutex_init(&syncer_mutex, MUTEX_DEFAULT, IPL_NONE); 118 mutex_init(&syncer_mutex, MUTEX_DEFAULT, IPL_NONE);
119 mutex_init(&syncer_data_lock, MUTEX_DEFAULT, IPL_NONE); 119 mutex_init(&syncer_data_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -318,27 +318,27 @@ sched_sync(void *v) @@ -318,27 +318,27 @@ sched_sync(void *v)
318 if (time_second == starttime) 318 if (time_second == starttime)
319 cv_timedwait(&syncer_cv, &syncer_data_lock, hz); 319 cv_timedwait(&syncer_cv, &syncer_data_lock, hz);
320 } 320 }
321 mutex_exit(&syncer_data_lock); 321 mutex_exit(&syncer_data_lock);
322 } 322 }
323} 323}
324 324
325/* 325/*
326 * Request the syncer daemon to speed up its work. 326 * Request the syncer daemon to speed up its work.
327 * We never push it to speed up more than half of its 327 * We never push it to speed up more than half of its
328 * normal turn time, otherwise it could take over the CPU. 328 * normal turn time, otherwise it could take over the CPU.
329 */ 329 */
330int 330int
331speedup_syncer() 331speedup_syncer(void)
332{ 332{
333 333
334 mutex_enter(&syncer_data_lock); 334 mutex_enter(&syncer_data_lock);
335 if (rushjob >= syncdelay / 2) { 335 if (rushjob >= syncdelay / 2) {
336 mutex_exit(&syncer_data_lock); 336 mutex_exit(&syncer_data_lock);
337 return (0); 337 return (0);
338 } 338 }
339 rushjob++; 339 rushjob++;
340 cv_signal(&syncer_cv); 340 cv_signal(&syncer_cv);
341 stat_rush_requests += 1; 341 stat_rush_requests += 1;
342 mutex_exit(&syncer_data_lock); 342 mutex_exit(&syncer_data_lock);
343 343
344 return (1); 344 return (1);

cvs diff -r1.27 -r1.28 src/sys/miscfs/umapfs/umap_subr.c (expand / switch to unified diff)

--- src/sys/miscfs/umapfs/umap_subr.c 2009/03/14 15:36:23 1.27
+++ src/sys/miscfs/umapfs/umap_subr.c 2009/03/15 17:22:38 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: umap_subr.c,v 1.27 2009/03/14 15:36:23 dsl Exp $ */ 1/* $NetBSD: umap_subr.c,v 1.28 2009/03/15 17:22:38 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 National Aeronautics & Space Administration 4 * Copyright (c) 1999 National Aeronautics & Space Administration
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This software was written by William Studenmund of the 7 * This software was written by William Studenmund of the
8 * Numerical Aerospace Simulation Facility, NASA Ames Research Center. 8 * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -58,78 +58,72 @@ @@ -58,78 +58,72 @@
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE. 64 * SUCH DAMAGE.
65 * 65 *
66 * from: Id: lofs_subr.c, v 1.11 1992/05/30 10:05:43 jsp Exp 66 * from: Id: lofs_subr.c, v 1.11 1992/05/30 10:05:43 jsp Exp
67 * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 67 * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95
68 */ 68 */
69 69
70#include <sys/cdefs.h> 70#include <sys/cdefs.h>
71__KERNEL_RCSID(0, "$NetBSD: umap_subr.c,v 1.27 2009/03/14 15:36:23 dsl Exp $"); 71__KERNEL_RCSID(0, "$NetBSD: umap_subr.c,v 1.28 2009/03/15 17:22:38 cegger Exp $");
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/time.h> 76#include <sys/time.h>
77#include <sys/vnode.h> 77#include <sys/vnode.h>
78#include <sys/mount.h> 78#include <sys/mount.h>
79#include <sys/namei.h> 79#include <sys/namei.h>
80#include <sys/malloc.h> 80#include <sys/malloc.h>
81#include <sys/kauth.h> 81#include <sys/kauth.h>
82 82
83#include <miscfs/specfs/specdev.h> 83#include <miscfs/specfs/specdev.h>
84#include <miscfs/umapfs/umap.h> 84#include <miscfs/umapfs/umap.h>
85 85
86u_long umap_findid(u_long, u_long [][2], int); 86u_long umap_findid(u_long, u_long [][2], int);
87int umap_node_alloc(struct mount *, struct vnode *, 87int umap_node_alloc(struct mount *, struct vnode *,
88 struct vnode **); 88 struct vnode **);
89 89
90/* 90/*
91 * umap_findid is called by various routines in umap_vnodeops.c to 91 * umap_findid is called by various routines in umap_vnodeops.c to
92 * find a user or group id in a map. 92 * find a user or group id in a map.
93 */ 93 */
94u_long 94u_long
95umap_findid(id, map, nentries) 95umap_findid(u_long id, u_long map[][2], int nentries)
96 u_long id; 
97 u_long map[][2]; 
98 int nentries; 
99{ 96{
100 int i; 97 int i;
101 98
102 /* Find uid entry in map */ 99 /* Find uid entry in map */
103 i = 0; 100 i = 0;
104 while ((i<nentries) && ((map[i][0]) != id)) 101 while ((i<nentries) && ((map[i][0]) != id))
105 i++; 102 i++;
106 103
107 if (i < nentries) 104 if (i < nentries)
108 return (map[i][1]); 105 return (map[i][1]);
109 else 106 else
110 return (-1); 107 return (-1);
111 108
112} 109}
113 110
114/* 111/*
115 * umap_reverse_findid is called by umap_getattr() in umap_vnodeops.c to 112 * umap_reverse_findid is called by umap_getattr() in umap_vnodeops.c to
116 * find a user or group id in a map, in reverse. 113 * find a user or group id in a map, in reverse.
117 */ 114 */
118u_long 115u_long
119umap_reverse_findid(id, map, nentries) 116umap_reverse_findid(u_long id, u_long map[][2], int nentries)
120 u_long id; 
121 u_long map[][2]; 
122 int nentries; 
123{ 117{
124 int i; 118 int i;
125 119
126 /* Find uid entry in map */ 120 /* Find uid entry in map */
127 i = 0; 121 i = 0;
128 while ((i<nentries) && ((map[i][1]) != id)) 122 while ((i<nentries) && ((map[i][1]) != id))
129 i++; 123 i++;
130 124
131 if (i < nentries) 125 if (i < nentries)
132 return (map[i][0]); 126 return (map[i][0]);
133 else 127 else
134 return (-1); 128 return (-1);
135 129