diff options
author | phk <phk@FreeBSD.org> | 2003-06-04 18:17:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-06-04 18:17:52 +0000 |
commit | e23e34a19802782b58aaba1063a789cc198f2e82 (patch) | |
tree | 5626e124f018746fcb1f3cd7775457d4272b04d5 /sys/geom/geom_subr.c | |
parent | 9e9ac1e55e5c653a1a2a32556d8ddbcd3213e9ed (diff) | |
download | FreeBSD-src-e23e34a19802782b58aaba1063a789cc198f2e82.zip FreeBSD-src-e23e34a19802782b58aaba1063a789cc198f2e82.tar.gz |
Introduce g_provider_by_name() function, and use it.
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r-- | sys/geom/geom_subr.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 00bdfcb..84978c9 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -380,6 +380,23 @@ g_error_provider(struct g_provider *pp, int error) pp->error = error; } +struct g_provider * +g_provider_by_name(char const *arg) +{ + struct g_class *cp; + struct g_geom *gp; + struct g_provider *pp; + + LIST_FOREACH(cp, &g_classes, class) { + LIST_FOREACH(gp, &cp->geom, geom) { + LIST_FOREACH(pp, &gp->provider, provider) { + if (!strcmp(arg, pp->name)) + return (pp); + } + } + } + return (NULL); +} void g_destroy_provider(struct g_provider *pp) |