Re: Migrating to larger numbers

Guest section DW (dwguest@win.tue.nl)
Sat, 29 May 1999 02:14:32 +0200 (MET DST)


> dev_t: 32 bits minimum, suggest 64 bits

> Recall that uid_t, gid_t and dev_t both have -1 (0xffff) reserved
> in a 16-bit environment;

This suggests a particular way of going to a larger dev_t.

I have been using (and am using a kernel like this right now):

static inline kdev_t to_kdev_t(dev_t dev)
{
int major, minor;

major = (dev >> 32);
if (!major) {
major = (dev >> 16);
if (!major) {
major = (dev >> 8);
minor = (dev & 0xff);
} else
minor = (dev & 0xffff);
} else
minor = (dev & 0xffffffff);

return MKDEV(major, minor);
}

I am not aware of any disadvantages of this system,
although, now that I think about it, the fact that
multiple representations yield the same (major,minor)
has both advantages and disadvantages.
So far I have not encountered real problems.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/