diff options
author | phk <phk@FreeBSD.org> | 2002-03-15 21:41:41 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-03-15 21:41:41 +0000 |
commit | a920edd5b34a054bc705e188d107e8e0d2cbaade (patch) | |
tree | 5efc266355fe0f8b8834ae96995efdc68a0b0211 | |
parent | 01796e3f815d0752dae6e725256ca893398be9d5 (diff) | |
download | FreeBSD-src-a920edd5b34a054bc705e188d107e8e0d2cbaade.zip FreeBSD-src-a920edd5b34a054bc705e188d107e8e0d2cbaade.tar.gz |
Try to get used to architectures which are picky about alignment.
-rw-r--r-- | sys/geom/geom_slice.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 36b0bd4..37ed863 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -67,8 +67,9 @@ g_slice_init(unsigned nslice, unsigned scsize) gsp = g_malloc(sizeof *gsp + nslice * sizeof(struct g_slice) + scsize, M_WAITOK | M_ZERO); - gsp->softc = gsp + 1; - gsp->slices = (struct g_slice *)((u_char *)gsp->softc + scsize); + gsp = g_malloc(sizeof *gsp, M_WAITOK | M_ZERO); + gsp->softc = g_malloc(scsize, M_WAITOK | M_ZERO); + gsp->slices = g_malloc(nslice * sizeof(struct g_slice), M_WAITOK | M_ZERO); gsp->nslice = nslice; return (gsp); } @@ -237,6 +238,7 @@ g_slice_new(struct g_method *mp, int slices, struct g_provider *pp, struct g_con if (error) { g_dettach(cp); g_destroy_consumer(cp); + g_free(gsp->slices); g_free(gp->softc); g_destroy_geom(gp); return (NULL); @@ -266,13 +268,4 @@ g_slice_orphan(struct g_consumer *cp, struct thread *tp __unused) g_orphan_provider(pp, error); return; - if (cp->biocount > 0) - return; - - /* Then selfdestruct */ - if (cp->acr != 0 || cp->acw != 0 || cp->ace != 0) - g_access_abs(cp, 0, 0, 0); - g_dettach(cp); - g_destroy_consumer(cp); - return; } |