Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/bde/g_bde.c
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *pp) | ||||
void *key; | void *key; | ||||
g_trace(G_T_TOPOLOGY, "g_bde_create_geom(%s, %s)", mp->name, pp->name); | g_trace(G_T_TOPOLOGY, "g_bde_create_geom(%s, %s)", mp->name, pp->name); | ||||
g_topology_assert(); | g_topology_assert(); | ||||
gp = NULL; | gp = NULL; | ||||
gp = g_new_geomf(mp, "%s.bde", pp->name); | gp = g_new_geomf(mp, "%s.bde", pp->name); | ||||
cp = g_new_consumer(gp); | cp = g_new_consumer(gp); | ||||
g_attach(cp, pp); | error = g_attach(cp, pp); | ||||
if (error != 0) { | |||||
g_destroy_consumer(cp); | |||||
g_destroy_geom(gp); | |||||
gctl_error(req, "could not attach consumer"); | |||||
return; | |||||
} | |||||
error = g_access(cp, 1, 1, 1); | error = g_access(cp, 1, 1, 1); | ||||
if (error) { | if (error) { | ||||
g_detach(cp); | g_detach(cp); | ||||
g_destroy_consumer(cp); | g_destroy_consumer(cp); | ||||
g_destroy_geom(gp); | g_destroy_geom(gp); | ||||
gctl_error(req, "could not access consumer"); | gctl_error(req, "could not access consumer"); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |