Lines Matching refs:gp

63 static int g_mountver_destroy(struct g_geom *gp, boolean_t force);
66 struct g_geom *gp);
70 struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp);
99 struct g_geom *gp;
104 gp = cp->geom;
117 KASSERT(pbp->bio_to == LIST_FIRST(&gp->provider),
124 sc = gp->softc;
136 g_mountver_send(struct g_geom *gp, struct bio *bp)
138 struct g_mountver_softc *sc = gp->softc;
149 cp = LIST_FIRST(&gp->consumer);
161 struct g_geom *gp;
163 gp = bp->bio_to->geom;
164 sc = gp->softc;
172 g_mountver_send_queued(struct g_geom *gp)
177 sc = gp->softc;
184 g_mountver_send(gp, bp);
191 g_mountver_discard_queued(struct g_geom *gp)
196 sc = gp->softc;
213 struct g_geom *gp;
215 gp = bp->bio_to->geom;
216 sc = gp->softc;
235 g_mountver_send_queued(gp);
239 g_mountver_send(gp, bp);
247 struct g_geom *gp;
252 gp = pp->geom;
253 cp = LIST_FIRST(&gp->consumer);
254 sc = gp->softc;
273 struct g_geom *gp;
283 gp = NULL;
288 LIST_FOREACH(gp, &mp->geom, geom) {
289 if (strcmp(gp->name, name) == 0) {
294 gp = g_new_geomf(mp, "%s", name);
299 gp->softc = sc;
300 gp->start = g_mountver_start;
301 gp->orphan = g_mountver_orphan;
302 gp->resize = g_mountver_resize;
303 gp->access = g_mountver_access;
304 gp->dumpconf = g_mountver_dumpconf;
306 newpp = g_new_providerf(gp, "%s", gp->name);
314 G_MOUNTVER_DEBUG(0, "Unmapped supported for %s.", gp->name);
317 G_MOUNTVER_DEBUG(0, "Unmapped unsupported for %s.", gp->name);
321 cp = g_new_consumer(gp);
346 G_MOUNTVER_DEBUG(0, "Device %s created.", gp->name);
354 g_free(gp->softc);
355 g_destroy_geom(gp);
360 g_mountver_destroy(struct g_geom *gp, boolean_t force)
366 if (gp->softc == NULL)
368 sc = gp->softc;
369 pp = LIST_FIRST(&gp->provider);
380 G_MOUNTVER_DEBUG(0, "Device %s removed.", gp->name);
384 g_mountver_discard_queued(gp);
386 g_free(gp->softc);
387 gp->softc = NULL;
388 g_wither_geom(gp, ENXIO);
394 g_mountver_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
397 return (g_mountver_destroy(gp, 0));
431 struct g_geom *gp;
433 LIST_FOREACH(gp, &mp->geom, geom) {
434 if (strcmp(gp->name, name) == 0)
435 return (gp);
444 struct g_geom *gp;
474 gp = g_mountver_find_geom(mp, name);
475 if (gp == NULL) {
480 error = g_mountver_destroy(gp, *force);
483 gp->name, error);
510 struct g_geom *gp;
513 gp = cp->geom;
515 LIST_FOREACH(pp, &gp->provider, provider)
520 g_mountver_ident_matches(struct g_geom *gp)
527 sc = gp->softc;
528 cp = LIST_FIRST(&gp->consumer);
536 "not attaching; error = %d.", gp->name, error);
543 "not attaching; error = %d.", gp->name, error);
548 "from expected \"%s\", not attaching.", gp->name, ident,
561 struct g_geom *gp;
571 LIST_FOREACH(gp, &mp->geom, geom) {
572 sc = gp->softc;
577 if (pp == LIST_FIRST(&gp->provider))
583 if (gp == NULL)
586 cp = LIST_FIRST(&gp->consumer);
593 error = g_mountver_ident_matches(gp);
607 g_mountver_send_queued(gp);
610 return (gp);
642 g_mountver_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
650 sc = gp->softc;
662 struct g_geom *gp, *gp2;
666 LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) {
667 if (gp->softc == NULL)
669 sc = gp->softc;
672 g_mountver_destroy(gp, 1);