| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: vnode.9,v 1.57 2013/10/29 09:53:51 hannken Exp $ | | 1 | .\" $NetBSD: vnode.9,v 1.58 2014/02/22 10:08:12 hannken Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Gregory McGarry. | | 7 | .\" by Gregory McGarry. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .Dd October 29, 2013 | | 30 | .Dd February 22, 2014 |
31 | .Dt VNODE 9 | | 31 | .Dt VNODE 9 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm vnode , | | 34 | .Nm vnode , |
35 | .Nm vref , | | 35 | .Nm vref , |
36 | .Nm vrele , | | 36 | .Nm vrele , |
37 | .Nm vrele_async , | | 37 | .Nm vrele_async , |
38 | .Nm vget , | | 38 | .Nm vget , |
39 | .Nm vput , | | 39 | .Nm vput , |
40 | .Nm vhold , | | 40 | .Nm vhold , |
41 | .Nm holdrele , | | 41 | .Nm holdrele , |
42 | .Nm getnewvnode , | | 42 | .Nm getnewvnode , |
43 | .Nm ungetnewvnode , | | 43 | .Nm ungetnewvnode , |
| @@ -69,27 +69,27 @@ | | | @@ -69,27 +69,27 @@ |
69 | .Fn vget "struct vnode *vp" "int lockflag" | | 69 | .Fn vget "struct vnode *vp" "int lockflag" |
70 | .Ft void | | 70 | .Ft void |
71 | .Fn vput "struct vnode *vp" | | 71 | .Fn vput "struct vnode *vp" |
72 | .Ft void | | 72 | .Ft void |
73 | .Fn vhold "struct vnode *vp" | | 73 | .Fn vhold "struct vnode *vp" |
74 | .Ft void | | 74 | .Ft void |
75 | .Fn holdrele "struct vnode *vp" | | 75 | .Fn holdrele "struct vnode *vp" |
76 | .Ft int | | 76 | .Ft int |
77 | .Fn getnewvnode "enum vtagtype tag" "struct mount *mp" "int (**vops)(void *)" \ | | 77 | .Fn getnewvnode "enum vtagtype tag" "struct mount *mp" "int (**vops)(void *)" \ |
78 | "kmutex_t *slock" "struct vnode **vpp" | | 78 | "kmutex_t *slock" "struct vnode **vpp" |
79 | .Ft void | | 79 | .Ft void |
80 | .Fn ungetnewvnode "struct vnode *vp" | | 80 | .Fn ungetnewvnode "struct vnode *vp" |
81 | .Ft int | | 81 | .Ft int |
82 | .Fn vrecycle "struct vnode *vp" "struct simplelock *inter_lkp" | | 82 | .Fn vrecycle "struct vnode *vp" "struct kmutex_t *inter_lkp" |
83 | .Ft void | | 83 | .Ft void |
84 | .Fn vgone "struct vnode *vp" | | 84 | .Fn vgone "struct vnode *vp" |
85 | .Ft void | | 85 | .Ft void |
86 | .Fn vgonel "struct vnode *vp" "struct lwp *l" | | 86 | .Fn vgonel "struct vnode *vp" "struct lwp *l" |
87 | .Ft int | | 87 | .Ft int |
88 | .Fn vflush "struct mount *mp" "struct vnode *skipvp" "int flags" | | 88 | .Fn vflush "struct mount *mp" "struct vnode *skipvp" "int flags" |
89 | .Ft int | | 89 | .Ft int |
90 | .Fn vaccess "enum vtype type" "mode_t file_mode" "uid_t uid" "gid_t gid" "mode_t acc_mode" "kauth_cred_t cred" | | 90 | .Fn vaccess "enum vtype type" "mode_t file_mode" "uid_t uid" "gid_t gid" "mode_t acc_mode" "kauth_cred_t cred" |
91 | .Ft int | | 91 | .Ft int |
92 | .Fn bdevvp "dev_t dev" "struct vnode **vpp" | | 92 | .Fn bdevvp "dev_t dev" "struct vnode **vpp" |
93 | .Ft int | | 93 | .Ft int |
94 | .Fn cdevvp "dev_t dev" "struct vnode **vpp" | | 94 | .Fn cdevvp "dev_t dev" "struct vnode **vpp" |
95 | .Ft int | | 95 | .Ft int |
| @@ -173,78 +173,81 @@ There are some rather common exceptions | | | @@ -173,78 +173,81 @@ There are some rather common exceptions |
173 | .Pp | | 173 | .Pp |
174 | Files and file systems are inextricably linked with the virtual memory | | 174 | Files and file systems are inextricably linked with the virtual memory |
175 | system and | | 175 | system and |
176 | .Em v_uobj | | 176 | .Em v_uobj |
177 | contains the data maintained by the virtual memory system. | | 177 | contains the data maintained by the virtual memory system. |
178 | For compatibility with code written before the integration of | | 178 | For compatibility with code written before the integration of |
179 | .Xr uvm 9 | | 179 | .Xr uvm 9 |
180 | into | | 180 | into |
181 | .Nx , | | 181 | .Nx , |
182 | C-preprocessor directives are used to alias the members of | | 182 | C-preprocessor directives are used to alias the members of |
183 | .Em v_uobj . | | 183 | .Em v_uobj . |
184 | .Pp | | 184 | .Pp |
185 | Vnode flags are recorded by | | 185 | Vnode flags are recorded by |
186 | .Em v_flag . | | 186 | .Em v_iflag , |
| | | 187 | .Em v_vflag |
| | | 188 | and |
| | | 189 | .Em v_uflag . |
187 | Valid flags are: | | 190 | Valid flags are: |
188 | .Pp | | 191 | .Pp |
189 | .Bl -tag -offset indent -width VONWORKLST -compact | | 192 | .Bl -tag -offset indent -width VONWORKLST -compact |
190 | .It VROOT | | 193 | .It VV_ROOT |
191 | This vnode is the root of its file system. | | 194 | This vnode is the root of its file system. |
192 | .It VTEXT | | 195 | .It VV_SYSTEM |
193 | This vnode is a pure text prototype. | | | |
194 | .It VSYSTEM | | | |
195 | This vnode is being used by the kernel; only used to skip quota files in | | 196 | This vnode is being used by the kernel; only used to skip quota files in |
196 | .Fn vflush . | | 197 | .Fn vflush . |
197 | .It VISTTY | | 198 | .It VV_ISTTY |
198 | This vnode represents a tty; used when reading dead vnodes. | | 199 | This vnode represents a tty; used when reading dead vnodes. |
199 | .It VEXECMAP | | 200 | .It VV_MAPPED |
| | | 201 | This vnode might have user mappings. |
| | | 202 | .It VV_MPSAFE |
| | | 203 | This file system is MP safe. |
| | | 204 | .It VV_LOCKSWORK |
| | | 205 | This vnode's file system supports locking. |
| | | 206 | .It VI_TEXT |
| | | 207 | This vnode is a pure text prototype. |
| | | 208 | .It VI_EXECMAP |
200 | This vnode has executable mappings. | | 209 | This vnode has executable mappings. |
201 | .It VWRITEMAP | | 210 | .It VI_WRMAP |
202 | This vnode might have PROT_WRITE user mappings. | | 211 | This vnode might have PROT_WRITE user mappings. |
203 | .It VWRITEMAPDIRTY | | 212 | .It VI_WRMAPDIRTY |
204 | This vnode might have dirty pages due to VWRITEMAP | | 213 | This vnode might have dirty pages due to VWRITEMAP |
205 | .It VLOCKSWORK | | 214 | .It VI_XLOCK |
206 | This vnode's file system supports locking. | | | |
207 | .It VXLOCK | | | |
208 | This vnode is currently locked to change underlying type. | | 215 | This vnode is currently locked to change underlying type. |
209 | .It VXWANT | | 216 | .It VI_ONWORKLST |
210 | A process is waiting for this vnode. | | 217 | This vnode is on syncer work-list. |
211 | .It VBWAIT | | 218 | .It VI_MARKER |
212 | Waiting for output associated with this vnode to complete. | | 219 | A dummy marker vnode. |
213 | .It VALIASED | | 220 | .It VI_LAYER |
214 | This vnode has an alias. | | 221 | This vnode is on a layered file system. |
215 | .It VDIROP | | 222 | .It VI_LOCKSHARE |
| | | 223 | This vnode shares its |
| | | 224 | .Em v_interlock |
| | | 225 | with other vnodes. |
| | | 226 | .It VI_CLEAN |
| | | 227 | This vnode has been reclaimed and is no longer attached to a file system. |
| | | 228 | .It VU_DIROP |
216 | This vnode is involved in a directory operation. | | 229 | This vnode is involved in a directory operation. |
217 | This flag is used exclusively by LFS. | | 230 | This flag is used exclusively by LFS. |
218 | .It VLAYER | | | |
219 | This vnode is on a layered file system. | | | |
220 | .It VONWORKLST | | | |
221 | This vnode is on syncer work-list. | | | |
222 | .It VFREEING | | | |
223 | This vnode is being freed. | | | |
224 | .It VMAPPED | | | |
225 | This vnode might have user mappings. | | | |
226 | .El | | 231 | .El |
227 | .Pp | | 232 | .Pp |
228 | The VXLOCK flag is used to prevent multiple processes from entering | | 233 | The VI_XLOCK flag is used to prevent multiple processes from entering |
229 | the vnode reclamation code. | | 234 | the vnode reclamation code. |
230 | It is also used as a flag to indicate that reclamation is in progress. | | 235 | It is also used as a flag to indicate that reclamation is in progress. |
231 | The VXWANT flag is set by threads that wish to be awakened when | | | |
232 | reclamation is finished. | | | |
233 | Before | | 236 | Before |
234 | .Em v_flag | | 237 | .Em v_iflag |
235 | can be modified, the | | 238 | can be modified, the |
236 | .Em v_interlock | | 239 | .Em v_interlock |
237 | simplelock must be acquired. | | 240 | mutex must be acquired. |
238 | See | | 241 | See |
239 | .Xr lock 9 | | 242 | .Xr lock 9 |
240 | for details on the kernel locking API. | | 243 | for details on the kernel locking API. |
241 | .Pp | | 244 | .Pp |
242 | Each vnode has three reference counts: | | 245 | Each vnode has three reference counts: |
243 | .Em v_usecount , | | 246 | .Em v_usecount , |
244 | .Em v_writecount | | 247 | .Em v_writecount |
245 | and | | 248 | and |
246 | .Em v_holdcnt . | | 249 | .Em v_holdcnt . |
247 | The first is the number of active references within the | | 250 | The first is the number of active references within the |
248 | kernel to the vnode. | | 251 | kernel to the vnode. |
249 | This count is maintained by | | 252 | This count is maintained by |
250 | .Fn vref , | | 253 | .Fn vref , |
| @@ -262,38 +265,37 @@ system calls. | | | @@ -262,38 +265,37 @@ system calls. |
262 | The third is the number of references within the kernel | | 265 | The third is the number of references within the kernel |
263 | requiring the vnode to remain active and not be recycled. | | 266 | requiring the vnode to remain active and not be recycled. |
264 | This count is maintained by | | 267 | This count is maintained by |
265 | .Fn vhold | | 268 | .Fn vhold |
266 | and | | 269 | and |
267 | .Fn holdrele . | | 270 | .Fn holdrele . |
268 | When both the | | 271 | When both the |
269 | .Em v_usecount | | 272 | .Em v_usecount |
270 | and | | 273 | and |
271 | .Em v_holdcnt | | 274 | .Em v_holdcnt |
272 | reach zero, the vnode is recycled to the freelist and may be reused | | 275 | reach zero, the vnode is recycled to the freelist and may be reused |
273 | for another file. | | 276 | for another file. |
274 | The transition to and from the freelist is handled by | | 277 | The transition to and from the freelist is handled by |
275 | .Fn getnewvnode , | | 278 | a kernel thread |
276 | .Fn ungetnewvnode | | | |
277 | and | | 279 | and |
278 | .Fn vrecycle . | | 280 | .Fn vrecycle . |
279 | Access to | | 281 | Access to |
280 | .Em v_usecount , | | 282 | .Em v_usecount , |
281 | .Em v_writecount | | 283 | .Em v_writecount |
282 | and | | 284 | and |
283 | .Em v_holdcnt | | 285 | .Em v_holdcnt |
284 | is also protected by the | | 286 | is also protected by the |
285 | .Em v_interlock | | 287 | .Em v_interlock |
286 | simplelock. | | 288 | mutex. |
287 | .Pp | | 289 | .Pp |
288 | The number of pending synchronous and asynchronous writes on the | | 290 | The number of pending synchronous and asynchronous writes on the |
289 | vnode are recorded in | | 291 | vnode are recorded in |
290 | .Em v_numoutput . | | 292 | .Em v_numoutput . |
291 | It is used by | | 293 | It is used by |
292 | .Xr fsync 2 | | 294 | .Xr fsync 2 |
293 | to wait for all writes to complete before returning to the user. | | 295 | to wait for all writes to complete before returning to the user. |
294 | Its value must only be modified at splbio (see | | 296 | Its value must only be modified at splbio (see |
295 | .Xr spl 9 ) . | | 297 | .Xr spl 9 ) . |
296 | It does not track the number of dirty buffers attached to the | | 298 | It does not track the number of dirty buffers attached to the |
297 | vnode. | | 299 | vnode. |
298 | .Pp | | 300 | .Pp |
299 | .Em v_dnclist | | 301 | .Em v_dnclist |
| @@ -324,28 +326,27 @@ See | | | @@ -324,28 +326,27 @@ See |
324 | .Xr vnodeops 9 | | 326 | .Xr vnodeops 9 |
325 | for a description of vnode operations. | | 327 | for a description of vnode operations. |
326 | .Pp | | 328 | .Pp |
327 | When not in use, vnodes are kept on the freelist through | | 329 | When not in use, vnodes are kept on the freelist through |
328 | .Em v_freelist . | | 330 | .Em v_freelist . |
329 | The vnodes still reference valid files but may be reused to refer to a | | 331 | The vnodes still reference valid files but may be reused to refer to a |
330 | new file at any time. | | 332 | new file at any time. |
331 | When a valid vnode which is on the freelist is used again, the user | | 333 | When a valid vnode which is on the freelist is used again, the user |
332 | must call | | 334 | must call |
333 | .Fn vget | | 335 | .Fn vget |
334 | to increment the reference count and retrieve it from the freelist. | | 336 | to increment the reference count and retrieve it from the freelist. |
335 | When a user wants a new vnode for another file, | | 337 | When a user wants a new vnode for another file, |
336 | .Fn getnewvnode | | 338 | .Fn getnewvnode |
337 | is invoked to remove a vnode from the freelist and initialize it for | | 339 | is invoked to allocate a vnode and initialize it for the new file. |
338 | the new file. | | | |
339 | .Pp | | 340 | .Pp |
340 | The type of object the vnode represents is recorded by | | 341 | The type of object the vnode represents is recorded by |
341 | .Em v_type . | | 342 | .Em v_type . |
342 | It is used by generic code to perform checks to ensure operations are | | 343 | It is used by generic code to perform checks to ensure operations are |
343 | performed on valid file system objects. | | 344 | performed on valid file system objects. |
344 | Valid types are: | | 345 | Valid types are: |
345 | .Pp | | 346 | .Pp |
346 | .Bl -tag -offset indent -width VFIFO -compact | | 347 | .Bl -tag -offset indent -width VFIFO -compact |
347 | .It VNON | | 348 | .It VNON |
348 | The vnode has no type. | | 349 | The vnode has no type. |
349 | .It VREG | | 350 | .It VREG |
350 | The vnode represents a regular file. | | 351 | The vnode represents a regular file. |
351 | .It VDIR | | 352 | .It VDIR |
| @@ -519,36 +520,38 @@ and | | | @@ -519,36 +520,38 @@ and |
519 | are zero, the vnode is placed on the freelist. | | 520 | are zero, the vnode is placed on the freelist. |
520 | .It Fn vrele_async "vp" | | 521 | .It Fn vrele_async "vp" |
521 | Will asychronously release the vnode in different context than the caller, | | 522 | Will asychronously release the vnode in different context than the caller, |
522 | sometime after the call. | | 523 | sometime after the call. |
523 | .It Fn vget "vp" "lockflags" | | 524 | .It Fn vget "vp" "lockflags" |
524 | Reclaim vnode | | 525 | Reclaim vnode |
525 | .Fa vp | | 526 | .Fa vp |
526 | from the freelist, increment its reference count and lock it. | | 527 | from the freelist, increment its reference count and lock it. |
527 | The argument | | 528 | The argument |
528 | .Fa lockflags | | 529 | .Fa lockflags |
529 | specifies the | | 530 | specifies the |
530 | .Xr rwlock 9 | | 531 | .Xr rwlock 9 |
531 | flags used to lock the vnode. | | 532 | flags used to lock the vnode. |
532 | If the VXLOCK is set in | | 533 | If the |
| | | 534 | .Em VI_XLOCK |
| | | 535 | is set in |
533 | .Fa vp Ns 's | | 536 | .Fa vp Ns 's |
534 | .Em v_flag , | | 537 | .Em v_flag , |
535 | vnode | | 538 | vnode |
536 | .Fa vp | | 539 | .Fa vp |
537 | is being recycled in | | 540 | is being recycled in |
538 | .Fn vgone | | 541 | .Fn vgone |
539 | and the calling thread sleeps until the transition is complete. | | 542 | and the calling thread sleeps until the transition is complete. |
540 | When it is awakened, an error is returned to indicate that the vnode is | | 543 | When it is awakened, an error is returned to indicate that the vnode is |
541 | no longer usable (possibly having been recycled to a new file system type). | | 544 | no longer usable. |
542 | .It Fn vput "vp" | | 545 | .It Fn vput "vp" |
543 | Unlock vnode | | 546 | Unlock vnode |
544 | .Fa vp | | 547 | .Fa vp |
545 | and decrement its | | 548 | and decrement its |
546 | .Em v_usecount . | | 549 | .Em v_usecount . |
547 | Depending on the reference counts, move the vnode to the holdlist or | | 550 | Depending on the reference counts, move the vnode to the holdlist or |
548 | the freelist. | | 551 | the freelist. |
549 | This operation is functionally equivalent to calling | | 552 | This operation is functionally equivalent to calling |
550 | .Xr VOP_UNLOCK 9 | | 553 | .Xr VOP_UNLOCK 9 |
551 | followed by | | 554 | followed by |
552 | .Fn vrele . | | 555 | .Fn vrele . |
553 | .It Fn vhold "vp" | | 556 | .It Fn vhold "vp" |
554 | Mark the vnode | | 557 | Mark the vnode |
| @@ -558,34 +561,27 @@ as active by incrementing | | | @@ -558,34 +561,27 @@ as active by incrementing |
558 | and moving the vnode from the freelist to the holdlist. | | 561 | and moving the vnode from the freelist to the holdlist. |
559 | Once on the holdlist, the vnode will not be recycled until it is | | 562 | Once on the holdlist, the vnode will not be recycled until it is |
560 | released with | | 563 | released with |
561 | .Fn holdrele . | | 564 | .Fn holdrele . |
562 | .It Fn holdrele "vp" | | 565 | .It Fn holdrele "vp" |
563 | Mark the vnode | | 566 | Mark the vnode |
564 | .Fa vp | | 567 | .Fa vp |
565 | as inactive by decrementing | | 568 | as inactive by decrementing |
566 | .Em vp-\*[Gt]v_holdcnt | | 569 | .Em vp-\*[Gt]v_holdcnt |
567 | and moving the vnode from the holdlist to the freelist. | | 570 | and moving the vnode from the holdlist to the freelist. |
568 | .It Fn getnewvnode "tag" "mp" "vops" "slock" "vpp" | | 571 | .It Fn getnewvnode "tag" "mp" "vops" "slock" "vpp" |
569 | Retrieve the next vnode from the freelist. | | 572 | Retrieve the next vnode from the freelist. |
570 | .Fn getnewvnode | | 573 | .Fn getnewvnode |
571 | must choose whether to allocate a new vnode or recycle an existing | | 574 | allocates a new vnode. |
572 | one. | | | |
573 | The criterion for allocating a new one is that the total number of | | | |
574 | vnodes is less than the number desired or there are no vnodes on either | | | |
575 | free list. | | | |
576 | Generally only vnodes that have no buffers associated with them are | | | |
577 | recycled and the next vnode from the freelist is retrieved. | | | |
578 | If the freelist is empty, vnodes on the holdlist are considered. | | | |
579 | The new vnode is returned in the address specified by | | 575 | The new vnode is returned in the address specified by |
580 | .Fa vpp . | | 576 | .Fa vpp . |
581 | .Pp | | 577 | .Pp |
582 | The argument | | 578 | The argument |
583 | .Fa mp | | 579 | .Fa mp |
584 | is the mount point for the file system requested the new vnode. | | 580 | is the mount point for the file system requested the new vnode. |
585 | Before retrieving the new vnode, the file system is checked if it is | | 581 | Before retrieving the new vnode, the file system is checked if it is |
586 | busy (such as currently unmounting). | | 582 | busy (such as currently unmounting). |
587 | An error is returned if the file system is unmounted. | | 583 | An error is returned if the file system is unmounted. |
588 | .Pp | | 584 | .Pp |
589 | The argument | | 585 | The argument |
590 | .Fa tag | | 586 | .Fa tag |
591 | is the vnode tag assigned to | | 587 | is the vnode tag assigned to |
| @@ -610,27 +606,27 @@ If | | | @@ -610,27 +606,27 @@ If |
610 | .It Fn ungetnewvnode "vp" | | 606 | .It Fn ungetnewvnode "vp" |
611 | Undo the operation of | | 607 | Undo the operation of |
612 | .Fn getnewvnode . | | 608 | .Fn getnewvnode . |
613 | The argument | | 609 | The argument |
614 | .Fa vp | | 610 | .Fa vp |
615 | is the vnode to return to the freelist. | | 611 | is the vnode to return to the freelist. |
616 | This function is needed for | | 612 | This function is needed for |
617 | .Xr VFS_VGET 9 | | 613 | .Xr VFS_VGET 9 |
618 | which may need to push back a vnode in case of a locking race | | 614 | which may need to push back a vnode in case of a locking race |
619 | condition. | | 615 | condition. |
620 | .It Fn vrecycle "vp" "inter_lkp" | | 616 | .It Fn vrecycle "vp" "inter_lkp" |
621 | Recycle the unused vnode | | 617 | Recycle the unused vnode |
622 | .Fa vp | | 618 | .Fa vp |
623 | to the front of the freelist. | | 619 | from the front of the freelist. |
624 | .Fn vrecycle | | 620 | .Fn vrecycle |
625 | is a null operation if the reference count is greater than zero. | | 621 | is a null operation if the reference count is greater than zero. |
626 | .It Fn vgone "vp" | | 622 | .It Fn vgone "vp" |
627 | Eliminate all activity associated with the unlocked vnode | | 623 | Eliminate all activity associated with the unlocked vnode |
628 | .Fa vp | | 624 | .Fa vp |
629 | in preparation for recycling. | | 625 | in preparation for recycling. |
630 | .It Fn vgonel "vp" "p" | | 626 | .It Fn vgonel "vp" "p" |
631 | Eliminate all activity associated with the locked vnode | | 627 | Eliminate all activity associated with the locked vnode |
632 | .Fa vp | | 628 | .Fa vp |
633 | in preparation for recycling. | | 629 | in preparation for recycling. |
634 | .It Fn vflush "mp" "skipvp" "flags" | | 630 | .It Fn vflush "mp" "skipvp" "flags" |
635 | Remove any vnodes in the vnode table belonging to mount point | | 631 | Remove any vnodes in the vnode table belonging to mount point |
636 | .Fa mp . | | 632 | .Fa mp . |