Re: dcache questions

Martin von Loewis (martin@mira.isdn.cs.tu-berlin.de)
Wed, 31 Dec 1997 10:55:48 +0100


> > - make the filesystem-specific hashing and name comparing functions
> > compare the two names as equal - so that only one dentry exists for
> > both of them. This is the "real" fix, but depending on how the name
> > mangling works it may not be all that easy.
>
> This really can't be reliably done via name-mangling, because the mangling
> is not only fairly complex but also nondeterministic (the ~1 can be a ~2
> depending on what else is in the directory, and when you get past ~9 you
> have to subtract another letter from the name fragment at the front).

I think it can be done reliably. Of course, you not only have to look
at the names themselves, but you also have to keep the association between
the names around, which you've learned when you first read the directory.

In the Linux dcache case, you'd have to cache the long name, and the
associated inode. In the inode, remember the short name which you
found when reading the directory. Wouldn't that work?

Regards,
Martin