Subject: Re: cache_*() case-insensitive searching
To: None <firstname.lastname@example.org, email@example.com,>
From: Ignatios Souvatzis <firstname.lastname@example.org>
Date: 08/10/1999 13:11:26
On Tue, Aug 10, 1999 at 12:58:08PM +0300, Jaromir Dolecek wrote:
> Ignatios Souvatzis wrote:
> > You can't do this (case-insensitiveness) file system independent.
> Yeah, I know. I'm not talking about making the search FS-I,
> just thinking about how to provide a way for fs's code
> to do case-independant search in the cache.
> The problem is, that the hash value is counted before the fs code is
> able to touch the name to be searched for. If the name passed
> to lookup() is not the same as the the canonified one, we end up
> looking into wrong hash bucket in cache_lookup() and it's very
> likely the entry won't be found.
> If we would leave the counting of cnp->cn_hash in lookup() (as it's
> currently), we have to provide a hook for fs code
> to supply "canonified" name for the name we are currently doing
> the lookup for or the fs code would be forced to recount
> the hash value before calling cache_lookup(). I like neither of
> those two possibilities.
> If the hash value would be counted in cache_lookup() directly,
> fs code can do whatever it wants to canonify the filename
> and the hash value would be counted for the right name. Furthermore,
> the hash will be counted only when it would actually be used -- not
> such a bit optimization, but every bit counts :)
I am not familiar with the code you're proposing to change...
you sure what you want to do works for filesystems that are
- case insensitive but
- case preserving?
(that is, you need to store the original data on the disk, and provide them
to the reader, but use the canonicalized for searching operations).
(ADOSfs and OS-9 come to my mind.)
* Progress (n.): The process through which Usenet has evolved from
smart people in front of dumb terminals to dumb people in front of
smart terminals. -- email@example.com (obscurity)