diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-10-21 07:31:21 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-10-21 07:31:21 +0000 |
commit | 49c137f7be5791eee8102395257cdf48b40c81f7 (patch) | |
tree | ee67959a46304c59df434799575e3820a2cc841f /sys/geom | |
parent | fef9d98869a5c15698b0511d8ff1044b517f1e8f (diff) | |
download | FreeBSD-src-49c137f7be5791eee8102395257cdf48b40c81f7.zip FreeBSD-src-49c137f7be5791eee8102395257cdf48b40c81f7.tar.gz |
Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.
- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.
- Logical OR where binary OR was expected.
- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.
- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.
- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.
- Updated "EXAMPLES" section in SYSCTL manual page.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_kern.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 3559daf..e6021d3 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -223,12 +223,12 @@ SYSCTL_INT(_kern_geom, OID_AUTO, collectstats, CTLFLAG_RW, "Control statistics collection on GEOM providers and consumers"); SYSCTL_INT(_debug_sizeof, OID_AUTO, g_class, CTLFLAG_RD, - 0, sizeof(struct g_class), "sizeof(struct g_class)"); + SYSCTL_NULL_INT_PTR, sizeof(struct g_class), "sizeof(struct g_class)"); SYSCTL_INT(_debug_sizeof, OID_AUTO, g_geom, CTLFLAG_RD, - 0, sizeof(struct g_geom), "sizeof(struct g_geom)"); + SYSCTL_NULL_INT_PTR, sizeof(struct g_geom), "sizeof(struct g_geom)"); SYSCTL_INT(_debug_sizeof, OID_AUTO, g_provider, CTLFLAG_RD, - 0, sizeof(struct g_provider), "sizeof(struct g_provider)"); + SYSCTL_NULL_INT_PTR, sizeof(struct g_provider), "sizeof(struct g_provider)"); SYSCTL_INT(_debug_sizeof, OID_AUTO, g_consumer, CTLFLAG_RD, - 0, sizeof(struct g_consumer), "sizeof(struct g_consumer)"); + SYSCTL_NULL_INT_PTR, sizeof(struct g_consumer), "sizeof(struct g_consumer)"); SYSCTL_INT(_debug_sizeof, OID_AUTO, g_bioq, CTLFLAG_RD, - 0, sizeof(struct g_bioq), "sizeof(struct g_bioq)"); + SYSCTL_NULL_INT_PTR, sizeof(struct g_bioq), "sizeof(struct g_bioq)"); |