PERFORCE change 47747 for review
John Baldwin
jhb at FreeBSD.org
Fri Feb 27 10:05:14 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=47747
Change 47747 by jhb at jhb_slimer on 2004/02/27 10:04:19
IFC @47744.
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_sysctl.c#36 integrate
.. //depot/projects/smpng/sys/sys/sysctl.h#26 integrate
Differences ...
==== //depot/projects/smpng/sys/kern/kern_sysctl.c#36 (text+ko) ====
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.150 2004/02/26 00:27:02 truckman Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.151 2004/02/27 17:13:23 des Exp $");
#include "opt_compat.h"
#include "opt_mac.h"
@@ -416,6 +416,26 @@
}
/*
+ * Reparent an existing oid.
+ */
+int
+sysctl_move_oid(struct sysctl_oid *oid, struct sysctl_oid_list *parent)
+{
+ struct sysctl_oid *oidp;
+
+ if (oid->oid_parent == parent)
+ return (0);
+ oidp = sysctl_find_oidname(oid->oid_name, parent);
+ if (oidp != NULL)
+ return (EEXIST);
+ sysctl_unregister_oid(oid);
+ oid->oid_parent = parent;
+ oid->oid_number = OID_AUTO;
+ sysctl_register_oid(oid);
+ return (0);
+}
+
+/*
* Register the kernel's oids on startup.
*/
SET_DECLARE(sysctl_set, struct sysctl_oid);
==== //depot/projects/smpng/sys/sys/sysctl.h#26 (text+ko) ====
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/sys/sys/sysctl.h,v 1.125 2004/02/26 16:18:22 des Exp $
+ * $FreeBSD: src/sys/sys/sysctl.h,v 1.126 2004/02/27 17:13:23 des Exp $
*/
#ifndef _SYS_SYSCTL_H_
@@ -603,6 +603,8 @@
int kind, void *arg1, int arg2,
int (*handler) (SYSCTL_HANDLER_ARGS),
const char *fmt, const char *descr);
+int sysctl_move_oid(struct sysctl_oid *oidp,
+ struct sysctl_oid_list *parent);
int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
int sysctl_ctx_init(struct sysctl_ctx_list *clist);
int sysctl_ctx_free(struct sysctl_ctx_list *clist);
More information about the p4-projects
mailing list