summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-08-23 09:35:33 +0000
committerkn <kn@cvs.openbsd.org>2020-08-23 09:35:33 +0000
commit6f30adc27aeee1bf4f4bcaafab1f71a3f33f00ba (patch)
tree4c31ef55316bcd01cfafa96b77a428ac95687b90 /sys/kern
parenta6dfbb3a3c130690b6d6caae90eadeda30c64039 (diff)
Remove unused debug_syncprt, improve debug sysctl handling
"syncprt" is unused since kern/vfs_syscalls.c r1.147 from 2008. Adding new debug sysctls is a bit opaque and looking at kern/kern_sysctl.c the only visible difference between used and stub ctldebug structs in the debugvars[] array is their extern keyword, indicating that it is defined elsewhere. sys/sysctl.h declares all debugN members as extern upfront, but these declarations are not needed. Remove the unused debug sysctl, rename the only remaining one to something meaningful and remove forward declarations from /sys/sysctl.h; this way, adding new debug sysctls is a matter of adding extern and coming up with a name, which is nicer to read on its own and better to grep for. OK mpi
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c9
-rw-r--r--sys/kern/vfs_subr.c4
-rw-r--r--sys/kern/vfs_syscalls.c7
3 files changed, 8 insertions, 12 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index c948edc91af..c553d114fb5 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.377 2020/08/22 11:47:23 kn Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.378 2020/08/23 09:35:32 kn Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -813,13 +813,14 @@ hw_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
/*
* Debugging related system variables.
*/
-extern struct ctldebug debug0, debug1;
-struct ctldebug debug2, debug3, debug4;
+extern struct ctldebug debug_vfs_busyprt;
+struct ctldebug debug1, debug2, debug3, debug4;
struct ctldebug debug5, debug6, debug7, debug8, debug9;
struct ctldebug debug10, debug11, debug12, debug13, debug14;
struct ctldebug debug15, debug16, debug17, debug18, debug19;
static struct ctldebug *debugvars[CTL_DEBUG_MAXID] = {
- &debug0, &debug1, &debug2, &debug3, &debug4,
+ &debug_vfs_busyprt,
+ &debug1, &debug2, &debug3, &debug4,
&debug5, &debug6, &debug7, &debug8, &debug9,
&debug10, &debug11, &debug12, &debug13, &debug14,
&debug15, &debug16, &debug17, &debug18, &debug19,
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 6ea2cd63cc0..e9ee6659bef 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.302 2020/08/22 11:47:23 kn Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.303 2020/08/23 09:35:32 kn Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -866,7 +866,7 @@ vdrop(struct vnode *vp)
*/
#ifdef DEBUG_SYSCTL
int busyprt = 0; /* print out busy vnodes */
-struct ctldebug debug1 = { "busyprt", &busyprt };
+struct ctldebug debug_vfs_busyprt = { "vfs_busyprt", &busyprt };
#endif
int
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 4f22f24a152..20aaff11d81 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.346 2020/08/22 11:47:23 kn Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.347 2020/08/23 09:35:32 kn Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -523,11 +523,6 @@ dounmount_leaf(struct mount *mp, int flags, struct proc *p)
/*
* Sync each mounted filesystem.
*/
-#ifdef DEBUG_SYSCTL
-int syncprt = 0;
-struct ctldebug debug0 = { "syncprt", &syncprt };
-#endif
-
int
sys_sync(struct proc *p, void *v, register_t *retval)
{