Re: LANANA: To Pending Device Number Registrants

Ingo Oeser
2001-05-15T18:12:27Z

On Tue, May 15, 2001 at 08:10:29AM -0700, Linus Torvalds wrote:
> That said:
>
> > /* Use scsi if possible [scsi, ide-scsi, usb-scsi, ...] */
> > if(HAS_FEATURE_SET(fd, "scsi-tape"))
> > ...
> > else if(HAS_FEATURE_SET(fd, "floppy-tape"))
> > ..
>
> doesn't look horrible,

That is good and the thing other OS do since years. The call it
"DEVCAPS" or "device capabilities". They use bitmasks for this
(which might not be perfect).

> and I don't see why we couldn't expose the "driver
> name" for any file descriptor.

Because we dont like to replace:

if (st.device == MAJOR_1)
bla
else if ...

with

if (!strcmp(st.device,"driver_1") )
bla
else if ...

?

There is no win doing it this way, because every time we add a
new driver that fits or change the name of one, we need add
support for it.

But the device majors are not needed for this, that's true ;-)

Regards

Ingo Oeser
--
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
<<<<<<<<<<<< been there and had much fun >>>>>>>>>>>>