From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 17:36:34 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3888BA4A; Fri, 21 Jun 2013 17:36:34 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2893A1BFE; Fri, 21 Jun 2013 17:36:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5LHaYIw070053; Fri, 21 Jun 2013 17:36:34 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LHaYPN070052; Fri, 21 Jun 2013 17:36:34 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306211736.r5LHaYPN070052@svn.freebsd.org> From: Scott Long Date: Fri, 21 Jun 2013 17:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252063 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 17:36:34 -0000 Author: scottl Date: Fri Jun 21 17:36:33 2013 New Revision: 252063 URL: http://svnweb.freebsd.org/changeset/base/252063 Log: MFC r252010, r252011: Mark geom_mirror as capable of unmapped i/o Obtained from: Netflix Modified: stable/9/sys/geom/mirror/g_mirror.c Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Fri Jun 21 17:23:19 2013 (r252062) +++ stable/9/sys/geom/mirror/g_mirror.c Fri Jun 21 17:36:33 2013 (r252063) @@ -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;