Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/shsec/g_shsec.c
Show First 20 Lines • Show All 640 Lines • ▼ Show 20 Lines | g_shsec_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) | ||||
G_SHSEC_DEBUG(3, "Tasting %s.", pp->name); | G_SHSEC_DEBUG(3, "Tasting %s.", pp->name); | ||||
gp = g_new_geomf(mp, "shsec:taste"); | gp = g_new_geomf(mp, "shsec:taste"); | ||||
gp->start = g_shsec_start; | gp->start = g_shsec_start; | ||||
gp->access = g_shsec_access; | gp->access = g_shsec_access; | ||||
gp->orphan = g_shsec_orphan; | gp->orphan = g_shsec_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_shsec_read_metadata(cp, &md); | error = g_shsec_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); | ||||
gp = NULL; | gp = NULL; | ||||
if (strcmp(md.md_magic, G_SHSEC_MAGIC) != 0) | if (strcmp(md.md_magic, G_SHSEC_MAGIC) != 0) | ||||
return (NULL); | return (NULL); | ||||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |