diff options
author | mav <mav@FreeBSD.org> | 2009-12-24 13:38:02 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-12-24 13:38:02 +0000 |
commit | cf5b790219adaa732214f1666931e6b8e5f4ea3f (patch) | |
tree | 9b140297cd5e236290a1c774c1031f3d726817b1 /sys/geom/raid3 | |
parent | f961171ed1c1e7ef10ba90eecb16a1dd42958c19 (diff) | |
download | FreeBSD-src-cf5b790219adaa732214f1666931e6b8e5f4ea3f.zip FreeBSD-src-cf5b790219adaa732214f1666931e6b8e5f4ea3f.tar.gz |
As soon as geom_raid3 reports it's own stripe as sector size, report largest
underlying provider's stripe, multiplied by number of data disks in array,
due to transformation done, as array stripe.
Diffstat (limited to 'sys/geom/raid3')
-rw-r--r-- | sys/geom/raid3/g_raid3.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 0feca0c..6425b2e 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -2317,6 +2317,8 @@ static void g_raid3_launch_provider(struct g_raid3_softc *sc) { struct g_provider *pp; + struct g_raid3_disk *disk; + int n; sx_assert(&sc->sc_lock, SX_LOCKED); @@ -2324,6 +2326,18 @@ g_raid3_launch_provider(struct g_raid3_softc *sc) pp = g_new_providerf(sc->sc_geom, "raid3/%s", sc->sc_name); pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; + pp->stripesize = 0; + pp->stripeoffset = 0; + for (n = 0; n < sc->sc_ndisks; n++) { + disk = &sc->sc_disks[n]; + if (disk->d_consumer && disk->d_consumer->provider && + disk->d_consumer->provider->stripesize > pp->stripesize) { + pp->stripesize = disk->d_consumer->provider->stripesize; + pp->stripeoffset = disk->d_consumer->provider->stripeoffset; + } + } + pp->stripesize *= sc->sc_ndisks - 1; + pp->stripeoffset *= sc->sc_ndisks - 1; sc->sc_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); |