Module Name:    src
Committed By:   ad
Date:           Sun Mar 22 14:39:04 UTC 2020

Modified Files:
        src/sys/rump/include/rump: rump_namei.h
        src/sys/sys: namei.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.104 -r1.105 src/sys/sys/namei.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.38 src/sys/rump/include/rump/rump_namei.h:1.39
--- src/sys/rump/include/rump/rump_namei.h:1.38	Wed Jan  8 12:06:09 2020
+++ src/sys/rump/include/rump/rump_namei.h	Sun Mar 22 14:39:03 2020
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.38 2020/01/08 12:06:09 ad Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.39 2020/03/22 14:39:03 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.48 2020/01/08 12:04:56 ad Exp 
+ *   from: NetBSD: namei.src,v 1.49 2020/03/22 14:38:37 ad Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.104 src/sys/sys/namei.h:1.105
--- src/sys/sys/namei.h:1.104	Wed Jan  8 12:06:10 2020
+++ src/sys/sys/namei.h	Sun Mar 22 14:39:03 2020
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.104 2020/01/08 12:06:10 ad Exp $	*/
+/*	$NetBSD: namei.h,v 1.105 2020/03/22 14:39:03 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.48 2020/01/08 12:04:56 ad Exp 
+ *   from: NetBSD: namei.src,v 1.49 2020/03/22 14:38:37 ad Exp 
  */
 
 /*
@@ -47,6 +47,7 @@
 
 #ifdef _KERNEL
 #include <sys/kauth.h>
+#include <sys/rwlock.h>
 
 /*
  * Abstraction for a single pathname.
@@ -196,42 +197,43 @@ struct nameidata {
 #endif
 
 #ifdef __NAMECACHE_PRIVATE
+#include <sys/rbtree.h>
+
 /*
  * For simplicity (and economy of storage), names longer than
  * a maximum length of NCHNAMLEN are stored in non-pooled storage.
  */
-#define	NCHNAMLEN	32	/* up to this size gets stored in pool */
+#define	NCHNAMLEN	sizeof(((struct namecache *)NULL)->nc_name)
 
 /*
- * Namecache entry.  
- * This structure describes the elements in the cache of recent
- * names looked up by namei.
+ * Namecache entry.
+ *
+ * This structure describes the elements in the cache of recent names looked
+ * up by namei.  It's carefully sized to take up 128 bytes on _LP64, to make
+ * good use of space and the CPU caches.  Items used during RB tree lookup
+ * (nc_tree, nc_key) are clustered at the start of the structure.
  *
- * Locking rules:
+ * Field markings and their corresponding locks:
  *
- *      -       stable after initialization
- *      L       namecache_lock
- *      C       struct nchcpu::cpu_lock
- *      L/C     insert needs L, read needs L or any C,
- *              must hold L and all C after (or during) delete before free
- *      N       struct namecache::nc_lock
+ * -  stable throught the lifetime of the namecache entry
+ * d  protected by nc_dvp->vi_ncdlock
+ * v  protected by nc_dvp->vi_ncvlock
+ * l  protected by cache_lru_lock
+ * u  accesses are unlocked, no serialization applied
  */
+struct nchnode;
 struct namecache {
-	LIST_ENTRY(namecache) nc_hash;	/* L/C hash chain */
-	TAILQ_ENTRY(namecache) nc_lru;	/* L pseudo-lru chain */
-	LIST_ENTRY(namecache) nc_dvlist;/* L dvp's list of cache entries */
-	TAILQ_ENTRY(namecache) nc_vlist;/* L vp's list of cache entries */
-	struct	vnode *nc_dvp;		/* N vnode of parent of name */
-	struct	vnode *nc_vp;		/* N vnode the name refers to */
-	void	*nc_gcqueue;		/* N queue for garbage collection */
-	kmutex_t nc_lock;		/*   lock on this entry */
-	int	nc_hittime;		/* N last time scored a hit */
-	int	nc_flags;		/* - copy of componentname ISWHITEOUT */
-	u_short	nc_nlen;		/* - length of name */
-	char	nc_name[0];		/* - segment name */
+	struct	rb_node nc_tree;	/* d  red-black tree, must be first */
+	int64_t	nc_key;			/* -  hash key */
+	TAILQ_ENTRY(namecache) nc_list;	/* v  vp's list of cache entries */
+	TAILQ_ENTRY(namecache) nc_lru;	/* l  pseudo-lru chain */
+	struct	vnode *nc_dvp;		/* -  vnode of parent of name */
+	struct	vnode *nc_vp;		/* -  vnode the name refers to */
+	int	nc_lrulist;		/* l  which LRU list its on */
+	short	nc_nlen;		/* -  length of the name */
+	char	nc_whiteout;		/* -  true if a whiteout */
+	char	nc_name[41];		/* -  segment name */
 };
-__CTASSERT((sizeof(struct namecache) + NCHNAMLEN)
-    % __alignof(struct namecache) == 0);
 #endif
 
 #ifdef _KERNEL
@@ -294,14 +296,22 @@ bool	cache_lookup(struct vnode *, const 
 			int *, struct vnode **);
 bool	cache_lookup_raw(struct vnode *, const char *, size_t, uint32_t,
 			int *, struct vnode **);
-int	cache_revlookup(struct vnode *, struct vnode **, char **, char *);
+bool	cache_lookup_linked(struct vnode *, const char *, size_t,
+			    struct vnode **, krwlock_t **, kauth_cred_t);
+int	cache_revlookup(struct vnode *, struct vnode **, char **, char *,
+			bool, int);
+int	cache_diraccess(struct vnode *, int);
 void	cache_enter(struct vnode *, struct vnode *,
 			const char *, size_t, uint32_t);
+void	cache_enter_id(struct vnode *, mode_t, uid_t, gid_t);
+bool	cache_have_id(struct vnode *);
+void	cache_vnode_init(struct vnode * );
+void	cache_vnode_fini(struct vnode * );
+void	cache_cpu_init(struct cpu_info *);
+
 void	nchinit(void);
-void	nchreinit(void);
 void	namecache_count_pass2(void);
 void	namecache_count_2passes(void);
-void	cache_cpu_init(struct cpu_info *);
 void	cache_purgevfs(struct mount *);
 void	namecache_print(struct vnode *, void (*)(const char *, ...)
     __printflike(1, 2));
@@ -326,6 +336,8 @@ void	namecache_print(struct vnode *, voi
 	type	ncs_2passes;	/* number of times we attempt it (U) */	\
 	type	ncs_revhits;	/* reverse-cache hits */		\
 	type	ncs_revmiss;	/* reverse-cache misses */		\
+	type	ncs_collisions;	/* hash value collisions */		\
+	type	ncs_denied;	/* access denied */			\
 }
 
 /*

Reply via email to