Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Be more clear and don't rely on cur being the first...



details:   https://anonhg.NetBSD.org/src/rev/89d35b35d520
branches:  trunk
changeset: 979064:89d35b35d520
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 12 18:41:13 2020 +0000

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

diffstat:

 sys/kern/vfs_cache.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 5b0eadf63aac -r 89d35b35d520 sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c      Sat Dec 12 18:35:59 2020 +0000
+++ b/sys/kern/vfs_cache.c      Sat Dec 12 18:41:13 2020 +0000
@@ -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 @@
 #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);
 



Home | Main Index | Thread Index | Old Index