Re: Driver API (was Re: Linux GPL and binary module exception clause?)

viro
2003-12-11T13:34:24Z

On Thu, Dec 11, 2003 at 02:47:49PM +0200, Hannu Savolainen wrote:

> In a charcter driver all you need to know from the inode structure is
> basicly just the device (minor) number. It's not hard to implement the
> ABI layer so that the minor number can be provided regardless of the
> changes made to the kernel behind it.

Not good enough (if you want a demonstration, check USB character devices
and the nightmare stuff happening around handling of minor->object mapping
there).

Practically every place that uses minors instead of pointers to real objects
(whatever they are for that subsystem) is fscked as soon as you start dealing
with fun issues like hotplug, etc.

And then there is sysfs fun - my worst nightmare right now is that some
optimist will go ahead and put kobjects into sound/* objects. Then we
are guaranteed several months of massaging the lifetime rules of the
damn things to pure refcounting and doing that in the maze of twisty little
wrappers, all pointless, will be *ugly*. I'm getting more than enough of
that fun with netdev, thank you very much...

No, I don't know what changes will be needed in cdev interfaces; almost
certainly they will depend on subsystem and that's a work for 2.7. But
we will need something and "just use minors" won't do it.