Spotted and reported on IRC by Georg Bege <georg@bege.email>,
vfs_cache(9) lacks way behind beck's "Namecache revamp" from 2009.

This diff syncs the manual with sys/sys/namei.h and sys/kern/vfs_cache.c:
I went through it and checked the APIs, this seems fine to me for now
but since I'm not all too familiar with VFS yet, feedback is welcome.

Maybe we want to sync descriptions in the manual a bit more with code
comments to reduce differences in two places describing the same thing?

Index: vfs_cache.9
===================================================================
RCS file: /cvs/src/share/man/man9/vfs_cache.9,v
retrieving revision 1.3
diff -u -p -r1.3 vfs_cache.9
--- vfs_cache.9 31 May 2007 19:20:01 -0000      1.3
+++ vfs_cache.9 27 May 2018 14:04:18 -0000
@@ -37,15 +37,16 @@ recently looked-up file name translation
 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 th
 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

Reply via email to