lkml.org 
[lkml]   [1997]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: dcache questions
Martin von Loewis wrote:

> Here, the logic for detecting short names seems flawed. It is certainly
> possible to do
>
> touch foobar~1
>
> without having a corresponding long name. Also, I believe VFAT chooses
> another character when it runs out of last characters.

I think this case can still be handled in the same way. Since the name
looks like a possible short alias, you do a disk search, and if that
fails go ahead and create the dentry for foobar~1 (it is a legal
filename, after all). Then when the file is created on disk, the long
and short names will be the same.

The only additional work required is that when creating a long filename
and assigning it a unique short name, you have to do a dentry lookup to
be sure the short name doesn't already exist as a dentry.

> Furthermore, how do you handle negative lookups? It will go to the
> dcache, take the first cached name, compare them. This will read the
> directory, detect that the name is not there, and fail the compare
> operation. Then it goes to the next cached name, and reads the
> directory again. I don't think *this* performance loss is acceptable.

I don't think this situation is quite as bad as you indicate. Before
doing a comparison, the hash codes still have to match, and if the
filenames are different in their leading characters there's no need to
check the disk. Beyond that, the directory contents can always be cached
in the conventional manner if it proves to be too slow.

Also, I maintain that if the dentries are always constructed using the
long filenames, most software will make use of the the long pathnames,
and lookups involving short aliases will be rare.

Since this whole issue has turned out to be so complicated, I think we
should focus first on helping Gordon find a correct solution. There are
always ways to speed things up if it proves to be a problem.

Regards,
Bill

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.719 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site