Forward ioctl requests to original geom.

PR:		148540
Silence from:	luigi
Reviewed by:	pjd
Approved by:	mav (mentor)
MFC after:	2 weeks
This commit is contained in:
Andrey V. Elsukov 2010-08-02 10:30:49 +00:00
parent b6d4028166
commit a80f05bb73
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210747

View File

@ -136,6 +136,8 @@ static void g_sched_dumpconf(struct sbuf *sb, const char *indent,
struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp);
static void g_sched_init(struct g_class *mp);
static void g_sched_fini(struct g_class *mp);
static int g_sched_ioctl(struct g_provider *pp, u_long cmd, void *data,
int fflag, struct thread *td);
struct g_class g_sched_class = {
.name = G_SCHED_CLASS_NAME,
@ -144,6 +146,7 @@ struct g_class g_sched_class = {
.taste = g_sched_taste,
.destroy_geom = g_sched_destroy_geom,
.init = g_sched_init,
.ioctl = g_sched_ioctl,
.fini = g_sched_fini
};
@ -1601,6 +1604,22 @@ g_sched_fini(struct g_class *mp)
mtx_destroy(&me.gs_mtx);
}
static int
g_sched_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag,
struct thread *td)
{
struct g_consumer *cp;
struct g_geom *gp;
cp = LIST_FIRST(&pp->geom->consumer);
if (cp == NULL)
return (ENOIOCTL);
gp = cp->provider->geom;
if (gp->ioctl == NULL)
return (ENOIOCTL);
return (gp->ioctl(cp->provider, cmd, data, fflag, td));
}
/*
* Read the i-th argument for a request, skipping the /dev/
* prefix if present.