Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_mbr.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
#include <geom/geom.h> | #include <geom/geom.h> | ||||
#include <geom/geom_slice.h> | #include <geom/geom_slice.h> | ||||
FEATURE(geom_mbr, "GEOM DOS/MBR partitioning support"); | FEATURE(geom_mbr, "GEOM DOS/MBR partitioning support"); | ||||
#define MBR_CLASS_NAME "MBR" | #define MBR_CLASS_NAME "MBR" | ||||
#define MBREXT_CLASS_NAME "MBREXT" | #define MBREXT_CLASS_NAME "MBREXT" | ||||
static int g_mbr_once = 0; | |||||
static struct dos_partition historical_bogus_partition_table[NDOSPART] = { | static struct dos_partition historical_bogus_partition_table[NDOSPART] = { | ||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | ||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | ||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | ||||
{ 0x80, 0, 1, 0, DOSPTYP_386BSD, 255, 255, 255, 0, 50000, }, | { 0x80, 0, 1, 0, DOSPTYP_386BSD, 255, 255, 255, 0, 50000, }, | ||||
}; | }; | ||||
static struct dos_partition historical_bogus_partition_table_fixed[NDOSPART] = { | static struct dos_partition historical_bogus_partition_table_fixed[NDOSPART] = { | ||||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | do { | ||||
g_free(buf); | g_free(buf); | ||||
break; | break; | ||||
} while (0); | } while (0); | ||||
g_topology_lock(); | g_topology_lock(); | ||||
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); | ||||
} | |||||
if (!g_mbr_once) { | |||||
g_mbr_once = 1; | |||||
printf( | |||||
"WARNING: geom_mbr (geom %s) is deprecated, " | |||||
"use gpart instead.\n", gp->name); | |||||
} | } | ||||
return (gp); | return (gp); | ||||
} | } | ||||
static void | static void | ||||
g_mbr_config(struct gctl_req *req, struct g_class *mp, const char *verb) | g_mbr_config(struct gctl_req *req, struct g_class *mp, const char *verb) | ||||
{ | { | ||||
struct g_geom *gp; | struct g_geom *gp; | ||||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |