From fd7ea6d48a7d211946407c3e54e2eb37746d510a Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 11 Feb 2003 14:57:34 +0000 Subject: Better names for struct disk elements: d_maxsize, d_stripeoffset and d_stripesisze; Introduce si_stripesize and si_stripeoffset in struct cdev so we can make the visible to clustering code. Add stripesize and stripeoffset to providers. DTRT with stripesize and stripeoffset in various places in GEOM. --- sys/geom/geom_slice.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/geom/geom_slice.c') diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index e0632b3..11f1380 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -291,7 +291,7 @@ g_slice_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...) { - struct g_provider *pp; + struct g_provider *pp, *pp2; struct g_slicer *gsp; struct g_slice *gsl; va_list ap; @@ -346,8 +346,10 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length sbuf_vprintf(sb, fmt, ap); sbuf_finish(sb); pp = g_new_providerf(gp, sbuf_data(sb)); - pp->flags = - LIST_FIRST(&gp->consumer)->provider->flags & G_PF_CANDELETE; + pp2 = LIST_FIRST(&gp->consumer)->provider; + pp->flags = pp2->flags & G_PF_CANDELETE; + pp->stripesize = pp2->stripesize; + pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize; if (bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, -- cgit v1.1