From owner-p4-projects@FreeBSD.ORG Fri Feb 27 10:05:14 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB4A316A4F4; Fri, 27 Feb 2004 10:05:13 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1E2A16A4CE for ; Fri, 27 Feb 2004 10:05:13 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBB7843D1D for ; Fri, 27 Feb 2004 10:05:13 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1RI5DGe019591 for ; Fri, 27 Feb 2004 10:05:13 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1RI5DEY019588 for perforce@freebsd.org; Fri, 27 Feb 2004 10:05:13 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 27 Feb 2004 10:05:13 -0800 (PST) Message-Id: <200402271805.i1RI5DEY019588@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 47747 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 18:05:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=47747 Change 47747 by jhb@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 -__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);