diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-10-21 07:31:21 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-10-21 07:31:21 +0000 |
commit | f0188618f2abe08246731cf09b0b0a99609fd34c (patch) | |
tree | ee67959a46304c59df434799575e3820a2cc841f /sys/fs | |
parent | 7eb884645c96add0d48c306ae9ecb053af2623f7 (diff) |
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
Notes
Notes:
svn path=/head/; revision=273377
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 4 | ||||
-rw-r--r-- | sys/fs/fuse/fuse_main.c | 4 | ||||
-rw-r--r-- | sys/fs/fuse/fuse_vfsops.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index da21f97db390..a408725a604e 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -109,10 +109,10 @@ SYSCTL_PROC(_kern, OID_AUTO, devname, NULL, 0, sysctl_devname, "", "devname(3) handler"); SYSCTL_INT(_debug_sizeof, OID_AUTO, cdev, CTLFLAG_RD, - 0, sizeof(struct cdev), "sizeof(struct cdev)"); + SYSCTL_NULL_INT_PTR, sizeof(struct cdev), "sizeof(struct cdev)"); SYSCTL_INT(_debug_sizeof, OID_AUTO, cdev_priv, CTLFLAG_RD, - 0, sizeof(struct cdev_priv), "sizeof(struct cdev_priv)"); + SYSCTL_NULL_INT_PTR, sizeof(struct cdev_priv), "sizeof(struct cdev_priv)"); struct cdev * devfs_alloc(int flags) diff --git a/sys/fs/fuse/fuse_main.c b/sys/fs/fuse/fuse_main.c index bf73a45fb5b3..d09e1c394515 100644 --- a/sys/fs/fuse/fuse_main.c +++ b/sys/fs/fuse/fuse_main.c @@ -93,9 +93,9 @@ static struct vfsconf fuse_vfsconf = { }; SYSCTL_INT(_vfs_fuse, OID_AUTO, kernelabi_major, CTLFLAG_RD, - 0, FUSE_KERNEL_VERSION, "FUSE kernel abi major version"); + SYSCTL_NULL_INT_PTR, FUSE_KERNEL_VERSION, "FUSE kernel abi major version"); SYSCTL_INT(_vfs_fuse, OID_AUTO, kernelabi_minor, CTLFLAG_RD, - 0, FUSE_KERNEL_MINOR_VERSION, "FUSE kernel abi minor version"); + SYSCTL_NULL_INT_PTR, FUSE_KERNEL_MINOR_VERSION, "FUSE kernel abi minor version"); /****************************** * diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 73887456b56b..c00a96cb10f6 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -114,10 +114,10 @@ struct vfsops fuse_vfsops = { }; SYSCTL_INT(_vfs_fuse, OID_AUTO, init_backgrounded, CTLFLAG_RD, - 0, 1, "indicate async handshake"); + SYSCTL_NULL_INT_PTR, 1, "indicate async handshake"); static int fuse_enforce_dev_perms = 0; -SYSCTL_LONG(_vfs_fuse, OID_AUTO, enforce_dev_perms, CTLFLAG_RW, +SYSCTL_INT(_vfs_fuse, OID_AUTO, enforce_dev_perms, CTLFLAG_RW, &fuse_enforce_dev_perms, 0, "enforce fuse device permissions for secondary mounts"); static unsigned sync_unmount = 1; |