Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 2009 13:38:02 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200940 - head/sys/geom/raid3
Message-ID:  <200912241338.nBODc2V0031652@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Dec 24 13:38:02 2009
New Revision: 200940
URL: http://svn.freebsd.org/changeset/base/200940

Log:
  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.

Modified:
  head/sys/geom/raid3/g_raid3.c

Modified: head/sys/geom/raid3/g_raid3.c
==============================================================================
--- head/sys/geom/raid3/g_raid3.c	Thu Dec 24 12:31:27 2009	(r200939)
+++ head/sys/geom/raid3/g_raid3.c	Thu Dec 24 13:38:02 2009	(r200940)
@@ -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_s
 	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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912241338.nBODc2V0031652>