xref: /freebsd/share/man/man9/vhold.9 (revision 8ad9c3234598813c890ad34e5283a2e7d0f881bf)
121642577SAlfred Perlstein.\"
221642577SAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
321642577SAlfred Perlstein.\"
421642577SAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without
521642577SAlfred Perlstein.\" modification, are permitted provided that the following conditions
621642577SAlfred Perlstein.\" are met:
721642577SAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright
821642577SAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer as
921642577SAlfred Perlstein.\"    the first lines of this file unmodified other than the possible
1021642577SAlfred Perlstein.\"    addition of one or more copyright notices.
1121642577SAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright
1221642577SAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer in the
1321642577SAlfred Perlstein.\"    documentation and/or other materials provided with the distribution.
1421642577SAlfred Perlstein.\"
1521642577SAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
1621642577SAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1721642577SAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1821642577SAlfred Perlstein.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
1921642577SAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2021642577SAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2121642577SAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2221642577SAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2321642577SAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2421642577SAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2521642577SAlfred Perlstein.\" DAMAGE.
2621642577SAlfred Perlstein.\"
2721642577SAlfred Perlstein.\" $FreeBSD$
2821642577SAlfred Perlstein.\"
298ad9c323SMaxim Konovalov.Dd April 1, 2007
3021642577SAlfred Perlstein.Dt VHOLD 9
3121642577SAlfred Perlstein.Os
3221642577SAlfred Perlstein.Sh NAME
338ad9c323SMaxim Konovalov.Nm vhold , vdrop , vdropl
341f620c2eSRuslan Ermilov.Nd "acquire/release a hold on a vnode"
3521642577SAlfred Perlstein.Sh SYNOPSIS
3621642577SAlfred Perlstein.In sys/param.h
3721642577SAlfred Perlstein.In sys/vnode.h
3821642577SAlfred Perlstein.Ft void
3921642577SAlfred Perlstein.Fn vhold "struct vnode *vp"
4021642577SAlfred Perlstein.Ft void
4121642577SAlfred Perlstein.Fn vdrop "struct vnode *vp"
428ad9c323SMaxim Konovalov.Ft void
438ad9c323SMaxim Konovalov.Fn vdropl "struct vnode *vp"
4421642577SAlfred Perlstein.Sh DESCRIPTION
4521642577SAlfred PerlsteinThe
4621642577SAlfred Perlstein.Fn vhold
471f620c2eSRuslan Ermilovfunction increments the
481f620c2eSRuslan Ermilov.Va v_holdcnt
491f620c2eSRuslan Ermilovof the given vnode.
501f620c2eSRuslan ErmilovIf the vnode has already been added to the free list and is still referenced,
5121642577SAlfred Perlsteinit will be removed.
5221642577SAlfred Perlstein.Pp
5321642577SAlfred PerlsteinThe
5421642577SAlfred Perlstein.Fn vdrop
558ad9c323SMaxim Konovalovand
568ad9c323SMaxim Konovalov.Fn vdropl
578ad9c323SMaxim Konovalovfunctions decrement the
581f620c2eSRuslan Ermilov.Va v_holdcnt
591f620c2eSRuslan Ermilovof the vnode.
600167ce0dSCraig RodriguesIf the holdcount is less than or equal to zero prior to calling
618ad9c323SMaxim Konovalov.Fn vdrop
628ad9c323SMaxim Konovalovor
638ad9c323SMaxim Konovalov.Fn vdropl ,
6421642577SAlfred Perlsteinthe system will panic.
650167ce0dSCraig RodriguesIf the vnode is no longer referenced, it will be freed.
668ad9c323SMaxim Konovalov.Pp
678ad9c323SMaxim KonovalovThe difference between
688ad9c323SMaxim Konovalov.Fn vdrop
698ad9c323SMaxim Konovalovand
708ad9c323SMaxim Konovalov.Fn vdropl
718ad9c323SMaxim Konovalovis that
728ad9c323SMaxim Konovalov.Fn vdrop
738ad9c323SMaxim Konovalovlocks the vnode interlock and then calls
748ad9c323SMaxim Konovalov.Fn vdropl
758ad9c323SMaxim Konovalovwhile
768ad9c323SMaxim Konovalov.Fn vdropl
778ad9c323SMaxim Konovalovexpects the interlock to already be locked.
7821642577SAlfred Perlstein.Sh SEE ALSO
791f620c2eSRuslan Ermilov.Xr vbusy 9 ,
801f620c2eSRuslan Ermilov.Xr vfree 9
8121642577SAlfred Perlstein.Sh AUTHORS
82571dba6eSHiten PandyaThis manual page was written by
8321642577SAlfred Perlstein.An Chad David Aq davidc@acns.ab.ca .
84