1 .\" Copyright (c) 1996 Doug Rabson
3 .\" All rights reserved.
5 .\" This program is free software.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\" $FreeBSD: src/share/man/man9/vnode.9,v 1.10.2.5 2001/12/17 11:30:19 ru Exp $
28 .\" $DragonFly: src/share/man/man9/vnode.9,v 1.8 2007/05/17 08:19:02 swildner Exp $
35 .Nd internal representation of a file, directory, or other VFS entity
40 The vnode is the focus of all file activity in
47 unique vnode allocated for each active file, each current directory,
48 each mounted-on file, text file, and the root.
50 Each vnode has numerous reference counts,
58 represents the number of primary references to the vnode.
60 a structure which utilizes the SYSREF API and also manages allocation and
61 deallocation of the vnode.
62 Primary references keep a vnode ready for I/O and prevent it from being
64 Primary references are managed by
70 represents the number of auxiliary references to a vnode.
71 Auxiliary references prevent a vnode from being reclaimed (if not already being
72 reclaimed), reused for other purposes, or otherwise destroyed, but
73 do not activate or deactivate the vnode.
74 Auxiliary references are managed by
80 represents the number of discrete
82 calls made on the vnode (reading or writing).
84 represents the number of discrete
86 calls made on the vnode for the purpose of writing.
87 This field will be a subset of
89 These fields are managed primarily by calls to
94 A deactivated vnode or a vnode in an unknown state accessed from an
95 Auxiliary data structure can be reactivated, referenced, and locked using
100 An actively referenced and possibly locked vnode must be passed
101 to most kernel procedures taking a vnode as an argument.
102 Most kernel procedures returning a vnode will return one that is actively
105 Other commonly used members of the vnode structure are
107 which points at the filesystem which owns the vnode,
109 which contains the type of object the vnode represents and
111 which is used by filesystems to store filesystem specific data with
117 macros to call functions in the filesystem which implement the vnode's
120 .Bl -tag -width ".Dv VSOCK"
124 A regular file; may be with or without VM object backing.
125 If you want to make sure this get a backing object, call
126 .Xr vfs_object_create 9 .
130 A block device; may be with or without VM object backing.
131 If you want to make sure this get a backing object, call
132 .Xr vfs_object_create 9 .
139 Advisory locking won't work on this.
142 Advisory locking won't work on this.
144 An old style bad sector map.
146 .Sh IMPLEMENTATION NOTES
151 .Pa /sys/kern/sys_pipe.c .
156 .Pa /sys/kern/sys_socket.c .
157 Everything else uses the one from
158 .Pa /sys/kern/vfs_vnops.c .
160 The VFIFO/VSOCK code, which is why
162 is used at all, is an artifact of an incomplete integration of
163 the VFS code into the kernel.
167 This manual page was written by