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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<table class="head">
<tr>
<td class="head-ltitle">INSMNTQUE(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">INSMNTQUE(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">insmntque</code>,
<code class="Nm">insmntque1</code> — <span class="Nd">associate a
vnode with a mount</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">insmntque</code>(<var class="Fa" style="white-space: nowrap;">struct
vnode *vp</var>, <var class="Fa" style="white-space: nowrap;">struct mount
*mp</var>);</p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">insmntque1</code>(<var class="Fa" style="white-space: nowrap;">struct
vnode *vp</var>, <var class="Fa" style="white-space: nowrap;">struct mount
*mp</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The
<a class="permalink" href="#insmntque"><code class="Fn" id="insmntque">insmntque</code></a>()
function associates a vnode with a mount. This includes updating
<var class="Va">v_mount</var> for the vnode, and inserting the vnode into
the mount's vnode list.</p>
<p class="Pp">The indirect mount reference count, maintained as the count of the
vnodes owned by it, is incremented for each vnode added to the mount, and
that reference is decremented by <a class="Xr">vgone(9)</a>.</p>
<p class="Pp">The mount's interlock is held while the vnode is inserted. The
vnode must be exclusively locked.</p>
<p class="Pp" id="insmntque~2">On failure,
<a class="permalink" href="#insmntque~2"><code class="Fn">insmntque</code></a>()
resets vnode's operations vector to the vector of
<a class="Xr">deadfs(9)</a>, clears <var class="Va">v_data</var>, and then
calls <a class="Xr">vgone(9)</a> and <a class="Xr">vput(9)</a>. If more
elaborated cleanup after <code class="Fn">insmntque</code>() failure is
needed, the
<a class="permalink" href="#insmntque1"><code class="Fn" id="insmntque1">insmntque1</code></a>()
function may be used instead. It does not do any cleanup following a
failure, leaving all the work to the caller. In particular, the operations
vector <var class="Va">v_op</var> and <var class="Va">v_data</var> fields of
the vnode are kept intact.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
VALUES</a></h1>
<p class="Pp">The <code class="Fn">insmntque</code>() function will always
return 0, unless the file system is currently being unmounted in which case
it may return <code class="Dv">EBUSY</code>. Also,
<code class="Fn">insmntque</code>() may be forced to insert the vnode into
the mount's vnode list by setting the <var class="Va">VV_FORCEINSMQ</var>
flag in the vnode <var class="Va">v_flag</var>, even if the file system is
being unmounted.</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">vgone(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">Chad David</span>
<<a class="Mt" href="mailto:davidc@acns.ab.ca">davidc@acns.ab.ca</a>>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">October 24, 2025</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|