diff options
author | phk <phk@FreeBSD.org> | 2003-05-02 05:33:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-05-02 05:33:27 +0000 |
commit | cb4841eb7efa0c177013b84e76c78892983a8395 (patch) | |
tree | a72efa0986df4b0ecffc24413f09288185d7b245 /sys/geom | |
parent | f30c2be11fd392aa4839da69c2fdb02378de5128 (diff) | |
download | FreeBSD-src-cb4841eb7efa0c177013b84e76c78892983a8395.zip FreeBSD-src-cb4841eb7efa0c177013b84e76c78892983a8395.tar.gz |
Rename g_slice_init() to the more appropriate g_slice_alloc() and give
it a g_slice_free() partner function.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_slice.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 2d31b7c..0ff13b2 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -57,7 +57,7 @@ static g_access_t g_slice_access; static g_start_t g_slice_start; static struct g_slicer * -g_slice_init(unsigned nslice, unsigned scsize) +g_slice_alloc(unsigned nslice, unsigned scsize) { struct g_slicer *gsp; @@ -69,6 +69,17 @@ g_slice_init(unsigned nslice, unsigned scsize) return (gsp); } +static void +g_slice_free(struct g_slicer *gsp) +{ + + g_free(gsp->slices); + if (gsp->hotspot != NULL) + g_free(gsp->hotspot); + g_free(gsp->softc); + g_free(gsp); +} + static int g_slice_access(struct g_provider *pp, int dr, int dw, int de) { @@ -416,7 +427,7 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co g_topology_assert(); vp = (void **)extrap; gp = g_new_geomf(mp, "%s", pp->name); - gsp = g_slice_init(slices, extra); + gsp = g_slice_alloc(slices, extra); gsp->start = start; gp->access = g_slice_access; gp->orphan = g_slice_orphan; @@ -432,8 +443,7 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co if (cp->provider != NULL) g_detach(cp); g_destroy_consumer(cp); - g_free(gsp->slices); - g_free(gp->softc); + g_slice_free(gsp); g_destroy_geom(gp); return (NULL); } |