From owner-freebsd-hackers Mon Feb 23 17:12:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA06437 for freebsd-hackers-outgoing; Mon, 23 Feb 1998 17:12:09 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA06389 for ; Mon, 23 Feb 1998 17:12:01 -0800 (PST) (envelope-from grog@lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.8.7/8.8.5) with ESMTP id LAA08911; Tue, 24 Feb 1998 11:41:49 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id LAA13631; Tue, 24 Feb 1998 11:41:48 +1030 (CST) (envelope-from grog) Message-ID: <19980224114148.26366@freebie.lemis.com> Date: Tue, 24 Feb 1998 11:41:48 +1030 From: Greg Lehey To: Mike Smith Cc: "Justin T. Gibbs" , hackers@FreeBSD.ORG Subject: Re: New SoftUpdates test kit References: <19980224112304.63148@freebie.lemis.com> <199802240102.RAA13122@dingo.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <199802240102.RAA13122@dingo.cdrom.com>; from Mike Smith on Mon, Feb 23, 1998 at 05:02:07PM -0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 23 February 1998 at 17:02:07 -0800, Mike Smith wrote: >> Wouldn't it make more sense to pass around an extended buf structure, >> as ccd and vinum do? Put the buf at the start, and you can pass it to >> all the routines that normally hand buf structures: > > No. You can't do this in a device driver - you're handed a buf by > someone else, and you give it back when you're done. Ah, yes, I'd forgotten the normal case :-) I need to allocate my own, because one high-level request can potentially spawn many low-level requests. > The problem is that the connection (in the wfd driver) between being > given the buf and handing it back involves passing the buf pointer to > someone else. > > To do this with a wrapper as you propose would involve copying the buf > into the wrapper and then out again. Bleagh. And you'd still have to > manage memory for the wrappers. Bleagh again. Right. In my case, of course, I'm forced to allocate new struct buf *s. Fortunately, since any transfer involves a contiguous fraction of the original request, I can just set bp->b_data to point into the b_data of the original buf, so the copying is of relatively small quantities. > The real killer is that there's no universal fragmenting layer sitting > on top of device drivers. Another mark for the SLICE stuff. Yup, when I have the first cut finished, I'll take a look at that. Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message