roland writes:
> points (assuming this is still true, I've yet to see a case where it

I think I've found an easy way to see if the odd/even trick ever fails,
and an explanation (of sorts) as to why it works.

The AFS include file <afs/vnode.h> includes several macros,
including:
        vnodeIsDirectory(vnode)
which returns 1 if a vnode number is a directory.  The logic
that implements this macro is in fact looking for even/odd
(not that you can tell just by glancing).  The inode # is already
well known to be just the vnode number + the volume ID << 16.
This trick is done by the cache manager (I am not sure, off-hand,
if this is done in the NT port of AFS.  I suppose NT must have
inode numbers, but are they visible at the application API layer?)

Presumably, if the logic for the macro in <afs/vnode.h> ever changes,
then that will be a sign that the underlying trick may no longer
be valid.  I'm not sure the cache manager has any special knowledge of
vnode numbers, but it does look to me like this dependency (vnodeIsDirectory)
is built into the data stored on the disk in the fileserver, so changing
this looks likely to require rebuilding every volume on every fileserver
(as well as obviously replacing volserver, salvager, & fileserver).
Somehow, I just don't think that's very likely...

                                -Marcus Watts
                                UM ITD PD&D Umich Systems Group

Reply via email to