Lines Matching refs:gp

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