Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_sunlabel.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
struct g_sunlabel_softc { | struct g_sunlabel_softc { | ||||
int sectorsize; | int sectorsize; | ||||
int nheads; | int nheads; | ||||
int nsects; | int nsects; | ||||
int nalt; | int nalt; | ||||
u_char labelsum[16]; | u_char labelsum[16]; | ||||
}; | }; | ||||
static int g_sunlabel_once = 0; | |||||
static int | static int | ||||
g_sunlabel_modify(struct g_geom *gp, struct g_sunlabel_softc *ms, u_char *sec0) | g_sunlabel_modify(struct g_geom *gp, struct g_sunlabel_softc *ms, u_char *sec0) | ||||
{ | { | ||||
int i, error; | int i, error; | ||||
u_int u, v, csize; | u_int u, v, csize; | ||||
struct sun_disklabel sl; | struct sun_disklabel sl; | ||||
MD5_CTX md5sum; | MD5_CTX md5sum; | ||||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags) | ||||
g_access(cp, -1, 0, 0); | g_access(cp, -1, 0, 0); | ||||
if (LIST_EMPTY(&gp->provider)) { | if (LIST_EMPTY(&gp->provider)) { | ||||
g_slice_spoiled(cp); | g_slice_spoiled(cp); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
g_slice_conf_hot(gp, 0, 0, SUN_SIZE, | g_slice_conf_hot(gp, 0, 0, SUN_SIZE, | ||||
G_SLICE_HOT_ALLOW, G_SLICE_HOT_DENY, G_SLICE_HOT_CALL); | G_SLICE_HOT_ALLOW, G_SLICE_HOT_DENY, G_SLICE_HOT_CALL); | ||||
gsp->hot = g_sunlabel_hotwrite; | gsp->hot = g_sunlabel_hotwrite; | ||||
if (!g_sunlabel_once) { | |||||
g_sunlabel_once = 1; | |||||
printf( | |||||
"WARNING: geom_sunlabel (geom %s) is deprecated, " | |||||
"use gpart instead.\n", gp->name); | |||||
} | |||||
return (gp); | return (gp); | ||||
} | } | ||||
static struct g_class g_sunlabel_class = { | static struct g_class g_sunlabel_class = { | ||||
.name = SUNLABEL_CLASS_NAME, | .name = SUNLABEL_CLASS_NAME, | ||||
.version = G_VERSION, | .version = G_VERSION, | ||||
.taste = g_sunlabel_taste, | .taste = g_sunlabel_taste, | ||||
.ctlreq = g_sunlabel_config, | .ctlreq = g_sunlabel_config, | ||||
.dumpconf = g_sunlabel_dumpconf, | .dumpconf = g_sunlabel_dumpconf, | ||||
}; | }; | ||||
DECLARE_GEOM_CLASS(g_sunlabel_class, g_sunlabel); | DECLARE_GEOM_CLASS(g_sunlabel_class, g_sunlabel); |