From owner-cvs-src@FreeBSD.ORG Mon Oct 10 10:10:49 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B03316A41F; Mon, 10 Oct 2005 10:10:49 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF7CE43D46; Mon, 10 Oct 2005 10:10:45 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 5FF1450D1C; Mon, 10 Oct 2005 12:10:34 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 7A3F050B1C; Mon, 10 Oct 2005 12:10:19 +0200 (CEST) Date: Mon, 10 Oct 2005 12:10:13 +0200 From: Pawel Jakub Dawidek To: S?ren Schmidt Message-ID: <20051010101013.GB3975@garage.freebsd.pl> References: <200510092111.j99LB5gN037609@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: Peter Edwards , cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/ata atapi-cd.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 10:10:49 -0000 --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 10, 2005 at 11:06:49AM +0200, S?ren Schmidt wrote: +> On 09/10/2005, at 23:11, Peter Edwards wrote: +>=20 +> Why did you ask me to review this when you just committed it anyway ? +>=20 +> As I said I'm not sure this is the right way to fix this.. It seems to be right. I do it in my GEOM classes to handle g_clone_bio() failures better. So the only objection I may have is that it could be done a bit cleaner: struct bio_queue_head queue; u_int pos, size =3D cdp->iomax - cdp->iomax % bp->bio_to->sectorsize; struct bio *cbp; for (pos =3D 0; pos < bp->bio_length; pos +=3D size) { cbp =3D g_clone_bio(bp); if (cbp =3D=3D NULL) { for (cbp =3D bioq_first(&queue); cbp !=3D NULL; cbp =3D bioq_first(&queue)) { bioq_remove(&queue, cbp); g_destroy_bio(cbp); } if (bp->bio_error =3D=3D 0) bp->bio_error =3D ENOMEM; g_io_deliver(bp, bp->bio_error); return; } bioq_insert_tail(&queue, cbp); cbp->bio_done =3D g_std_done; cbp->bio_to =3D bp->bio_to; cbp->bio_offset +=3D pos; cbp->bio_data +=3D pos;=20 cbp->bio_length =3D MIN(size, bp->bio_length - pos); cbp->bio_pblkno =3D cbp->bio_offset / cbp->bio_to->sectorsize; } while ((cbp =3D bioq_first(&queue)) !=3D NULL) { bioq_remove(&queue, cbp); acd_strategy(cbp); } --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDSj4FForvXbEpPzQRAhU5AKD2QkXFz7EASDy3BiBqwAc7w/HNcQCfWsei aVxAznZMJvsiQSUum+qfUw0= =NxXt -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR--