blob: 5c45def38a247e8fd4763cf34a96e1fb57c94d75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<table class="head">
<tr>
<td class="head-ltitle">VGET(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">VGET(9)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">vget</code> — <span class="Nd">get a vnode
from the free list</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
<<a class="In">sys/param.h</a>></code>
<br/>
<code class="In">#include <<a class="In">sys/vnode.h</a>></code></p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">vget</code>(<var class="Fa" style="white-space: nowrap;">struct
vnode *vp</var>, <var class="Fa" style="white-space: nowrap;">int
lockflag</var>, <var class="Fa" style="white-space: nowrap;">struct thread
*td</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Get a vnode from the free list and increment its reference
count.</p>
<dl class="Bl-tag">
<dt><var class="Fa">vp</var></dt>
<dd>The vnode to remove from the free list.</dd>
<dt><var class="Fa">lockflag</var></dt>
<dd>If non-zero, the vnode will also be locked.</dd>
</dl>
<p class="Pp">When not in use, vnodes are kept on a free list. The vnodes still
reference valid files but may be reused to refer to a new file at any time.
Often, these vnodes are also held in caches in the system, such as the name
cache.</p>
<p class="Pp" id="vget">When a vnode which is on the free list is used again,
for instance if the vnode was found in the name cache as a result of a call
to <a class="Xr">VOP_LOOKUP(9)</a> then the new user must call
<a class="permalink" href="#vget"><code class="Fn">vget</code></a>() to
increment the reference count and remove it from the free list.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">vnode(9)</a>, <a class="Xr">vput(9)</a>,
<a class="Xr">vref(9)</a>, <a class="Xr">vrele(9)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page was written by <span class="An">Doug
Rabson</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">July 24, 1996</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|