Messages in this thread |  | | Date | Thu, 4 Jul 1996 11:30:08 +0300 (EET DST) | From | Linus Torvalds <> | Subject | Re: SCSI device numbering (was: Re: Ideas for v2.1 |
| |
Theodore Ts'o (tytso@mit.edu) wrote: > > Stephen and I have been planning to add an 128-bit universally unique ID > (UUID) in the ext2 superblock to help automate this process. It's also > useful for his "supermount" for detecting when a removeable disk has > really been changed. > > How do you generally a globally unique UUID? Simple. Generate a 128 > bit UUID as follows: > > 32 bits tv_sec of volume creation > 32 bits tv_usec of volume creation > 32 bits IP address of host which created the volume, > or a random number if not available > 32 bits random number
Minor nit: instead of using tv_usec, use tv_nsec. The "tv_usec" fields are slowly being obsoleted by various POSIX functions, it seems, and I suspect we're going to move to "struct timespec" as the main time structure in the not too distant future.. We already can get better than usec resolution for the clock on some hardware (resolution != precision, though ;-), so...
(resolution != precision is actually only for the best in this case, we just have more random bits ;-)
Linus
|  |