Re: UTF-8 and case-insensitivity

Jamie Lokier
2004-02-19T08:10:37Z

Linus Torvalds wrote:
> > > Why do you focus on linear directory scans?
> >
> > Because a large number of file operations are on filenames that don't
> > exist. I have to *prove* they don't exist.
>
> And you only need to do that ONCE per name.
>
> There is zero reason to do it over and over again, and there is zero
> reason to push case insensitivity deep into the filesystem.

Linus, while I agree with you wholeheartedly on everything else in
this thread - how can Samba only do that lookup ONCE per name if a
client is issuing many requests for non-existent opens or stats?

Example: A client has a search path for executables or libraries.

Each time SomeThing.DLL is looked up by the client, it will issue an
open() for each entry in the path, until it finds the file it wants.

For each request, Samba must readdir() every directory in the path
until the file is found.

If a directory doesn't change between requests, Samba can use dnotify
to cache the negative lookups.

However, if any change occurs in a directory, or if the directory is
not dnotify-capable, Samba is not allowed to cache these negative
results: It has to do the readdir() for _every_ request.

-- Jamie