1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

Make gmountver(8) use direct dispatch.

MFC after:	2 weeks
This commit is contained in:
Edward Tomasz Napierala 2017-10-26 10:18:31 +00:00
parent 4001fcbe0a
commit 0d73fface2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325009

View File

@ -257,7 +257,7 @@ g_mountver_create(struct gctl_req *req, struct g_class *mp, struct g_provider *p
}
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 *mp, struct g_provider *p
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 *mp, struct g_provider *p
}
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);