From owner-freebsd-geom@FreeBSD.ORG Wed Jul 14 13:00:09 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF230106567A for ; Wed, 14 Jul 2010 13:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9442F8FC27 for ; Wed, 14 Jul 2010 13:00:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6ED09qs005984 for ; Wed, 14 Jul 2010 13:00:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6ED09uM005980; Wed, 14 Jul 2010 13:00:09 GMT (envelope-from gnats) Date: Wed, 14 Jul 2010 13:00:09 GMT Message-Id: <201007141300.o6ED09uM005980@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: "Andrey V. Elsukov" Cc: Subject: Re: kern/148540: [geom] geom_sched breaks ata devices X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Andrey V. Elsukov" List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2010 13:00:09 -0000 The following reply was made to PR kern/148540; it has been noted by GNATS. From: "Andrey V. Elsukov" To: bug-followup@FreeBSD.org, Marcin Wisnicki , "Anton A. Barsukov" Cc: Luigi Rizzo Subject: Re: kern/148540: [geom] geom_sched breaks ata devices Date: Wed, 14 Jul 2010 16:50:57 +0400 This is a multi-part message in MIME format. --------------020306060809080006020605 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Hi, can you test attached patch? -- WBR, Andrey V. Elsukov --------------020306060809080006020605 Content-Type: text/plain; name="gsched.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gsched.diff" Index: g_sched.c =================================================================== --- g_sched.c (revision 209715) +++ g_sched.c (working copy) @@ -136,6 +136,8 @@ static void g_sched_dumpconf(struct sbuf *sb, cons 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,25 @@ 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; + int error; + + cp = LIST_FIRST(&pp->geom->consumer); + if (cp == NULL) + return (ENOIOCTL); + + gp = cp->provider->geom; + if (gp->ioctl == NULL) + return (ENOIOCTL); + error = gp->ioctl(cp->provider, cmd, data, fflag, td); + return(error); +} + /* * Read the i-th argument for a request, skipping the /dev/ * prefix if present. --------------020306060809080006020605--