From a920edd5b34a054bc705e188d107e8e0d2cbaade Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 15 Mar 2002 21:41:41 +0000 Subject: Try to get used to architectures which are picky about alignment. --- sys/geom/geom_slice.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sys/geom') 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; } -- cgit v1.1