Subject: Re: Write a translating FS layer instead (Was: Re: Mount option to
To: Ignatios Souvatzis <ignatios@theory.cs.uni-bonn.de>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 04/03/2002 08:42:34
On Wed, 3 Apr 2002, Ignatios Souvatzis wrote:

> Now - what seems to be the right thing to me - certainly the right
> intermediate solution until a "right" method of associating a character
> encoding with a file name space has been defined - is to write a small
> intermediate layer to do the mapping you want. Then mount it on top of
> your Unixoid file system.

I see two problems with this. The first is we still have all of the
problems we were talking about; they are questions about what characters
are equivalent, not if the test is in the file system. :-)

The second problem is that, while we could do this, it would probably be
slow. The only way I can see doing it is: when we get a VOP_LOOKUP() call,
we read in the whole directory (VOP_READDIR()) and scan it for our desired
name. Then we do a VOP_LOOKUP() on the lower layer with the real name. ;-)

We would probably want to cache that directory (or at least the names),
and then we'd need to add support in all of the directory-changing
operations to update the cache.

> The backside would be that the result would not be case preserving, but
> I suspect we can live with that. Actually, I suspect it is even possible
> to write it case preserving with not much more effort.

Actually I think case preserving drops out. As long as the name that gets
handed to VOP_CREATE() has the same case as the original system call did,
we preserve case. So as long as we leave the name alone, I think we're
fine. :-)

Take care,

Bill