Re: [PATCH] print_dev_t for 2.6.0-test1-mm

Andries Brouwer
2003-07-16T22:10:16Z

On Wed, Jul 16, 2003 at 02:39:02PM -0700, Andrew Morton wrote:
> Andries Brouwer <aebr@win.tue.nl> wrote:
> >
> > On Wed, Jul 16, 2003 at 02:13:20PM -0700, Andrew Morton wrote:
> >
> > > The new dev_t encoding is a bit weird because we of course continue to
> > > support the old 8:8 encoding. I think the rule is: "if the top 32-bits are
> > > zero, it is 8:8, otherwise 32:32". We can express this nicely with
> > > "%u:%u".
> >
> > 16-bit only: 8:8, otherwise 32-bit only: 16:16, otherwise 32:32.

> Why do we need the 16:16 option?

It is not very important, but major 0 is reserved, so if userspace
(or a filesystem) hands us a 32-bit device number, we have to
split that in some way, not 0+32. Life is easiest with 16+16.
(Now the major is nonzero, otherwise we had 8+8.)
Other choices lead to slightly more complicated code.

Andries