Subject: Re: [netatalk-admins] DIDs - an idea -or- I didn't read the AFP specs completely yet

From: "Donald L. Nash" <[email-masked]>
Date: Wed, 15 Apr 1998 17:08:40 -0500

--On Wed, Apr 15, 1998 4:45 PM -0500 "Gary E. Bickford" <[email-masked]>
wrote: 

>    gettimeofday((struct timeval *)&tv, (struct timezone *)NULL);
>     sec = (int)tv.tv_sec;
>     usec = (int)(tv.tv_usec % 1000000);
> 
>     /* The max value usec can have is 0xF423F, so we use only five hex
>      * digits for usecs:
>      */
>     sprintf(uniqid, "%s%08x%05x", prefix, sec, usec);
>     Push(uniqid, STRING);

This won't work and cannot easily be made to work because DIDs are only 32
bits long.  I looked into using inode numbers combined with major and minor
device numbers to create an inode-based DID that worked for volumes which
span filesystems, but had to give up on it because inode numbers are 24 bits
long and major and minor device numbers are each 8 bits long.  I couldn't
figure out a way to cram 40 bits into 32 without the possibility of
collision. :-)

The directory/.DID and volume/.DIDdb ideas sound the best so far.

-- 
Donald L. Nash, <[email-masked]>, PGP Key ID: 0x689DA021
The University of Texas System Office of Telecommunication Services
PGP Key Fingerprint: D6D2 CBEE 8F56 60B2  736C 031A A1E0 AF3D

---

From: "Gary E. Bickford" <[email-masked]>
Date: Wed, 15 Apr 1998 19:03:14 -0500

>figure out a way to cram 40 bits into 32 without the possibility of

Yeah, I didn't work out the details (mainly 'cause I don't know whereof I
speak :) - but your last point reminds me of gray coding, which does just
that, and the result is always unique, though not sequential.  I forget how
it works...

GEB

---

From: Sak Wathanasin <[email-masked]>
Date: Thu, 16 Apr 1998 23:30:38 +0100

In reply to Gary E. Bickford's message of the 15/04/98 at 19:03 -0500,

> that, and the result is always unique, though not sequential.  I forget how

Isn't there a more basic problem than craming 40 bits into 32? inodes get
reallocated, don't they? What happens when you delete a directory and create a
new one straight away?

Sak Wathanasin
Network Analysis Limited
178 Wainbody Ave South, Coventry CV3 6BX, UK

Internet: [email-masked]
Phone: (+44) 1203 419996                    Fax: (+44) 1203 690690