summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_ctl.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-04 18:17:52 +0000
committerphk <phk@FreeBSD.org>2003-06-04 18:17:52 +0000
commite23e34a19802782b58aaba1063a789cc198f2e82 (patch)
tree5626e124f018746fcb1f3cd7775457d4272b04d5 /sys/geom/geom_ctl.c
parent9e9ac1e55e5c653a1a2a32556d8ddbcd3213e9ed (diff)
downloadFreeBSD-src-e23e34a19802782b58aaba1063a789cc198f2e82.zip
FreeBSD-src-e23e34a19802782b58aaba1063a789cc198f2e82.tar.gz
Introduce g_provider_by_name() function, and use it.
Diffstat (limited to 'sys/geom/geom_ctl.c')
-rw-r--r--sys/geom/geom_ctl.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c
index 76491b8..c113076 100644
--- a/sys/geom/geom_ctl.c
+++ b/sys/geom/geom_ctl.c
@@ -406,21 +406,14 @@ struct g_provider *
gctl_get_provider(struct gctl_req *req, char const *arg)
{
char const *p;
- struct g_class *cp;
- struct g_geom *gp;
struct g_provider *pp;
p = gctl_get_asciiparam(req, arg);
if (p == NULL)
return (NULL);
- LIST_FOREACH(cp, &g_classes, class) {
- LIST_FOREACH(gp, &cp->geom, geom) {
- LIST_FOREACH(pp, &gp->provider, provider) {
- if (!strcmp(p, pp->name))
- return (pp);
- }
- }
- }
+ pp = g_provider_by_name(p);
+ if (pp != NULL)
+ return (pp);
gctl_error(req, "Provider not found");
return (NULL);
}
OpenPOWER on IntegriCloud