Date: Sat, 13 Aug 2005 02:14:16 GMT From: soc-cjones <soc-cjones@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 81921 for review Message-ID: <200508130214.j7D2EGNM001915@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508130214.j7D2EGNM001915>