Lines Matching full:gp
125 g_multipath_good(struct g_geom *gp) in g_multipath_good() argument
130 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_good()
142 struct g_geom *gp; in g_multipath_fault() local
144 gp = cp->geom; in g_multipath_fault()
145 sc = gp->softc; in g_multipath_fault()
147 if (g_multipath_good(gp) == 0 && sc->sc_ndisks > 0) { in g_multipath_fault()
148 LIST_FOREACH(lcp, &gp->consumer, consumer) { in g_multipath_fault()
165 LIST_FOREACH(lcp, &gp->consumer, consumer) { in g_multipath_fault()
181 g_multipath_choose(struct g_geom *gp, struct bio *bp) in g_multipath_choose() argument
186 sc = gp->softc; in g_multipath_choose()
191 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_choose()
207 struct g_geom *gp; in g_mpd() local
214 gp = cp->geom; in g_mpd()
225 sc = gp->softc; in g_mpd()
229 cp->provider->name, gp->name); in g_mpd()
231 gp->name, cp->provider->name); in g_mpd()
236 if (LIST_EMPTY(&gp->consumer)) in g_mpd()
237 g_multipath_destroy(gp); in g_mpd()
268 struct g_geom *gp; in g_multipath_resize() local
277 gp = cp->geom; in g_multipath_resize()
279 sc = gp->softc; in g_multipath_resize()
290 LIST_FOREACH(cp1, &gp->consumer, consumer) { in g_multipath_resize()
314 g_multipath_destroy(gp); in g_multipath_resize()
341 struct g_geom *gp; in g_multipath_start() local
346 gp = bp->bio_to->geom; in g_multipath_start()
347 sc = gp->softc; in g_multipath_start()
355 cp = g_multipath_choose(gp, bp); in g_multipath_start()
409 struct g_geom *gp; in g_multipath_done_error() local
424 gp = pbp->bio_to->geom; in g_multipath_done_error()
425 sc = gp->softc; in g_multipath_done_error()
489 struct g_geom *gp; in g_multipath_access() local
494 gp = pp->geom; in g_multipath_access()
499 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_access()
513 sc = gp->softc; in g_multipath_access()
516 g_multipath_destroy(gp); in g_multipath_access()
521 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_access()
536 struct g_geom *gp; in g_multipath_create() local
541 LIST_FOREACH(gp, &mp->geom, geom) { in g_multipath_create()
542 sc = gp->softc; in g_multipath_create()
545 if (strcmp(gp->name, md->md_name) == 0) { in g_multipath_create()
552 gp = g_new_geomf(mp, "%s", md->md_name); in g_multipath_create()
559 gp->softc = sc; in g_multipath_create()
560 gp->start = g_multipath_start; in g_multipath_create()
561 gp->orphan = g_multipath_orphan; in g_multipath_create()
562 gp->resize = g_multipath_resize; in g_multipath_create()
563 gp->access = g_multipath_access; in g_multipath_create()
564 gp->dumpconf = g_multipath_dumpconf; in g_multipath_create()
566 pp = g_new_providerf(gp, "multipath/%s", md->md_name); in g_multipath_create()
575 printf("GEOM_MULTIPATH: %s created\n", gp->name); in g_multipath_create()
576 return (gp); in g_multipath_create()
580 g_multipath_add_disk(struct g_geom *gp, struct g_provider *pp) in g_multipath_add_disk() argument
588 sc = gp->softc; in g_multipath_add_disk()
594 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_add_disk()
600 pp->name, gp->name); in g_multipath_add_disk()
603 cp = g_new_consumer(gp); in g_multipath_add_disk()
665 g_multipath_destroy(struct g_geom *gp) in g_multipath_destroy() argument
671 if (gp->softc == NULL) in g_multipath_destroy()
673 sc = gp->softc; in g_multipath_destroy()
675 printf("GEOM_MULTIPATH: destroying %s\n", gp->name); in g_multipath_destroy()
683 LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { in g_multipath_destroy()
694 if (!LIST_EMPTY(&gp->consumer)) in g_multipath_destroy()
697 g_free(gp->softc); in g_multipath_destroy()
698 gp->softc = NULL; in g_multipath_destroy()
699 printf("GEOM_MULTIPATH: %s destroyed\n", gp->name); in g_multipath_destroy()
700 g_wither_geom(gp, ENXIO); in g_multipath_destroy()
706 struct g_geom *gp) in g_multipath_destroy_geom() argument
709 return (g_multipath_destroy(gp)); in g_multipath_destroy_geom()
713 g_multipath_rotate(struct g_geom *gp) in g_multipath_rotate() argument
716 struct g_multipath_softc *sc = gp->softc; in g_multipath_rotate()
722 LIST_FOREACH(lcp, &gp->consumer, consumer) { in g_multipath_rotate()
819 struct g_geom *gp, *gp1; in g_multipath_taste() local
824 gp = g_new_geomf(mp, "multipath:taste"); in g_multipath_taste()
825 gp->start = g_multipath_start; in g_multipath_taste()
826 gp->access = g_multipath_access; in g_multipath_taste()
827 gp->orphan = g_multipath_orphan; in g_multipath_taste()
828 cp = g_new_consumer(gp); in g_multipath_taste()
836 g_destroy_geom(gp); in g_multipath_taste()
839 gp = NULL; in g_multipath_taste()
872 LIST_FOREACH(gp, &mp->geom, geom) { in g_multipath_taste()
873 sc = gp->softc; in g_multipath_taste()
881 if (gp1 == gp) in g_multipath_taste()
891 * If gp is NULL, we had no extant MULTIPATH geom with this uuid. in g_multipath_taste()
896 * If gp is NULL, then modify the name with a random number and in g_multipath_taste()
899 * If gp is *not* NULL, just use the geom's name as we're attaching in g_multipath_taste()
905 if (gp == NULL) { in g_multipath_taste()
920 if (gp == NULL) { in g_multipath_taste()
921 gp = g_multipath_create(mp, &md); in g_multipath_taste()
922 if (gp == NULL) { in g_multipath_taste()
932 sc = gp->softc; in g_multipath_taste()
934 error = g_multipath_add_disk(gp, pp); in g_multipath_taste()
937 g_multipath_destroy(gp); in g_multipath_taste()
940 return (gp); in g_multipath_taste()
948 struct g_geom *gp; in g_multipath_ctl_add_name() local
962 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_add_name()
963 if (gp == NULL) { in g_multipath_ctl_add_name()
967 sc = gp->softc; in g_multipath_ctl_add_name()
980 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_ctl_add_name()
1003 error = g_multipath_add_disk(gp, pp); in g_multipath_ctl_add_name()
1011 struct g_geom *gp; in g_multipath_ctl_prefer() local
1025 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_prefer()
1026 if (gp == NULL) { in g_multipath_ctl_prefer()
1030 sc = gp->softc; in g_multipath_ctl_prefer()
1051 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_ctl_prefer()
1083 struct g_geom *gp; in g_multipath_ctl_add() local
1091 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_add()
1092 if (gp == NULL) { in g_multipath_ctl_add()
1110 struct g_geom *gp; in g_multipath_ctl_create() local
1128 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_create()
1129 if (gp != NULL) { in g_multipath_ctl_create()
1148 gp = g_multipath_create(mp, &md); in g_multipath_ctl_create()
1149 if (gp == NULL) { in g_multipath_ctl_create()
1154 sc = gp->softc; in g_multipath_ctl_create()
1163 g_multipath_destroy(gp); in g_multipath_ctl_create()
1170 struct g_geom *gp; in g_multipath_ctl_configure() local
1184 gp = g_multipath_find_geom(mp, name); in g_multipath_ctl_configure()
1185 if (gp == NULL) { in g_multipath_ctl_configure()
1189 sc = gp->softc; in g_multipath_ctl_configure()
1220 struct g_geom *gp; in g_multipath_ctl_fail() local
1230 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_fail()
1231 if (gp == NULL) { in g_multipath_ctl_fail()
1235 sc = gp->softc; in g_multipath_ctl_fail()
1245 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_ctl_fail()
1274 struct g_geom *gp; in g_multipath_ctl_remove() local
1285 gp = g_multipath_find_geom(mp, mpname); in g_multipath_ctl_remove()
1286 if (gp == NULL) { in g_multipath_ctl_remove()
1290 sc = gp->softc; in g_multipath_ctl_remove()
1300 LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { in g_multipath_ctl_remove()
1330 struct g_geom *gp; in g_multipath_find_geom() local
1333 LIST_FOREACH(gp, &mp->geom, geom) { in g_multipath_find_geom()
1334 sc = gp->softc; in g_multipath_find_geom()
1337 if (strcmp(gp->name, name) == 0) in g_multipath_find_geom()
1338 return (gp); in g_multipath_find_geom()
1346 struct g_geom *gp; in g_multipath_ctl_stop() local
1357 gp = g_multipath_find_geom(mp, name); in g_multipath_ctl_stop()
1358 if (gp == NULL) { in g_multipath_ctl_stop()
1362 error = g_multipath_destroy(gp); in g_multipath_ctl_stop()
1370 struct g_geom *gp; in g_multipath_ctl_destroy() local
1385 gp = g_multipath_find_geom(mp, name); in g_multipath_ctl_destroy()
1386 if (gp == NULL) { in g_multipath_ctl_destroy()
1390 sc = gp->softc; in g_multipath_ctl_destroy()
1412 error = g_multipath_destroy(gp); in g_multipath_ctl_destroy()
1420 struct g_geom *gp; in g_multipath_ctl_rotate() local
1431 gp = g_multipath_find_geom(mp, name); in g_multipath_ctl_rotate()
1432 if (gp == NULL) { in g_multipath_ctl_rotate()
1436 error = g_multipath_rotate(gp); in g_multipath_ctl_rotate()
1446 struct g_geom *gp; in g_multipath_ctl_getactive() local
1460 gp = g_multipath_find_geom(mp, name); in g_multipath_ctl_getactive()
1461 if (gp == NULL) { in g_multipath_ctl_getactive()
1465 sc = gp->softc; in g_multipath_ctl_getactive()
1468 LIST_FOREACH(cp, &gp->consumer, consumer) { in g_multipath_ctl_getactive()
1527 g_multipath_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, in g_multipath_dumpconf() argument
1535 sc = gp->softc; in g_multipath_dumpconf()
1547 good = g_multipath_good(gp); in g_multipath_dumpconf()