geom_subr.c (93326) | geom_subr.c (93774) |
---|---|
1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * | 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * |
35 * $FreeBSD: head/sys/geom/geom_subr.c 93326 2002-03-28 10:09:24Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_subr.c 93774 2002-04-04 09:41:47Z phk $ |
36 */ 37 38 39#include <sys/param.h> 40#ifndef _KERNEL 41#include <stdio.h> 42#include <unistd.h> 43#include <stdlib.h> --- 12 unchanged lines hidden (view full) --- 56#include <sys/mutex.h> 57#endif 58#include <sys/errno.h> 59#include <sys/sbuf.h> 60#include <geom/geom.h> 61#include <geom/geom_int.h> 62#include <machine/stdarg.h> 63 | 36 */ 37 38 39#include <sys/param.h> 40#ifndef _KERNEL 41#include <stdio.h> 42#include <unistd.h> 43#include <stdlib.h> --- 12 unchanged lines hidden (view full) --- 56#include <sys/mutex.h> 57#endif 58#include <sys/errno.h> 59#include <sys/sbuf.h> 60#include <geom/geom.h> 61#include <geom/geom_int.h> 62#include <machine/stdarg.h> 63 |
64struct class_list_head g_classs = LIST_HEAD_INITIALIZER(g_classs); | 64struct class_list_head g_classes = LIST_HEAD_INITIALIZER(g_classes); |
65static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); 66static int g_nproviders; 67char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; 68 69static int g_ignition; 70 71void 72g_add_class(struct g_class *mp) 73{ 74 75 if (!g_ignition) { 76 g_ignition++; 77 g_init(); 78 } 79 g_topology_lock(); 80 g_trace(G_T_TOPOLOGY, "g_add_class(%s)", mp->name); 81 LIST_INIT(&mp->geom); | 65static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); 66static int g_nproviders; 67char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; 68 69static int g_ignition; 70 71void 72g_add_class(struct g_class *mp) 73{ 74 75 if (!g_ignition) { 76 g_ignition++; 77 g_init(); 78 } 79 g_topology_lock(); 80 g_trace(G_T_TOPOLOGY, "g_add_class(%s)", mp->name); 81 LIST_INIT(&mp->geom); |
82 LIST_INSERT_HEAD(&g_classs, mp, class); | 82 LIST_INSERT_HEAD(&g_classes, mp, class); |
83 if (g_nproviders > 0) 84 g_post_event(EV_NEW_CLASS, mp, NULL, NULL, NULL); 85 g_topology_unlock(); 86} 87 88struct g_geom * 89g_new_geomf(struct g_class *mp, char *fmt, ...) 90{ --- 462 unchanged lines hidden (view full) --- 553 554static struct g_class * 555g_class_by_name(char *name) 556{ 557 struct g_class *mp; 558 559 g_trace(G_T_TOPOLOGY, "g_class_by_name(%s)", name); 560 g_topology_assert(); | 83 if (g_nproviders > 0) 84 g_post_event(EV_NEW_CLASS, mp, NULL, NULL, NULL); 85 g_topology_unlock(); 86} 87 88struct g_geom * 89g_new_geomf(struct g_class *mp, char *fmt, ...) 90{ --- 462 unchanged lines hidden (view full) --- 553 554static struct g_class * 555g_class_by_name(char *name) 556{ 557 struct g_class *mp; 558 559 g_trace(G_T_TOPOLOGY, "g_class_by_name(%s)", name); 560 g_topology_assert(); |
561 LIST_FOREACH(mp, &g_classs, class) | 561 LIST_FOREACH(mp, &g_classes, class) |
562 if (!strcmp(mp->name, name)) 563 return (mp); 564 return (NULL); 565} 566 567struct g_geom * 568g_create_geomf(char *class, struct g_provider *pp, char *fmt, ...) 569{ --- 72 unchanged lines hidden --- | 562 if (!strcmp(mp->name, name)) 563 return (mp); 564 return (NULL); 565} 566 567struct g_geom * 568g_create_geomf(char *class, struct g_provider *pp, char *fmt, ...) 569{ --- 72 unchanged lines hidden --- |