Allow to pass providers with /dev/ prefix to g_provider_by_name().
MFC after: 3 days
This commit is contained in:
parent
21fe0af7aa
commit
769afdc71e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239987
@ -686,6 +686,10 @@ g_resize_provider(struct g_provider *pp, off_t size)
|
||||
g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL);
|
||||
}
|
||||
|
||||
#ifndef _PATH_DEV
|
||||
#define _PATH_DEV "/dev/"
|
||||
#endif
|
||||
|
||||
struct g_provider *
|
||||
g_provider_by_name(char const *arg)
|
||||
{
|
||||
@ -693,6 +697,9 @@ g_provider_by_name(char const *arg)
|
||||
struct g_geom *gp;
|
||||
struct g_provider *pp;
|
||||
|
||||
if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
|
||||
arg += sizeof(_PATH_DEV) - 1;
|
||||
|
||||
LIST_FOREACH(cp, &g_classes, class) {
|
||||
LIST_FOREACH(gp, &cp->geom, geom) {
|
||||
LIST_FOREACH(pp, &gp->provider, provider) {
|
||||
@ -701,6 +708,7 @@ g_provider_by_name(char const *arg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user