Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern initialize sysctl node from init() instead of via l...
details: https://anonhg.NetBSD.org/src/rev/ce280b3cd53e
branches: trunk
changeset: 335371:ce280b3cd53e
user: pooka <pooka%NetBSD.org@localhost>
date: Sun Jan 04 19:31:00 2015 +0000
description:
initialize sysctl node from init() instead of via linkset
diffstat:
sys/kern/vfs_cache.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (52 lines):
diff -r 819666f5b375 -r ce280b3cd53e sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c Sun Jan 04 19:30:26 2015 +0000
+++ b/sys/kern/vfs_cache.c Sun Jan 04 19:31:00 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_cache.c,v 1.103 2014/12/24 20:01:21 dennis Exp $ */
+/* $NetBSD: vfs_cache.c,v 1.104 2015/01/04 19:31:00 pooka Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.103 2014/12/24 20:01:21 dennis Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.104 2015/01/04 19:31:00 pooka Exp $");
#include "opt_ddb.h"
#include "opt_revcache.h"
@@ -258,6 +258,9 @@
static int cache_ctor(void *, void *, int);
static void cache_dtor(void *, void *);
+static struct sysctllog *sysctllog;
+static void sysctl_cache_stat_setup(void);
+
/*
* Compute the hash for an entry.
*
@@ -885,6 +888,8 @@
"namecache", "under scan target");
evcnt_attach_dynamic(&cache_ev_forced, EVCNT_TYPE_MISC, NULL,
"namecache", "forced reclaims");
+
+ sysctl_cache_stat_setup();
}
static int
@@ -1250,9 +1255,12 @@
return sysctl_copyout(l, &stats, oldp, sizeof(stats));
}
-SYSCTL_SETUP(sysctl_cache_stat_setup, "vfs.namecache_stats subtree setup")
+static void
+sysctl_cache_stat_setup(void)
{
- sysctl_createv(clog, 0, NULL, NULL,
+
+ KASSERT(sysctllog == NULL);
+ sysctl_createv(&sysctllog, 0, NULL, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRUCT, "namecache_stats",
SYSCTL_DESCR("namecache statistics"),
Home |
Main Index |
Thread Index |
Old Index