summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-12-24 12:17:22 +0000
committermav <mav@FreeBSD.org>2009-12-24 12:17:22 +0000
commite6038335e883e94487aa6cd880b47f3726647179 (patch)
treee55aea7cf1ff1159ed7681cf2c13c1251b8bc018 /sys/geom/mirror
parentf90d8324367d5d579faf67e2a84261d958916058 (diff)
downloadFreeBSD-src-e6038335e883e94487aa6cd880b47f3726647179.zip
FreeBSD-src-e6038335e883e94487aa6cd880b47f3726647179.tar.gz
As soon as mirror has no own stripes, report largest stripe of unrerlying
components, hoping others fit, if they are not equal.
Diffstat (limited to 'sys/geom/mirror')
-rw-r--r--sys/geom/mirror/g_mirror.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 973e10b..25de44a 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -2036,6 +2036,15 @@ g_mirror_launch_provider(struct g_mirror_softc *sc)
pp = g_new_providerf(sc->sc_geom, "mirror/%s", sc->sc_name);
pp->mediasize = sc->sc_mediasize;
pp->sectorsize = sc->sc_sectorsize;
+ pp->stripesize = 0;
+ pp->stripeoffset = 0;
+ LIST_FOREACH(disk, &sc->sc_disks, d_next) {
+ 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;
+ }
+ }
sc->sc_provider = pp;
g_error_provider(pp, 0);
g_topology_unlock();
OpenPOWER on IntegriCloud