From owner-p4-projects@FreeBSD.ORG Sat Aug 13 02:14:17 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 044F716A421; Sat, 13 Aug 2005 02:14:17 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 7B8BB16A41F for ; Sat, 13 Aug 2005 02:14:16 +0000 (GMT) (envelope-from soc-cjones@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 424E443D49 for ; Sat, 13 Aug 2005 02:14:16 +0000 (GMT) (envelope-from soc-cjones@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j7D2EGVn001918 for ; Sat, 13 Aug 2005 02:14:16 GMT (envelope-from soc-cjones@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7D2EGNM001915 for perforce@freebsd.org; Sat, 13 Aug 2005 02:14:16 GMT (envelope-from soc-cjones@freebsd.org) Date: Sat, 13 Aug 2005 02:14:16 GMT Message-Id: <200508130214.j7D2EGNM001915@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-cjones@freebsd.org using -f From: soc-cjones To: Perforce Change Reviews Cc: Subject: PERFORCE change 81921 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2005 02:14:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=81921 Change 81921 by soc-cjones@soc-cjones_ishtar on 2005/08/13 02:13:42 Add debugging calls for object creation, to try to figure out what's breaking the saves. Affected files ... .. //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum.c#3 edit Differences ... ==== //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum.c#3 (text+ko) ==== @@ -57,7 +57,7 @@ struct g_geom *gp; struct gv_softc *sc; int error; - + g_topology_assert(); KASSERT(cp != NULL, ("gv_orphan: null cp")); @@ -156,7 +156,6 @@ gp = LIST_FIRST(&mp->geom); sc = gp->softc; } - /* We need a temporary consumer to read the config from. */ cp = g_new_consumer(gp); @@ -274,6 +273,8 @@ g_topology_assert(); + printf("gv_create: started\n"); + sc = gp->softc; /* Find out how many of each object have been passed in. */ @@ -282,6 +283,8 @@ subdisks = gctl_get_paraml(req, "subdisks", sizeof(*subdisks)); drives = gctl_get_paraml(req, "drives", sizeof(*drives)); + printf("gv_create: %d volumes, %d plexes, %d subdisks, %d drives\n", *volumes, *plexes, *subdisks, *volumes); + /* First, handle drive definitions ... */ for (i = 0; i < *drives; i++) { snprintf(buf, sizeof(buf), "drive%d", i); @@ -383,9 +386,13 @@ s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO); bcopy(s2, s, sizeof(*s)); + printf("gv_create: at bcopy subdisk '%s', size %d\n", s->name, (int) s->size); + /* Find the drive where this subdisk should be put on. */ d = gv_find_drive(sc, s->drive); + printf("gv_create: after gv_find_drive subdisk '%s', size %ld, drive '%s' avail %lld\n", s->name, (long) s->size, d->name, (long long) d->avail); + /* drive not found - XXX */ if (d == NULL) { printf("FOO: drive '%s' not found\n", s->drive); @@ -396,6 +403,8 @@ /* Find the plex where this subdisk belongs to. */ p = gv_find_plex(sc, s->plex); + printf("gv_create: after gv_find_plex subdisk '%s', size %ld, drive '%s' avail %lld\n", s->name, (long) s->size, d->name, (long long) d->avail); + /* plex not found - XXX */ if (p == NULL) { printf("FOO: plex '%s' not found\n", s->plex); @@ -414,6 +423,8 @@ continue; } + printf("gv_create: after gv_sd_to_drive subdisk '%s', size %ld, drive '%s', avail %lld\n", s->name, (long) s->size, d->name, (long long) d->avail); + /* * Then, we give the subdisk to the plex; we check if the * given values are correct and maybe adjust them. @@ -425,12 +436,16 @@ } s->flags |= GV_SD_NEWBORN; + printf("gv_create: after gv_sd_to_plex subdisk '%s', size %lld, drive '%s', avail %lld\n", s->name, (long long) s->size, d->name, (long long) d->avail); + s->vinumconf = sc; LIST_INSERT_HEAD(&sc->subdisks, s, sd); } - LIST_FOREACH(s, &sc->subdisks, sd) + LIST_FOREACH(s, &sc->subdisks, sd) { gv_update_sd_state(s); + printf("gv_create: LIST_FOREACH subdisk '%s', size %ld, drive '%s', avail %lld\n", s->name, (long) s->size, d->name, (long long) d->avail); + } LIST_FOREACH(p, &sc->plexes, plex) gv_update_plex_config(p); LIST_FOREACH(v, &sc->volumes, volume) @@ -442,6 +457,7 @@ * geom. */ LIST_FOREACH(d, &sc->drives, drive) { + printf("LIST_FOREACH: drive '%s'\n", d->name); if (d->geom == NULL) { /* * XXX if the provider disapears before we get a chance @@ -455,7 +471,9 @@ continue; } cp = g_new_consumer(gp); + printf("gv_create: calling g_attach\n"); g_attach(cp, pp); + printf("gv_create: calling gv_save_config\n"); gv_save_config(cp, d, sc); g_detach(cp); g_destroy_consumer(cp);