Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2003 00:53:28 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Craig Reyenga <creyenga@connectmail.carleton.ca>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: What about a case insensitive Filesystem?
Message-ID:  <3E33A208.5ED9A35B@mindspring.com>
References:  <001101c2c4e4$51686960$0200000a@sewer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Reyenga wrote:
> <begin potentially dumb question>
> Is there any way, either now or in the future, for FreeBSD to be able to
> have a UFS-based case-insensitive filesystem? It would be great for many
> applications, such as Samba servers, web servers catered to the general
> public (angelfire, geocities) and places where the user just doesn't care.
> Is this at all possible?
> <end potentially dumb question>
> 
> (I'm not on the list, so CC'ing would be great)

Where do you mean case insensitive?  Storage?  Lookup?  Iteration?

In general, what people mean when they say this is "case sensistive
on storage and iteration (for display), but case insensistive on
lookup".

The short answer is "it's possible: go ahead and write the code".

The longer answer is "it's possible, but it's not something you
really want to do, unless you are willing to move globbing into
the kernel".  This is because, on lookup, you want to effectively
turn each character into a wildcard based on case insensitivity.
This is relatively easy for US ASCII, where if the character is
in the right range, you AND off a bit, and treat everything that
way.  Thus it's better if you do this as if you were doing a
globbing operation, rather than the way UNIX expects you to do it.

The other issue that wants globbing in the kernel is when you have
a lookup for a particular purpose; in general, there are three
types of lookup:

1)	Lookup of existing entry for file operation (stat, open,
	etc.).

2)	Lookup of existing entry for directory entry creation
	operation (create, link larget, etc.).

3)	Lookup of existing entry for directory entry deletion
	operation (rename, unlink, etc.).

This doesn't seem iportant, until you have two files in a directory,
e.g. "start" and "Stop", and you try one of:

	mv Start stop
	mv Start start
	mv Stop Stop
	rm st*
	...

See the point?  The globbing, particularly in the "rm" case has to
be moved into the kernel.

The alternative to this is to add globbing to each and every shell
out there, and hope to God that it's implemented the same way in
all of them.  This is because in UNIX systems, the globbing is
expanded before being passed accross the system call boundary.

The main problem with doing this is that it, effectively, then
assumes that the underlying FS *must* be case insensitive on
lookup.  Specifically:

	ls > Start
	ls > start

Can never end up with two files, because the shell would find the
first file when looking up the redirect target for the second
command, and dump to it anyway.

This also has a problem with files which *already* exist on an
FS, on which such a shell is then used, e.g.:

	ls -i
	136 Start
	137 start
	cat sTart
	...

Therefore doing this in the shell is unacceptable from many, many
perspectives.., not the least of which is the fact that you can't
have case insensitivity be an attribute of the underlying FS, it
is instead an attribute of the shell.

FWIW, if this doesn't make a lot of sense to you, but you are
willing to hack up a shell to try it out, you will quickly see
what I mean.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E33A208.5ED9A35B>