diff options
-rw-r--r-- | sys/geom/geom_slice.c | 8 | ||||
-rw-r--r-- | sys/geom/part/g_part.c | 9 | ||||
-rw-r--r-- | sys/geom/uzip/g_uzip.c | 6 |
3 files changed, 10 insertions, 13 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 0bdb10c..8a49018 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -393,10 +393,10 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; pp->flags = pp2->flags & G_PF_CANDELETE; - if (pp2->stripesize > 0) { - pp->stripesize = pp2->stripesize; - pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize; - } + pp->stripesize = pp2->stripesize; + pp->stripeoffset = pp2->stripeoffset + offset; + if (pp->stripesize > 0) + pp->stripeoffset %= pp->stripesize; if (0 && bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 2b57a26..0434ace 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -288,11 +288,10 @@ g_part_new_provider(struct g_geom *gp, struct g_part_table *table, entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - entry->gpe_pp->stripesize = pp->stripesize; - entry->gpe_pp->stripeoffset = (pp->stripeoffset + - entry->gpe_offset) % pp->stripesize; - } + entry->gpe_pp->stripesize = pp->stripesize; + entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; + if (pp->stripesize > 0) + entry->gpe_pp->stripeoffset %= pp->stripesize; g_error_provider(entry->gpe_pp, 0); } diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c index 90eee02..2301efb 100644 --- a/sys/geom/uzip/g_uzip.c +++ b/sys/geom/uzip/g_uzip.c @@ -467,10 +467,8 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags) pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - pp2->stripesize = pp->stripesize; - pp2->stripeoffset = pp->stripeoffset; - } + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); |