Subject: Re: cache_*() case-insensitive searching
To: Jaromir Dolecek <>
From: Bill Sommerfeld <>
List: tech-kern
Date: 08/08/1999 08:29:47
> > Also, cache_lookup uses a hash table; it's somewhat hard to fold a
> > case-insensitive string compare into that as you'd be looking in the
> > wrong hash bucket most of the time.
> If I rean the code correctly, the hash is over the directory vnode
> capability number, so that it shouldn't affect case-[in]sensitivness
> of the search.


The hash bucket is selected via:

	ncpp = &nchashtbl[(cnp->cn_hash ^ dvp->v_id) & nchash];

(see vfs_cache.c)

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;

> Monocase fs in tree is filecorefs only, right ?

Not the only one; for example, the MS-DOS filesystem without the win95
extensions for long filenames is case-insensitive..

					- Bill