summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-09-06 08:50:28 +0000
committerphk <phk@FreeBSD.org>2002-09-06 08:50:28 +0000
commit42ca888ae8c4fc973e744c26f157b8f17d46744c (patch)
tree066067ca6695e2c968ad2b897234a1d43d1ac949 /sys/geom/geom_subr.c
parent33a29ee495ec7a6be113d9fd823bdb77e2c5a34c (diff)
downloadFreeBSD-src-42ca888ae8c4fc973e744c26f157b8f17d46744c.zip
FreeBSD-src-42ca888ae8c4fc973e744c26f157b8f17d46744c.tar.gz
Remove "magicspace". It looks good on paper, it doesn't work in practice.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index c6de3cc..550dec6 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -114,46 +114,6 @@ g_new_geomf(struct g_class *mp, char *fmt, ...)
return (gp);
}
-/*
- * Add a magic space to a geom. There is no locking here because nobody
- * should be modifying these except the geom itself during configuration,
- * so it cannot go away while we fiddling it.
- * For now, no provision exists for removing magic spaces or for changing
- * them on the fly.
- */
-
-int
-g_add_magicspace(struct g_geom *gp, const char *name, off_t start, u_int len, u_int flags)
-{
- int i;
- struct g_magicspaces *msps;
- struct g_magicspace *msp, *msp2;
-
- if (gp->magicspaces == NULL) {
- msps = g_malloc(sizeof *gp->magicspaces, M_WAITOK | M_ZERO);
- msps->geom_id = (uintptr_t)gp;
- strncpy(msps->class, gp->class->name, sizeof msps->class);
- gp->magicspaces = msps;
- }
- msps = gp->magicspaces;
- if (msps->nmagic >= msps->nspace) {
- i = msps->nspace + 1;
- msp = g_malloc(sizeof(*msp) * i, M_WAITOK | M_ZERO);
- bcopy(msps->magicspace, msp, sizeof(*msp) * msps->nmagic);
- msp2 = msps->magicspace;
- msps->magicspace = msp;
- if (msp2 != NULL)
- g_free(msp2);
- msps->nspace = i;
- }
- msp = &msps->magicspace[msps->nmagic++];
- strncpy(msp->name, name, sizeof msp->name);
- msp->offset = start;
- msp->len = len;
- msp->flags = flags;
- return (0);
-}
-
void
g_destroy_geom(struct g_geom *gp)
{
@@ -169,10 +129,6 @@ g_destroy_geom(struct g_geom *gp)
gp->name, LIST_FIRST(&gp->consumer)));
LIST_REMOVE(gp, geom);
TAILQ_REMOVE(&geoms, gp, geoms);
- if (gp->magicspaces) {
- g_free(gp->magicspaces->magicspace);
- g_free(gp->magicspaces);
- }
g_free(gp->name);
g_free(gp);
}
OpenPOWER on IntegriCloud