2001-12-02 02:13:35 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice(s), this list of conditions and the following disclaimer as
|
|
|
|
.\" the first lines of this file unmodified other than the possible
|
|
|
|
.\" addition of one or more copyright notices.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice(s), this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
|
|
|
|
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
|
|
|
|
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
.\" DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2007-04-01 09:48:59 +00:00
|
|
|
.Dd April 1, 2007
|
2001-12-02 02:13:35 +00:00
|
|
|
.Dt VHOLD 9
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2007-04-01 09:48:59 +00:00
|
|
|
.Nm vhold , vdrop , vdropl
|
2001-12-14 09:11:13 +00:00
|
|
|
.Nd "acquire/release a hold on a vnode"
|
2001-12-02 02:13:35 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/param.h
|
|
|
|
.In sys/vnode.h
|
|
|
|
.Ft void
|
|
|
|
.Fn vhold "struct vnode *vp"
|
|
|
|
.Ft void
|
2008-02-26 20:25:01 +00:00
|
|
|
.Fn vholdl "struct vnode *vp"
|
|
|
|
.Ft void
|
2001-12-02 02:13:35 +00:00
|
|
|
.Fn vdrop "struct vnode *vp"
|
2007-04-01 09:48:59 +00:00
|
|
|
.Ft void
|
|
|
|
.Fn vdropl "struct vnode *vp"
|
2001-12-02 02:13:35 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn vhold
|
2008-02-26 20:25:01 +00:00
|
|
|
and
|
|
|
|
.Fn vholdl
|
|
|
|
functions increment the
|
2001-12-14 09:11:13 +00:00
|
|
|
.Va v_holdcnt
|
|
|
|
of the given vnode.
|
|
|
|
If the vnode has already been added to the free list and is still referenced,
|
2001-12-02 02:13:35 +00:00
|
|
|
it will be removed.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn vdrop
|
2007-04-01 09:48:59 +00:00
|
|
|
and
|
|
|
|
.Fn vdropl
|
|
|
|
functions decrement the
|
2001-12-14 09:11:13 +00:00
|
|
|
.Va v_holdcnt
|
|
|
|
of the vnode.
|
2005-07-22 00:28:22 +00:00
|
|
|
If the holdcount is less than or equal to zero prior to calling
|
2007-04-01 09:48:59 +00:00
|
|
|
.Fn vdrop
|
|
|
|
or
|
|
|
|
.Fn vdropl ,
|
2001-12-02 02:13:35 +00:00
|
|
|
the system will panic.
|
2005-07-22 00:28:22 +00:00
|
|
|
If the vnode is no longer referenced, it will be freed.
|
2007-04-01 09:48:59 +00:00
|
|
|
.Pp
|
2008-02-26 20:25:01 +00:00
|
|
|
.Fn vhold
|
2007-04-01 09:48:59 +00:00
|
|
|
and
|
|
|
|
.Fn vdrop
|
2008-02-26 20:25:01 +00:00
|
|
|
lock the vnode interlock while
|
|
|
|
.Fn vholdl
|
|
|
|
and
|
2007-04-01 09:48:59 +00:00
|
|
|
.Fn vdropl
|
2008-02-26 20:25:01 +00:00
|
|
|
expect the interlock to already be held.
|
2001-12-02 02:13:35 +00:00
|
|
|
.Sh SEE ALSO
|
2008-02-26 20:25:01 +00:00
|
|
|
.Xr vnode 9
|
2001-12-02 02:13:35 +00:00
|
|
|
.Sh AUTHORS
|
2005-06-28 20:15:19 +00:00
|
|
|
This manual page was written by
|
2014-06-26 21:44:30 +00:00
|
|
|
.An Chad David Aq Mt davidc@acns.ab.ca .
|