Index: head/sys/geom/geom.h =================================================================== --- head/sys/geom/geom.h +++ head/sys/geom/geom.h @@ -434,7 +434,7 @@ void *gctl_get_paraml_opt(struct gctl_req *req, const char *param, int len); int gctl_error(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); struct g_class *gctl_get_class(struct gctl_req *req, char const *arg); -struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg); +struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg); struct g_provider *gctl_get_provider(struct gctl_req *req, char const *arg); #endif /* _GEOM_GEOM_H_ */ Index: head/sys/geom/geom_ctl.c =================================================================== --- head/sys/geom/geom_ctl.c +++ head/sys/geom/geom_ctl.c @@ -409,25 +409,20 @@ } struct g_geom * -gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg) +gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg) { char const *p; - struct g_class *mp; struct g_geom *gp; + MPASS(mp != NULL); p = gctl_get_asciiparam(req, arg); if (p == NULL) { gctl_error(req, "Missing %s argument", arg); return (NULL); } - LIST_FOREACH(mp, &g_classes, class) { - if (mpr != NULL && mpr != mp) - continue; - LIST_FOREACH(gp, &mp->geom, geom) { - if (!strcmp(p, gp->name)) - return (gp); - } - } + LIST_FOREACH(gp, &mp->geom, geom) + if (!strcmp(p, gp->name)) + return (gp); gctl_error(req, "Geom not found: \"%s\"", p); return (NULL); }