tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mjf-devfs2 branch



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Mar 31, 2008 at 10:26:06AM -0700, Bill Stouder-Studenmund wrote:
> On Sat, Mar 29, 2008 at 04:35:31PM +0000, Matt Fleming wrote:
> > Now, for device driver conversion. I've provided an API that device drivers
> > can use when they need device nodes,
> > 
> > int device_register_name(dev_t, device_t, boolean_t, enum devtype, 
> >     const char *, ...);
> 
> You need to add something to indicate if the dev_t is a character or block 
> dev_t.
> 

That's what the boolean_t is for, "are we a char device?".

> > 'devtype' specifies the type of device which will be used for matching 
> > rules.
> > See sys/sys/conf.h for details.
> > 
> > int device_unregister_name(dev_t, const char *, ...);
> > 
> > We maintain a TAILQ of structs which is appended with the register function
> > and has entries removed with the unregister function. When a new struct is
> > added to this queue dctl(4) creates a message and places it on an internal
> > queue which is picked up by devfsd(8).
> 
> Ok, while I can see the need for an unregister_name(), I think what you
> really want is device_unregister_all(dev_t, is_block) which zapps
> everything for that device.
> 
> Saves snprintf()s in detatch. :-)
> 
> Actually, if you pass in the device_t, just have 
> device_unregister(device_t) and blow away anything keyed to that device.
> 

That's a good point. Device names aren't going to be detached unless they
have a device_t. Though perhaps LKMs may not be backed by a device_t but
still may need their device node removed? I can't think of one off the
top of my head, but I'm sure someone can ;-)

device_unregister_all() however, is a winner. I'll add that func.

- --mjf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (NetBSD)

iQEcBAEBAgAGBQJH8TQMAAoJEK3y1f69VxYbB7UIALWBXw3d0oztu2JYb0uGXehb
DivlIOKZHn+khhfyR9SvcLURjzScxVja7rp/bgYuajxyREMm2xnrgj07BC25sMTU
WKWrDVPZhkgWxTc3h8h1Flnc9AA4CjrD8g8NUzt6ptmFdebjXUygirQ3pThgYW9+
6ntI0UAWNe8bHqjcZ3sKI4MWzLngn7fGvXVMIsmB2w2XcJgv6JCUdERKFI1rmaBD
7klEBXNOhK1AN9paBnZUrQyVuAp1cgkz+8++kvd3DQ8I5mREgMCX4MXuikNwTquo
UVvI1rKpcTwH8/snCCMSE/OInCRv7eiqV6ciZ2QZ507R+dDJPTIrFbb143FN7OA=
=J6j+
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index