Subject: Vnode access from devices
To: None <tech-kern@NetBSD.ORG>
From: Robert Black <r.black@ic.ac.uk>
List: tech-kern
Date: 01/23/1998 11:57:55
I have a device which needs access to a vnode pointer pointing to itself within
an ioctl(). As far as I can tell the best way to get this is by searching the
proc structure's open fds for a VCHR vnode with the right major and minor. It
occurs to me that someone may already have written such a routine or there
maybe good reasons why I shouldn't do this. Note that it doesn't have to be the
same vp as the one the ioctl call came from provided that its lifetime is at
least the duration of the ioctl. As I can enforce this by upping the reference
count I don't see this as being a problem. I did consider creating a special
vnode specifically for the purpose but at first glance that looks far too
hairy.

Any comments?

Cheers

Rob Black