User: Password:
Subscribe / Log in / New account

The kernel and character set encodings

The kernel and character set encodings

Posted Feb 21, 2004 21:14 UTC (Sat) by fiberbit (subscriber, #693)
In reply to: The kernel and character set encodings by spitzak
Parent article: The kernel and character set encodings

The problem lies in the checking whether or not a file with a given name (case insensitive) exists. Say you do an 'fp = fopen("filename", "a"), and "filename" doesn't exist yet, then in the case-insensitive case, you have to check whether "Filename" or "fIlename" or any other variant *does* exist.
You'd either have to try all possible combinations, or (in practice) scan the whole directory to see if any name matches (and use the first). This not only is very time consuming, but also racy in a multi process environment.
It could be solved by using case-insensitive hash functions in the dentry cache, but that would negatively impact normal filesystems, and is unacceptable to most, including the top penguin.

(Log in to post comments)

Re-mount Through Caseless VFS?

Posted Feb 23, 2004 0:37 UTC (Mon) by miallen (guest, #10195) [Link]

Why not just create a "casefs" VFS that just uses the existing ops for the target mounted fs but overloads lookup() to do the caseless pathwalk (and maybe save the last N paths with hashes in a separate cache)? Now you would just (re)mount an existing fs through this casefs VFS. It wouldn't be optimal but it would still be a lot faster for Samba, WINE, or whoever and it wouldn't barf all over any other kernel code. It's probably not a lot of code either.


Re-mount Through Caseless VFS?

Posted Feb 23, 2004 7:40 UTC (Mon) by massimiliano (subscriber, #3048) [Link]

I am definitely not a kernel developer, but this sounds like
the perfect solution: very general, and perfectly decoupled
from the code of existing filesystems... and moreover, you pay
the performance penalty only if you use the feature.

As an added benefit, it could be implemented entirely in user
space using FUSE, and only if/when it works very well (and the
added performance is needed) as a kernel module.

With such a layer, it would also be possible to handle all those
nasty Unicode normalizations...

Just my two cents, anyway.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds