Module Name:    src
Committed By:   christos
Date:           Sat Dec 12 18:41:13 UTC 2020

Modified Files:
        src/sys/kern: vfs_cache.c

Log Message:
Be more clear and don't rely on cur being the first member.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/kern/vfs_cache.c

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

Modified files:

Index: src/sys/kern/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.148 src/sys/kern/vfs_cache.c:1.149
--- src/sys/kern/vfs_cache.c:1.148	Sat Dec 12 13:35:59 2020
+++ src/sys/kern/vfs_cache.c	Sat Dec 12 13:41:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.148 2020/12/12 18:35:59 uwe Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.149 2020/12/12 18:41:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -172,7 +172,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.148 2020/12/12 18:35:59 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.149 2020/12/12 18:41:13 christos Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -244,7 +244,8 @@ static kmutex_t cache_stat_lock __cachel
 #define	COUNT(f) do { \
 	lwp_t *l = curlwp; \
 	KPREEMPT_DISABLE(l); \
-	((struct nchstats_percpu *)curcpu()->ci_data.cpu_nch)->f++; \
+	struct nchcpu *nchcpu = curcpu()->ci_data.cpu_nch; \
+	nchcpu->cur.f++; \
 	KPREEMPT_ENABLE(l); \
 } while (/* CONSTCOND */ 0);
 

Reply via email to