1.\" 2.\" Copyright (c) 2009 3.\" The DragonFly Project. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in 13.\" the documentation and/or other materials provided with the 14.\" distribution. 15.\" 3. Neither the name of The DragonFly Project nor the names of its 16.\" contributors may be used to endorse or promote products derived 17.\" from this software without specific, prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 22.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 23.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 25.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 27.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 29.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.Dd December 14, 2009 33.Dt VCOUNT 9 34.Os 35.Sh NAME 36.Nm vcount , 37.Nm count_dev 38.Nd "get total number of references to a device" 39.Sh SYNOPSIS 40.In sys/conf.h 41.In sys/vnode.h 42.Ft int 43.Fn vcount "struct vnode *vp" 44.Ft int 45.Fn count_dev "cdev_t dev" 46.Sh DESCRIPTION 47.Fn vcount 48is used to get the number of references to a special device. 49This makes sense because multiple vnodes may reference the same device. 50.Pp 51.Fn count_dev 52does the same thing as 53.Fn vcount , 54but takes a 55.Vt cdev_t 56rather than a 57.Vt "struct vnode" 58pointer as an argument. 59It may only be called for 60.Dv VBLK 61and 62.Dv VCHR 63vnodes since 64.Fa v_rdev 65is an overloaded field. 66.Sh RETURN VALUES 67.Fn vcount 68and 69.Fn count_dev 70both return the number of references to the device. 71.Sh SEE ALSO 72.Xr vnode 9 73