On 21 May 2000, Love wrote:
> We check for d_count to decide if we are the sole owner of a dentry
> and if it's available to throw away. How are we supposed to throw
> away a dentry? Today we do:
>
> if (dentry->d_count == 0) {
> dget(dentry);
> d_drop(dentry);
> dput(dentry);
> /* ... */
> }
For all aliases of inode? Will be available as a standard function and
exported. Probable name: d_prune_aliases() (i.e. named so in the patches
submitted to Linus).
> > b) ->d_delete() becoming non-blocking.
>
> Safe on that (we do not do anything in d_delete).
See #if 0'd code in xfs_d_delete(). Natural place for that animal:
->d_iput().
> > d) same spinlock covering the beginning of dput() - up to the point where
> > dentry is excluded from the lists or left alone.
>
> It's not really clear to us what you mean. Should we grab the
> spinlock (that we assume will appear in `struct dentry') around the
> call to dput?
Not. Internal business of dcache.c
> > e) code that walks ->d_alias/->i_dentry or ->d_subdirs/->d_child moves to
> > VFS proper. Each of these pieces should go under the spinlock and end
> > with
> > dget(). This code should skip unhashed dentries.
>
> We do walking of the lists to invalidate all lower (d_subdirs)
> dentries when a directory is invalidated.
Yes, seen that. It's bogus - if you have a non-directory you have no
children, if it's a directory - there is only one alias and
shrink_dcache_parent() will do quite fine.
> > f) _all_ places that check for ->d_count should be either exterminated or
> > get an attempt to unhash in front of them. The only valid checks being
> > "are we the sole owners of dentry".
>
> This is not really clear either. Do you mean that code that checks
> dentries (and isn't sole owner test) should unhash, check d_count and
> then rehash ?
As soon as you rehash you are running into the risk of becoming _not_ the
sole owner. Even with the current tree. AFAICS arla doesn't contain
anything terrible in that respect, though.
> We walk the lists when a node is invalidated (above case). We also
> walk d_alias to find if this name in the dentry tree is already
> installed, or if we should install a new dentry.
d_find_alias();
> We are sure that our code will break, and we're happy that you tell us
> what the plan was before doing it. Thanks.
Not for all. BTW, I'ld really like to see your current code - my comments
are based on looking at the 0.33. Is anoncvs available?