svn commit: r201581 - stable/8/sys/geom/raid3

Alexander Motin mav at FreeBSD.org
Tue Jan 5 13:49:18 UTC 2010


Author: mav
Date: Tue Jan  5 13:49:18 2010
New Revision: 201581
URL: http://svn.freebsd.org/changeset/base/201581

Log:
  MFC r200940:
  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:
  stable/8/sys/geom/raid3/g_raid3.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/geom/raid3/g_raid3.c
==============================================================================
--- stable/8/sys/geom/raid3/g_raid3.c	Tue Jan  5 13:47:55 2010	(r201580)
+++ stable/8/sys/geom/raid3/g_raid3.c	Tue Jan  5 13:49:18 2010	(r201581)
@@ -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();


More information about the svn-src-stable-8 mailing list