tech-kern archive

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

Re: mjf-devfs2 branch

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
Version: GnuPG v1.4.8 (NetBSD)


Home | Main Index | Thread Index | Old Index