svn commit: r217555 - head/sys/kern
Matthew D Fleming
mdf at FreeBSD.org
Tue Jan 18 21:14:19 UTC 2011
Author: mdf
Date: Tue Jan 18 21:14:18 2011
New Revision: 217555
URL: http://svn.freebsd.org/changeset/base/217555
Log:
Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.
Modified:
head/sys/kern/kern_linker.c
head/sys/kern/kern_sysctl.c
head/sys/kern/subr_bus.c
head/sys/kern/sysv_msg.c
head/sys/kern/sysv_sem.c
head/sys/kern/sysv_shm.c
head/sys/kern/uipc_usrreq.c
head/sys/kern/vfs_subr.c
Modified: head/sys/kern/kern_linker.c
==============================================================================
--- head/sys/kern/kern_linker.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/kern_linker.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -2145,5 +2145,5 @@ sysctl_kern_function_list(SYSCTL_HANDLER
return (SYSCTL_OUT(req, "", 1));
}
-SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLFLAG_RD,
+SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLTYPE_OPAQUE | CTLFLAG_RD,
NULL, 0, sysctl_kern_function_list, "", "kernel function list");
Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/kern_sysctl.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -876,7 +876,8 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR
return (error);
}
-SYSCTL_PROC(_sysctl, 3, name2oid, CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE,
+SYSCTL_PROC(_sysctl, 3, name2oid,
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE,
0, 0, sysctl_sysctl_name2oid, "I", "");
static int
Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/subr_bus.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -226,7 +226,7 @@ devclass_sysctl_init(devclass_t dc)
SYSCTL_STATIC_CHILDREN(_dev), OID_AUTO, dc->name,
CTLFLAG_RD, NULL, "");
SYSCTL_ADD_PROC(&dc->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree),
- OID_AUTO, "%parent", CTLFLAG_RD,
+ OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD,
dc, DEVCLASS_SYSCTL_PARENT, devclass_sysctl_handler, "A",
"parent class");
}
@@ -289,23 +289,23 @@ device_sysctl_init(device_t dev)
dev->nameunit + strlen(dc->name),
CTLFLAG_RD, NULL, "");
SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
- OID_AUTO, "%desc", CTLFLAG_RD,
+ OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A",
"device description");
SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
- OID_AUTO, "%driver", CTLFLAG_RD,
+ OID_AUTO, "%driver", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_DRIVER, device_sysctl_handler, "A",
"device driver name");
SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
- OID_AUTO, "%location", CTLFLAG_RD,
+ OID_AUTO, "%location", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_LOCATION, device_sysctl_handler, "A",
"device location relative to parent");
SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
- OID_AUTO, "%pnpinfo", CTLFLAG_RD,
+ OID_AUTO, "%pnpinfo", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_PNPINFO, device_sysctl_handler, "A",
"device identification");
SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
- OID_AUTO, "%parent", CTLFLAG_RD,
+ OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD,
dev, DEVICE_SYSCTL_PARENT, device_sysctl_handler, "A",
"parent device");
}
Modified: head/sys/kern/sysv_msg.c
==============================================================================
--- head/sys/kern/sysv_msg.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/sysv_msg.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -1284,7 +1284,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz,
"Size of a message segment");
SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0,
"Number of message segments");
-SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
+SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD,
NULL, 0, sysctl_msqids, "", "Message queue IDs");
#ifdef COMPAT_FREEBSD32
Modified: head/sys/kern/sysv_sem.c
==============================================================================
--- head/sys/kern/sysv_sem.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/sysv_sem.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -211,7 +211,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx,
"Semaphore maximum value");
SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RW, &seminfo.semaem, 0,
"Adjust on exit max value");
-SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLFLAG_RD,
+SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD,
NULL, 0, sysctl_sema, "", "Semaphore id pool");
static struct syscall_helper_data sem_syscalls[] = {
Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/sysv_shm.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -177,7 +177,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, shm_use_
SYSCTL_INT(_kern_ipc, OID_AUTO, shm_allow_removed, CTLFLAG_RW,
&shm_allow_removed, 0,
"Enable/Disable attachment to attached segments marked for removal");
-SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLFLAG_RD,
+SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLTYPE_OPAQUE | CTLFLAG_RD,
NULL, 0, sysctl_shmsegs, "",
"Current number of shared memory segments allocated");
Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/uipc_usrreq.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -1601,15 +1601,16 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
return (error);
}
-SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, CTLFLAG_RD,
- (caddr_t)(long)SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb",
- "List of active local datagram sockets");
-SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLFLAG_RD,
- (caddr_t)(long)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb",
- "List of active local stream sockets");
-SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist, CTLFLAG_RD,
- (caddr_t)(long)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb",
- "List of active local seqpacket sockets");
+SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD,
+ (void *)(intptr_t)SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb",
+ "List of active local datagram sockets");
+SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD,
+ (void *)(intptr_t)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb",
+ "List of active local stream sockets");
+SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist,
+ CTLTYPE_OPAQUE | CTLFLAG_RD,
+ (void *)(intptr_t)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb",
+ "List of active local seqpacket sockets");
static void
unp_shutdown(struct unpcb *unp)
Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c Tue Jan 18 21:14:13 2011 (r217554)
+++ head/sys/kern/vfs_subr.c Tue Jan 18 21:14:18 2011 (r217555)
@@ -2998,7 +2998,8 @@ sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS)
return (error);
}
-SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLFLAG_RD, NULL, 0, sysctl_vfs_conflist,
+SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLTYPE_OPAQUE | CTLFLAG_RD,
+ NULL, 0, sysctl_vfs_conflist,
"S,xvfsconf", "List of all configured filesystems");
#ifndef BURN_BRIDGES
@@ -4160,7 +4161,8 @@ sysctl_vfs_ctl(SYSCTL_HANDLER_ARGS)
return (error);
}
-SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLFLAG_WR, NULL, 0, sysctl_vfs_ctl, "",
+SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE | CTLFLAG_WR,
+ NULL, 0, sysctl_vfs_ctl, "",
"Sysctl by fsid");
/*
More information about the svn-src-head
mailing list