Re: dcache questions

Gordon Chaffee (chaffee@CS.Berkeley.EDU)
Tue, 30 Dec 1997 22:44:54 -0800 (PST)


David C Niemi writes:
> I would suggest that the all-long-name version of the path be used as the
> "official" path which would be returned when doing the reverse
> (dentry->path) lookup, even for lookups done on paths including ugly
> short-name components. This means that the same path, if looked up in
> reverse, might not have a dentry yet (unless the all-long-file-name dentry
> is always created in addition). And d_add would have to support adding a
> dentry for which the hash is taken of a different name from the one it is
> adding. More complexity, but probably very important in the long run -- for
> example, it is probably needed to support NTFS well in the future.

Since d_ops->d_hash can be overridden, this is exactly what I am in
the process of doing for hashes. When a name gets hashed, a lookup is
done on the name if it is not found in the dcache. Short aliases will
always need to be looked up. While doing the lookup, I retrieve the
longname. I add the longname to the dcache, and I set the hash of the
string to be the hash of the longname.

This does mean that shortname lookups will be slow, but at least they
should always give the correct results. Lookups with longnames should
be quick.

- Gordon