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

> > Maybe you can extend the d_compare operation instead. When searching a
> > name, the dcache will first compare the name to each existing dentry.
> > So when searching a short name, it would search for the long name.
> > vfat_cmp would not only check for dots in the back, but also check
> > whether the short name is an alias for the long name, in which case
> > vfat_cmp would succeed.
> >
> > The dcache will then conclude that it found the right dentry, and not
> > try to create another one. In order to make this work, you will also
> > have to instantiate the long name when asked for the short one.
>
> This seems like the best suggestion, and I've done some work to try to
> implement it. I need to extend both d_hash and d_compare because d_compare
> will not get called unless the hash value is the same. I'll see if any
> additional problems arise.

After reading through this thread it seems to me that the key to making
vfat work efficiently is to make sure that only the long filenames are
ever instantiated as dentries. This can be done by looking up the short
names in the d_compare operation, and if necessary creating the
associated long filename dentry. Since a short filename can be detected
by the presence of the ~ character, it shouldn't be necessary to do a
disk lookup for long names, so this operation would remain fast.

To make sure you're not creating multiple dentries for the same file, it
would probably be helpful to test i_count when you instantiate a dentry,
and print a warning if the count is > 1.

I don't see the need for a dentry d_validate operation, as vfat fs is
directly controlling the disk. There should never be a case where the
dcache is out of sync with the disk -- assuming that you've enforced the
uniqueness of the dentries with the d_compare operation, the dentries
will always be valid.

Regards,
Bill

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