Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_bsd.c
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
#define BSD_CLASS_NAME "BSD" | #define BSD_CLASS_NAME "BSD" | ||||
#define ALPHA_LABEL_OFFSET 64 | #define ALPHA_LABEL_OFFSET 64 | ||||
#define HISTORIC_LABEL_OFFSET 512 | #define HISTORIC_LABEL_OFFSET 512 | ||||
#define LABELSIZE (148 + 16 * MAXPARTITIONS) | #define LABELSIZE (148 + 16 * MAXPARTITIONS) | ||||
static int g_bsd_once; | |||||
static void g_bsd_hotwrite(void *arg, int flag); | static void g_bsd_hotwrite(void *arg, int flag); | ||||
/* | /* | ||||
* Our private data about one instance. All the rest is handled by the | * Our private data about one instance. All the rest is handled by the | ||||
* slice code and stored in its softc, so this is just the stuff | * slice code and stored in its softc, so this is just the stuff | ||||
* specific to BSD disklabels. | * specific to BSD disklabels. | ||||
*/ | */ | ||||
struct g_bsd_softc { | struct g_bsd_softc { | ||||
off_t labeloffset; | off_t labeloffset; | ||||
▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags) | ||||
/* Success or failure, we can close our provider now. */ | /* Success or failure, we can close our provider now. */ | ||||
g_access(cp, -1, 0, 0); | g_access(cp, -1, 0, 0); | ||||
/* If we have configured any providers, return the new geom. */ | /* If we have configured any providers, return the new geom. */ | ||||
if (gsp->nprovider > 0) { | if (gsp->nprovider > 0) { | ||||
g_slice_conf_hot(gp, 0, ms->labeloffset, LABELSIZE, | g_slice_conf_hot(gp, 0, ms->labeloffset, LABELSIZE, | ||||
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_bsd_hotwrite; | gsp->hot = g_bsd_hotwrite; | ||||
if (!g_bsd_once) { | |||||
g_bsd_once = 1; | |||||
printf( | |||||
"WARNING: geom_bsd (geom %s) is deprecated, " | |||||
"use gpart instead.\n", gp->name); | |||||
} | |||||
return (gp); | return (gp); | ||||
} | } | ||||
/* | /* | ||||
* ...else push the "self-destruct" button, by spoiling our own | * ...else push the "self-destruct" button, by spoiling our own | ||||
* consumer. This triggers a call to g_slice_spoiled which will | * consumer. This triggers a call to g_slice_spoiled which will | ||||
* dismantle what was setup. | * dismantle what was setup. | ||||
*/ | */ | ||||
g_slice_spoiled(cp); | g_slice_spoiled(cp); | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |