diff options
author | kn <kn@cvs.openbsd.org> | 2018-06-04 19:42:55 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2018-06-04 19:42:55 +0000 |
commit | 6fc3d0ef8ac74074f0c89fac977998396400a3a3 (patch) | |
tree | 7f18972ae60c63f259ac2fe71f764327b2a29f1b /share | |
parent | fb977e3d8d7d6929b8e5f0b472ccafbed4133a7d (diff) |
Sync VFS documentation with reality
Missed during the "Namecache revamp" in 2009.
Reported by Georg Bege <georg at bege dot email>, thanks.
OK visa jmc mpi jca
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/VOP_LOOKUP.9 | 6 | ||||
-rw-r--r-- | share/man/man9/vfs_cache.9 | 18 | ||||
-rw-r--r-- | share/man/man9/vnode.9 | 68 |
3 files changed, 49 insertions, 43 deletions
diff --git a/share/man/man9/VOP_LOOKUP.9 b/share/man/man9/VOP_LOOKUP.9 index 060bfa05a93..49357b336a3 100644 --- a/share/man/man9/VOP_LOOKUP.9 +++ b/share/man/man9/VOP_LOOKUP.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: VOP_LOOKUP.9,v 1.41 2018/04/28 03:13:04 visa Exp $ +.\" $OpenBSD: VOP_LOOKUP.9,v 1.42 2018/06/04 19:42:54 kn Exp $ .\" .\" Copyright (c) 2003 Ted Unangst .\" Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 28 2018 $ +.Dd $Mdocdate: June 4 2018 $ .Dt VOP_LOOKUP 9 .Os .Sh NAME @@ -327,7 +327,7 @@ struct vattr { uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ long va_fsid; /* file system id */ - long va_fileid; /* file id */ + u_quad_t va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ long va_blocksize; /* blocksize preferred for i/o */ struct timespec va_atime; /* time of last access */ diff --git a/share/man/man9/vfs_cache.9 b/share/man/man9/vfs_cache.9 index e294d3effcc..b6ebe043f3a 100644 --- a/share/man/man9/vfs_cache.9 +++ b/share/man/man9/vfs_cache.9 @@ -1,7 +1,7 @@ -.\" $OpenBSD: vfs_cache.9,v 1.3 2007/05/31 19:20:01 jmc Exp $ +.\" $OpenBSD: vfs_cache.9,v 1.4 2018/06/04 19:42:54 kn Exp $ .\" Written by Jared Yanovich <jaredy@openbsd.org> .\" Public domain, 2005/6/17 -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: June 4 2018 $ .Dt VFS_CACHE 9 .Os .Sh NAME @@ -37,15 +37,16 @@ recently looked-up file name translations. Entries in this cache have the following definition: .Bd -literal struct namecache { - LIST_ENTRY(namecache) nc_hash; /* hash chain */ - LIST_ENTRY(namecache) nc_vhash; /* (reverse) dir hash chain */ - TAILQ_ENTRY(namecache) nc_lru; /* LRU chain */ + TAILQ_ENTRY(namecache) nc_lru; /* Regular Entry LRU chain */ + TAILQ_ENTRY(namecache) nc_neg; /* Negative Entry LRU chain */ + RBT_ENTRY(namecache) n_rbcache; /* Namecache rb tree from vnode */ + TAILQ_ENTRY(namecache) nc_me; /* ncp's referring to me */ struct vnode *nc_dvp; /* vnode of parent of name */ u_long nc_dvpid; /* capability number of nc_dvp */ struct vnode *nc_vp; /* vnode the name refers to */ u_long nc_vpid; /* capability number of nc_vp */ char nc_nlen; /* length of name */ - char nc_name[NCHNAMLEN]; /* segment name */ + char nc_name[NAMECACHE_MAXLEN]; /* segment name */ }; .Ed .Pp @@ -55,7 +56,7 @@ Negative caching is also performed so that frequently accessed path names of files that do not exist do not result in expensive lookups. .Pp File names with length longer than -.Dv NCHNAMLEN +.Dv NAMECACHE_MAXLEN are not cached to simplify lookups and to save space. Such names are rare and are generally not worth caching. .Pp @@ -169,7 +170,8 @@ API is implemented in the file .Xr vmstat 8 , .Xr namei 9 , .Xr vfs 9 , -.Xr vnode 9 +.Xr vnode 9 , +.Xr VOP_LOOKUP 9 .Sh HISTORY The .Nm diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 8a6cd97df8b..0b9b0b4117a 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vnode.9,v 1.28 2011/07/18 12:03:45 thib Exp $ +.\" $OpenBSD: vnode.9,v 1.29 2018/06/04 19:42:54 kn Exp $ .\" .\" Copyright (c) 2001 Constantine Sapuntzakis .\" All rights reserved. @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 18 2011 $ +.Dd $Mdocdate: June 4 2018 $ .Dt VNODE 9 .Os .Sh NAME @@ -66,41 +66,45 @@ provided by the VFS to create and manage vnodes. The definition of a vnode is as follows: .Bd -literal struct vnode { - struct uvm_vnode v_uvm; /* uvm(9) data */ - int (**v_op)(void *); /* vnode operations vector */ - enum vtype v_type; /* vnode type */ - u_int v_flag; /* vnode flags (see below) */ - u_int v_usecount; /* reference count of users */ - u_int v_writecount; /* reference count of writers */ + struct uvm_vnode *v_uvm; /* uvm data */ + struct vops *v_op; /* vnode operations vector */ + enum vtype v_type; /* vnode type */ + enum vtagtype v_tag; /* type of underlying data */ + u_int v_flag; /* vnode flags (see below) */ + u_int v_usecount; /* reference count of users */ + /* reference count of writers */ + u_int v_writecount; /* Flags that can be read/written in interrupts */ - u_int v_bioflag; /* flags used by intr handlers */ - u_int v_holdcnt; /* buffer references */ - u_int v_id; /* capability identifier */ - struct mount *v_mount; /* ptr to vfs we are in */ - TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ - LIST_ENTRY(vnode) v_mntvnodes; /* vnodes for mount point */ - struct buflists v_cleanblkhd; /* clean blocklist head */ - struct buflists v_dirtyblkhd; /* dirty blocklist head */ - u_int v_numoutput; /* num of writes in progress */ - LIST_ENTRY(vnode) v_synclist; /* vnode with dirty buffers */ + u_int v_bioflag; + u_int v_holdcnt; /* buffer references */ + u_int v_id; /* capability identifier */ + u_int v_inflight; + struct mount *v_mount; /* ptr to vfs we are in */ + TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ + LIST_ENTRY(vnode) v_mntvnodes; /* vnodes for mount point */ + struct buf_rb_bufs v_bufs_tree; /* lookup of all bufs */ + struct buflists v_cleanblkhd; /* clean blocklist head */ + struct buflists v_dirtyblkhd; /* dirty blocklist head */ + u_int v_numoutput; /* num of writes in progress */ + LIST_ENTRY(vnode) v_synclist; /* vnode with dirty buffers */ union { - struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */ - struct socket *vu_socket; /* UNIX IPC (VSOCK) */ - struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ - struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ + struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */ + struct socket *vu_socket; /* unix ipc (VSOCK) */ + struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ + struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ } v_un; - enum vtagtype v_tag; /* type of underlying data */ - void *v_data; /* private data for fs */ - struct { - struct simplelock vsi_lock; /* lock to protect below */ - struct selinfo vsi_selinfo; /* identity of poller(s) */ - } v_selectinfo; + /* VFS namecache */ + struct namecache_rb_cache v_nc_tree; + TAILQ_HEAD(, namecache) v_cache_dst; /* cache entries to us */ + + void *v_data; /* private data for fs */ + struct selinfo v_selectinfo; /* identity of poller(s) */ }; -#define v_mountedhere v_un.vu_mountedhere -#define v_socket v_un.vu_socket -#define v_specinfo v_un.vu_specinfo -#define v_fifoinfo v_un.vu_fifoinfo +#define v_mountedhere v_un.vu_mountedhere +#define v_socket v_un.vu_socket +#define v_specinfo v_un.vu_specinfo +#define v_fifoinfo v_un.vu_fifoinfo .Ed .Ss Vnode life cycle When a client of the VFS requests a new vnode, the vnode allocation |