Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/virstor/g_virstor.c
Show First 20 Lines • Show All 774 Lines • ▼ Show 20 Lines | g_virstor_taste(struct g_class *mp, struct g_provider *pp, int flags) | ||||
/* We need a dummy geom to attach a consumer to the given provider */ | /* We need a dummy geom to attach a consumer to the given provider */ | ||||
gp = g_new_geomf(mp, "virstor:taste.helper"); | gp = g_new_geomf(mp, "virstor:taste.helper"); | ||||
gp->start = (void *)invalid_call; /* XXX: hacked up so the */ | gp->start = (void *)invalid_call; /* XXX: hacked up so the */ | ||||
gp->access = (void *)invalid_call; /* compiler doesn't complain. */ | gp->access = (void *)invalid_call; /* compiler doesn't complain. */ | ||||
gp->orphan = (void *)invalid_call; /* I really want these to fail. */ | gp->orphan = (void *)invalid_call; /* I really want these to fail. */ | ||||
cp = g_new_consumer(gp); | cp = g_new_consumer(gp); | ||||
g_attach(cp, pp); | error = g_attach(cp, pp); | ||||
if (error == 0) { | |||||
error = read_metadata(cp, &md); | error = read_metadata(cp, &md); | ||||
g_detach(cp); | g_detach(cp); | ||||
} | |||||
g_destroy_consumer(cp); | g_destroy_consumer(cp); | ||||
g_destroy_geom(gp); | g_destroy_geom(gp); | ||||
if (error != 0) | if (error != 0) | ||||
return (NULL); | return (NULL); | ||||
if (strcmp(md.md_magic, G_VIRSTOR_MAGIC) != 0) | if (strcmp(md.md_magic, G_VIRSTOR_MAGIC) != 0) | ||||
return (NULL); | return (NULL); | ||||
▲ Show 20 Lines • Show All 1,083 Lines • Show Last 20 Lines |