Subject: Re: Understanding foo_open, foo_read, etc.
To: None <tech-kern@NetBSD.org>
From: Peter Seebach <seebs@plethora.net>
List: tech-kern
Date: 08/29/2006 18:56:59
In message <F6546A7E-FAE9-4C54-8F02-71F2DF01E59C@shagadelic.org>, Jason Thorpe 
writes:
>On Aug 29, 2006, at 4:16 PM, Peter Seebach wrote:
>> I want to know whether I can do something more similar to the  
>> FreeBSD zaptel
>> code, and omit the fileops interface, and stick with vnode-style  
>> operations,
>> because that would be a lot easier to reconcile with the FreeBSD code.

>No.

>Use fdclone().  That's just how we do it in NetBSD (for now, anyway).

Okay.

At least this explains the mystery of why the NetBSD driver port rewrote the
prototypes for a dozen functions.

Hmm.  The port I have access to does something where it declares an array of
struct { file *fp; int unit, otherdata *info } objects that are populated
when files are opened, then scanned when a file needs to be accessed or
closed; I assume it'd be cleaner to store this data in the f_data member of
the struct file, and free it (if needed) on close?

-s