Date: Wed, 19 Jun 2013 21:52:32 +0000 (UTC) From: Scott Long <scottl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252010 - head/sys/geom/mirror Message-ID: <201306192152.r5JLqWfs058862@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: scottl Date: Wed Jun 19 21:52:32 2013 New Revision: 252010 URL: http://svnweb.freebsd.org/changeset/base/252010 Log: Mark geom_mirror as capable of unmapped i/o Obtained from: Netflix MFC after: 3 days Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jun 19 21:50:17 2013 (r252009) +++ head/sys/geom/mirror/g_mirror.c Wed Jun 19 21:52:32 2013 (r252010) @@ -2028,7 +2028,7 @@ static void g_mirror_launch_provider(struct g_mirror_softc *sc) { struct g_mirror_disk *disk; - struct g_provider *pp; + struct g_provider *pp, *dp; sx_assert(&sc->sc_lock, SX_LOCKED); @@ -2038,11 +2038,24 @@ g_mirror_launch_provider(struct g_mirror pp->sectorsize = sc->sc_sectorsize; pp->stripesize = 0; pp->stripeoffset = 0; + + /* Splitting of unmapped BIO's could work but isn't implemented now */ + if (sc->sc_balance != G_MIRROR_BALANCE_SPLIT) + pp->flags |= G_PF_ACCEPT_UNMAPPED; + 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; + if (disk->d_consumer && disk->d_consumer->provider) { + dp = disk->d_consumer->provider; + if (dp->stripesize > pp->stripesize) { + pp->stripesize = dp->stripesize; + pp->stripeoffset = dp->stripeoffset; + } + /* A provider underneath us doesn't support unmapped */ + if ((dp->flags & G_PF_ACCEPT_UNMAPPED) == 0) { + G_MIRROR_DEBUG(0, "cancelling unmapped " + "because of %s\n", dp->name); + pp->flags &= ~G_PF_ACCEPT_UNMAPPED; + } } } sc->sc_provider = pp;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306192152.r5JLqWfs058862>