xref: /freebsd/share/man/man9/vhold.9 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1.\"
2.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice(s), this list of conditions and the following disclaimer as
9.\"    the first lines of this file unmodified other than the possible
10.\"    addition of one or more copyright notices.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice(s), this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25.\" DAMAGE.
26.\"
27.Dd April 1, 2007
28.Dt VHOLD 9
29.Os
30.Sh NAME
31.Nm vhold , vdrop , vdropl
32.Nd "acquire/release a hold on a vnode"
33.Sh SYNOPSIS
34.In sys/param.h
35.In sys/vnode.h
36.Ft void
37.Fn vhold "struct vnode *vp"
38.Ft void
39.Fn vholdl "struct vnode *vp"
40.Ft void
41.Fn vdrop "struct vnode *vp"
42.Ft void
43.Fn vdropl "struct vnode *vp"
44.Sh DESCRIPTION
45The
46.Fn vhold
47and
48.Fn vholdl
49functions increment the
50.Va v_holdcnt
51of the given vnode.
52If the vnode has already been added to the free list and is still referenced,
53it will be removed.
54.Pp
55The
56.Fn vdrop
57and
58.Fn vdropl
59functions decrement the
60.Va v_holdcnt
61of the vnode.
62If the holdcount is less than or equal to zero prior to calling
63.Fn vdrop
64or
65.Fn vdropl ,
66the system will panic.
67If the vnode is no longer referenced, it will be freed.
68.Pp
69.Fn vhold
70and
71.Fn vdrop
72lock the vnode interlock while
73.Fn vholdl
74and
75.Fn vdropl
76expect the interlock to already be held.
77.Sh SEE ALSO
78.Xr vnode 9
79.Sh AUTHORS
80This manual page was written by
81.An Chad David Aq Mt davidc@acns.ab.ca .
82