Subject: Re: Understanding foo_open, foo_read, etc.
To: None <>
From: Peter Seebach <>
List: tech-kern
Date: 08/29/2006 18:56:59
In message <>, Jason Thorpe 
>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.


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


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?