lkml.org 
[lkml]   [1999]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Migrating to larger numbers

> 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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.029 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site