Re: devlinks: an alternative to devfs

Martin von Loewis (martin@mira.isdn.cs.tu-berlin.de)
Fri, 9 Jan 1998 09:30:24 +0100


> Excuse my ignorance (I know that sure I am missing something), but why
> don' t change in /usr/src/linux/include/linux/kdev_t.h from:
>
> typedef unsigned short kdev_t;
>
> to:
>
> typedef unsigned int kdev_t;
>
> and we will have magically space for 16 bit minor and major numbers. Then
> we need to change MINORBITS to 16 and all others 8 to 16...

Several reasons. For one, ext2 is not capable of storing 32 bit device
numbers, at least not in the current definition of ext2. So you need
to extend ext2.

Furthermore, the system calls (most notable stat(2) and mknod(2) are
not capable of passing 32 bits as device number, so you need new system
calls.

Next, the C library does not provide structure definitions for those
system calls, nor does it call them. So you need a new C library.

Finally, the applications allocating those structures on the stack
don't know that the structure size changed. So you need to recompile all
your applications.

For the last part, there has been an acceptable work-around for a
couple of years, so you don't have to recompile all your applications
- only when they try to stat(2) files with majors >256, they'll run
into problems. For the other items, there have been proposed
work-arounds, but no steps have been taken. Since this is a major
change, people discuss using 64 bits for dev_t, to get it right in the
long run. Unfortunately, this further complicates things, as some of
the proposed solutions won't work anymore.

Hope this clears it up.

Martin