Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/raid/g_raid.c
Show First 20 Lines • Show All 769 Lines • ▼ Show 20 Lines | |||||
struct g_consumer * | struct g_consumer * | ||||
g_raid_open_consumer(struct g_raid_softc *sc, const char *name) | g_raid_open_consumer(struct g_raid_softc *sc, const char *name) | ||||
{ | { | ||||
struct g_consumer *cp; | struct g_consumer *cp; | ||||
struct g_provider *pp; | struct g_provider *pp; | ||||
g_topology_assert(); | g_topology_assert(); | ||||
if (strncmp(name, "/dev/", 5) == 0) | if (strncmp(name, _PATH_DEV, 5) == 0) | ||||
name += 5; | name += 5; | ||||
pp = g_provider_by_name(name); | pp = g_provider_by_name(name); | ||||
if (pp == NULL) | if (pp == NULL) | ||||
return (NULL); | return (NULL); | ||||
cp = g_new_consumer(sc->sc_geom); | cp = g_new_consumer(sc->sc_geom); | ||||
cp->flags |= G_CF_DIRECT_RECEIVE; | cp->flags |= G_CF_DIRECT_RECEIVE; | ||||
if (g_attach(cp, pp) != 0) { | if (g_attach(cp, pp) != 0) { | ||||
g_destroy_consumer(cp); | g_destroy_consumer(cp); | ||||
▲ Show 20 Lines • Show All 1,788 Lines • Show Last 20 Lines |