update to match with the recent reality. PR/28793.

This commit is contained in:
yamt 2004-12-28 18:36:45 +00:00
parent 68490c8820
commit 41fc72dca2
2 changed files with 18 additions and 19 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: namecache.9,v 1.8 2003/04/16 13:35:31 wiz Exp $ .\" $NetBSD: namecache.9,v 1.9 2004/12/28 18:36:45 yamt Exp $
.\" .\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -95,10 +95,11 @@ struct namecache {
LIST_ENTRY(namecache) nc_hash; /* hash chain */ LIST_ENTRY(namecache) nc_hash; /* hash chain */
TAILQ_ENTRY(namecache) nc_lru; /* LRU chain */ TAILQ_ENTRY(namecache) nc_lru; /* LRU chain */
LIST_ENTRY(namecache) nc_vhash; /* directory hash chain */ LIST_ENTRY(namecache) nc_vhash; /* directory hash chain */
LIST_ENTRY(namecache) nc_dvlist;
struct vnode *nc_dvp; /* vnode of parent of name */ struct vnode *nc_dvp; /* vnode of parent of name */
u_long nc_dvpid; /* capability number of nc_dvp */ LIST_ENTRY(namecache) nc_vlist;
struct vnode *nc_vp; /* vnode the name refers to */ struct vnode *nc_vp; /* vnode the name refers to */
u_long nc_vpid; /* capability number of nc_vp */ int nc_flags; /* copy of componentname's ISWHITEOUT */
char nc_nlen; /* length of name */ char nc_nlen; /* length of name */
char nc_name[NCHNAMLEN]; /* segment name */ char nc_name[NCHNAMLEN]; /* segment name */
}; };

View File

@ -1,4 +1,4 @@
.\" $NetBSD: vnode.9,v 1.22 2004/05/26 23:00:32 wiz Exp $ .\" $NetBSD: vnode.9,v 1.23 2004/12/28 18:36:45 yamt Exp $
.\" .\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -157,8 +157,6 @@ struct vnode {
int v_numoutput; /* num pending writes */ int v_numoutput; /* num pending writes */
long v_writecount; /* ref count of writers */ long v_writecount; /* ref count of writers */
long v_holdcnt; /* page \*[Am] buffer refs */ long v_holdcnt; /* page \*[Am] buffer refs */
daddr_t v_lastr; /* last read */
u_long v_id; /* capability id */
struct mount *v_mount; /* ptr to vfs we are in */ struct mount *v_mount; /* ptr to vfs we are in */
int (**v_op)(void *); /* vnode ops vector */ int (**v_op)(void *); /* vnode ops vector */
TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */
@ -166,6 +164,8 @@ struct vnode {
struct buflists v_cleanblkhd; /* clean blocklist head */ struct buflists v_cleanblkhd; /* clean blocklist head */
struct buflists v_dirtyblkhd; /* dirty blocklist head */ struct buflists v_dirtyblkhd; /* dirty blocklist head */
LIST_ENTRY(vnode) v_synclist; /* dirty vnodes */ LIST_ENTRY(vnode) v_synclist; /* dirty vnodes */
LIST_HEAD(, namecache) v_dnclist; /* namecaches for children */
LIST_HEAD(, namecache) v_nclist; /* namecaches for our parent */
union { union {
struct mount *vu_mountedhere;/* ptr to mounted vfs */ struct mount *vu_mountedhere;/* ptr to mounted vfs */
struct socket *vu_socket; /* unix ipc (VSOCK) */ struct socket *vu_socket; /* unix ipc (VSOCK) */
@ -182,6 +182,10 @@ struct vnode {
struct lock v_lock; /* lock for this vnode */ struct lock v_lock; /* lock for this vnode */
struct lock *v_vnlock; /* ptr to vnode lock */ struct lock *v_vnlock; /* ptr to vnode lock */
void *v_data; /* private data for fs */ void *v_data; /* private data for fs */
struct klist v_klist; /* knotes attached to vnode */
#ifdef VERIFIED_EXEC
char fp_status; /* fingerprint status */
#endif
}; };
.Ed .Ed
.Pp .Pp
@ -305,18 +309,14 @@ Its value must only be modified at splbio (see
It does not track the number of dirty buffers attached to the It does not track the number of dirty buffers attached to the
vnode. vnode.
.Pp .Pp
Every time a vnode is reassigned to a new file, the vnode capability .Em v_dnclist
identifier and
.Em v_id .Em v_nclist
is changed. are used by
It is used to maintain the name lookup cache consistency by providing
a unique \*[Lt]vnode *,v_id\*[Gt] tuple without requiring the cache to
hold a reference.
The name lookup cache can later compare the vnode's capability identifier
to its copy and see if the vnode still points to the same file.
See
.Xr namecache 9 .Xr namecache 9
for details on the name lookup cache. to maintain the list of associated entries so that
.Xr cache_purge 9
can purge them.
.Pp .Pp
The link to the file system which owns the vnode is recorded by The link to the file system which owns the vnode is recorded by
.Em v_mount . .Em v_mount .
@ -341,8 +341,6 @@ When not in use, vnodes are kept on the freelist through
.Em v_freelist . .Em v_freelist .
The vnodes still reference valid files but may be reused to refer to a The vnodes still reference valid files but may be reused to refer to a
new file at any time. new file at any time.
Often, these vnodes are also held in caches in the system, such as
the name lookup cache.
When a valid vnode which is on the freelist is used again, the user When a valid vnode which is on the freelist is used again, the user
must call must call
.Fn vget .Fn vget