> > The memory footprint is small. The cache footprint is actually increased.
>
> Yes, a bit.  But this is the way that device lookups are moving toward.
> Look at the block devices now, no more fixed arrays.  Character devices
> are next, and I'm trying to prepare for this.

Nothing a little hashing couldn't fix, if need be.

> > > I would like to publicly thank Kari for working with me over the past
> > > few weeks to implement this patch.  He has taken a crazy, half-baked
> > > idea of mine and turned it into working code.  Very nice job.
> >
> > Secondly, it takes the data structure away from the drivers but leaves
> > them with the locking. This really looks like a beautiful opportunity
> > to introduce full reference counting but fails to go the whole way.
>
> What would be reference counted?  The interface?

Yes. Either you have a private array, which will lead people to do
proper locking, or you have a function and reference counting.
But a function which returns a pointer to a memory area that
could go away is a recipe for desaster.
If you do that, the list accessing functions can have internal locking.
And you've caused a temptation. You have now a way to get at a driver's
interfaces without the driver's knowledge.

[..]
> > > - device major (USB_MAJOR for now) and minor are stored in probe()
> > >    function to struct usb_interface as kdev_t
> > > - open() can use new core function usb_find_interface() to find
> > > matching device in drivers device list
> > > - disconnect() will set kdev_t struct usb_interface to NODEV, so open
> > >   wont open it anymore without new probe()
> >
> > This should be encapsulated.
>
> Where, in the disconnect function?  That's easy enough.

Yes.

        Regards
                Oliver




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to