Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 2017 10:18:31 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325009 - head/sys/geom/mountver
Message-ID:  <201710261018.v9QAIVsT088779@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Oct 26 10:18:31 2017
New Revision: 325009
URL: https://svnweb.freebsd.org/changeset/base/325009

Log:
  Make gmountver(8) use direct dispatch.
  
  MFC after:	2 weeks

Modified:
  head/sys/geom/mountver/g_mountver.c

Modified: head/sys/geom/mountver/g_mountver.c
==============================================================================
--- head/sys/geom/mountver/g_mountver.c	Thu Oct 26 10:11:35 2017	(r325008)
+++ head/sys/geom/mountver/g_mountver.c	Thu Oct 26 10:18:31 2017	(r325009)
@@ -257,7 +257,7 @@ g_mountver_create(struct gctl_req *req, struct g_class
 	}
 	gp = g_new_geomf(mp, "%s", name);
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
-	mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF);
+	mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_RECURSE);
 	TAILQ_INIT(&sc->sc_queue);
 	sc->sc_provider_name = strdup(pp->name, M_GEOM);
 	gp->softc = sc;
@@ -270,6 +270,7 @@ g_mountver_create(struct gctl_req *req, struct g_class
 	newpp = g_new_providerf(gp, "%s", gp->name);
 	newpp->mediasize = pp->mediasize;
 	newpp->sectorsize = pp->sectorsize;
+	newpp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE;
 
 	if ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0) {
 		G_MOUNTVER_DEBUG(0, "Unmapped supported for %s.", gp->name);
@@ -280,6 +281,7 @@ g_mountver_create(struct gctl_req *req, struct g_class
 	}
 
 	cp = g_new_consumer(gp);
+	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		gctl_error(req, "Cannot attach to provider %s.", pp->name);



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