tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Case insensitive FFS



> My naive idea is that changing ufs_lookup() and the hash functions in
> the UFS_DIRHASH case to treat upper case letters like lower case
> letter (or vice versa).

One of the biggest problems here is that this would be switching from a
filesystem that uses strings of octets to name files to a filesystem
that uses strings of characters.  As it stands, FFS has two reserved
octet values (0x00 and 0x2f) and is completely charset-blind for the
other 254 octets.  If you want to case-fold anywhere, you'd have to
pick a charset, and then decide what to do with pathname components
that don't conform to that charset - and you have two sources of
pathname components to deal with, components coming up from the disk
and components coming down from the generic filesystem code and the
APIs above that.

Not that this is impossible, of course.  Just pointing out that it's
not quite as simple as you make it sound.  (Personally, I'd prefer to
make the kernel use a mapping table provided by userland at mount time,
so the kernel code is still mostly charset-agnostic.  Not completely,
since it would work only for one-octet charsets (no UTF8, for example),
but mostly.)

It occurs ot me that this might be better done as a stackable
filesystem layer which could be mounted above any underlying
filesystem, not just FFS - in particular, this could let you get the
case semantics you want out of FFS, NFS, LFS, etc, without needing to
hack on each of them.

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index