Re: Request for comments (kdev_t and friends...)

Oliver Xymoron (oxymoron@waste.org)
Fri, 26 Nov 1999 15:28:37 -0600 (CST)


On Fri, 26 Nov 1999, Richard Gooch wrote:

> Oliver Xymoron writes:
> > In fact, we should add at least a void *private so that devices can
> > be freed of managing their instance data with static arrays indexed
> > off minor number.
>
> With devfs this is really clean. A driver can allocate an instance
> structure at probe time, and pass the pointer to devfs_register().
> When the device node is opened, file->private_data is initialised with
> that pointer. So the driver open() method already has a handle to the
> device instance structure, without any lookups being required.

That part of the scheme is good, but I'm still not convinced the lookup is
a big deal. To open a file, you still end up doing a lookup that matches
name to device (ie a dentry hash lookup). There's no reason opening a
device couldn't use a similarly fast (or even identical!) method without
requiring that the /dev dir be managed inside the kernel. In fact, I think
I earlier suggested it's possible to cache the lookup in the inode.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/