lkml.org 
[lkml]   [1997]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: dcache questions
> I decided I would try to handle the problem with aliases by not putting
> any dentries in the dcache for filenames that are aliases or for filenames
> that haven't been found. This way, there would only be one dentry per
> directory and file.

Any reason for not treating the short aliases as hard links?
Let's see: You would have hard links to directories, then, but I
think the dcache can handle this.
Also, you might want to delete other d_entries when you delete
an inode. This is tricky, as we don't have a list of all dentries
for a given inode. But see below.

> I can't even get the simplest case to work. I tried changing vfat_lookup()
> to not call d_add(dentry, NULL) when a filename is not found, but this
> causes the dcache to think there is a permanent error with this filename.
>
> Is there some way I can either get the dcache to not cache errors?

I see two approaches. One is the d_drop function, which removes a
given dentry (either negative or positive) from its parent.

The other approach is to use the d_revalidate operation. You define
this for all negative VFAT dentries (I hope one can define dentry
operations for negative dentries). Then, when asked to revalidate
the dentry, you check whether this is a short alias. In this case,
revalidation fails, and the system will try the real_lookup.

> Does someone have a suggestion of another way to handle these aliases?

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.

Hope this helps,
Martin

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