git: 99eefc727eba - main - sysctl.h: Less namespace pollution
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Oct 2021 17:24:18 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=99eefc727eba667892bb9216410f3588345fe25f
commit 99eefc727eba667892bb9216410f3588345fe25f
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-10-11 17:15:08 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-10-11 17:20:07 +0000
sysctl.h: Less namespace pollution
Remove unused struct ctlname. It is unused. Move struct thread to
inside #if _KERNEL.
Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D32457
---
sys/sys/sysctl.h | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 8178c7208f9b..71a34652ff44 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -42,7 +42,6 @@
#include <sys/queue.h>
#endif
-struct thread;
/*
* Definitions for sysctl call. The sysctl call uses a hierarchical name
* for objects that can be examined or modified. The name is expressed as
@@ -50,22 +49,16 @@ struct thread;
* component depends on its place in the hierarchy. The top-level and kern
* identifiers are defined here, and other identifiers are defined in the
* respective subsystem header files.
+ *
+ * Each subsystem defined by sysctl defines a list of variables for that
+ * subsystem. Each name is either a node with further levels defined below it,
+ * or it is a leaf of some particular type given below. Each sysctl level
+ * defines a set of name/type pairs to be used by sysctl(8) in manipulating the
+ * subsystem.
*/
#define CTL_MAXNAME 24 /* largest number of components supported */
-/*
- * Each subsystem defined by sysctl defines a list of variables
- * for that subsystem. Each name is either a node with further
- * levels defined below it, or it is a leaf of some particular
- * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(8) in manipulating the subsystem.
- */
-struct ctlname {
- char *ctl_name; /* subsystem name */
- int ctl_type; /* type of name */
-};
-
#define CTLTYPE 0xf /* mask for the type */
#define CTLTYPE_NODE 1 /* name is a node */
#define CTLTYPE_INT 2 /* name describes an integer */
@@ -164,6 +157,7 @@ struct ctlname {
* This describes the access space for a sysctl request. This is needed
* so that we can use the interface from the kernel or from user-space.
*/
+struct thread;
struct sysctl_req {
struct thread *td; /* used for access checking */
int lock; /* wiring state */