Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/linux_lvm/g_linux_lvm.c
Show First 20 Lines • Show All 537 Lines • ▼ Show 20 Lines | g_llvm_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) | ||||
bzero(&md, sizeof(md)); | bzero(&md, sizeof(md)); | ||||
g_topology_assert(); | g_topology_assert(); | ||||
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); | g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); | ||||
gp = g_new_geomf(mp, "linux_lvm:taste"); | gp = g_new_geomf(mp, "linux_lvm:taste"); | ||||
/* This orphan function should be never called. */ | /* This orphan function should be never called. */ | ||||
gp->orphan = g_llvm_taste_orphan; | gp->orphan = g_llvm_taste_orphan; | ||||
cp = g_new_consumer(gp); | cp = g_new_consumer(gp); | ||||
g_attach(cp, pp); | error = g_attach(cp, pp); | ||||
if (error == 0) { | |||||
error = g_llvm_read_label(cp, &ll); | error = g_llvm_read_label(cp, &ll); | ||||
if (!error) | if (error == 0) | ||||
error = g_llvm_read_md(cp, &md, &ll); | error = g_llvm_read_md(cp, &md, &ll); | ||||
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); | ||||
vg = md.md_vg; | vg = md.md_vg; | ||||
if (vg->vg_geom == NULL) { | if (vg->vg_geom == NULL) { | ||||
/* new volume group */ | /* new volume group */ | ||||
▲ Show 20 Lines • Show All 640 Lines • Show Last 20 Lines |