Michael Ju. Tokarev
mjt at tls.msk.ru
Wed Nov 8 23:28:47 GMT 2000
Jeremy Allison wrote:
> Kenichi Okuyama wrote:
> > Don't "CREATE" world, "SEARCH"! Are you trying to search entire
> > 2^19 patterns if you got filename like "/AN.UPPERCASE.FILE.PATH" ??
> > And find out that there's no such file?
> Ah - now I understand what you think we're doing. Take
> heart - we're *NOT* doing that. We do exactly what you
> suggest, which is to scan the directory and cache the
> relevent mappings to a case-insensitive version of the
> names within it.
> The stat is done to check if the mapping is still valid.
And so what -- why things can't looks like this:
win client calls e.g. open(file) =>
lookup file in statcache _without_ extra stat
open() found entry
remove it from cache if open fails
But not like this:
lookup, stat, and remove in one place
Statcache isn't a "true object" now (sorry me for OOP thing).
It should be either just an in-memory cache without any disk/fs
access (i.e. to store just opaque things), or it should provide
full "filesystem layer" with open/creat/readdir/etc interfaces.
In first case, someone else should check if cache info is vaild.
In the second, cache itself will use correct routine (e.g. open)
to do so -- not an "abstract" stat(), but the routine that
will be called by caller (funny wording) that made statchache
search call. Another variant is to pass some "callback" to
stat cache (another mess but still) to use instead of stat,
so that statcache will return not the name but a result from
that callback -- i.e. opened filedescriptor.
More information about the samba-technical