Messages in this thread | | | Date | Fri, 26 Nov 1999 14:32:48 -0700 | From | Richard Gooch <> | Subject | Re: Request for comments (kdev_t and friends...) |
| |
Oliver Xymoron writes: > 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.
I'm not saying the extra lookup is going to make all the difference in the world. However:
- one less lookup is always going to be faster
- devfs is cleaner (which is what matters more to me)
- why have an extra lookup when there is a simpler, cleaner method?
Regards,
Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca
- 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/
| |