Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/cache/g_cache.c
Show First 20 Lines • Show All 667 Lines • ▼ Show 20 Lines | g_cache_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) | ||||
G_CACHE_DEBUG(3, "Tasting %s.", pp->name); | G_CACHE_DEBUG(3, "Tasting %s.", pp->name); | ||||
gp = g_new_geomf(mp, "cache:taste"); | gp = g_new_geomf(mp, "cache:taste"); | ||||
gp->start = g_cache_start; | gp->start = g_cache_start; | ||||
gp->orphan = g_cache_orphan; | gp->orphan = g_cache_orphan; | ||||
gp->access = g_cache_access; | gp->access = g_cache_access; | ||||
cp = g_new_consumer(gp); | cp = g_new_consumer(gp); | ||||
g_attach(cp, pp); | error = g_attach(cp, pp); | ||||
if (error == 0) { | |||||
error = g_cache_read_metadata(cp, &md); | error = g_cache_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_CACHE_MAGIC) != 0) | if (strcmp(md.md_magic, G_CACHE_MAGIC) != 0) | ||||
return (NULL); | return (NULL); | ||||
if (md.md_version > G_CACHE_VERSION) { | if (md.md_version > G_CACHE_VERSION) { | ||||
▲ Show 20 Lines • Show All 326 Lines • Show Last 20 Lines |