Subject: Re: cache_*() case-insensitive searching
To: Bill Sommerfeld <>
From: Jaromir Dolecek <>
List: tech-kern
Date: 08/10/1999 12:11:49
Bill Sommerfeld wrote:
> cnp->cn_hash is computed in vfs_lookup.c from the pathname component:
> 	cnp->cn_hash = 0;
> 	for (cp = cnp->cn_nameptr; *cp != '\0' && *cp != '/'; cp++)
> 		cnp->cn_hash += (unsigned char)*cp;

Is there any reason why this is not done in vfs_cache:cache_lookup()
right before the value is actually used ?

There seem to be some situations when the hash value is not used (such
as when the name is too long), so it would actually make more sense
to count it just-in-time. And it would ease the implementation of the
case-insensitive searching (there would be just one place to worry about,
with no side effects).