public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Sage Weil <sage@newdream.net>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk,
	ceph-devel@vger.kernel.org, rwheeler@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: add d_prune dentry operation
Date: Mon, 10 Oct 2011 16:11:41 +1100	[thread overview]
Message-ID: <20111010051141.GV3159@dastard> (raw)
In-Reply-To: <Pine.LNX.4.64.1110061507550.29500@cobra.newdream.net>

On Thu, Oct 06, 2011 at 03:20:37PM -0700, Sage Weil wrote:
> On Thu, 6 Oct 2011, Christoph Hellwig wrote:
> > On Wed, Oct 05, 2011 at 09:26:10PM -0700, Sage Weil wrote:
> > > This adds a d_prune dentry operation that is called by the VFS prior to
> > > pruning (i.e. unhashing and killing) a hashed dentry from the dcache.  This
> > > will be used by Ceph to maintain a flag indicating whether the complete
> > > contents of a directory are contained in the dcache, allowing it to satisfy
> > > lookups and readdir without addition server communication.
> > 
> > What tree is the patch against?  I seems to fail to apply against Linus'
> > latests.  
> 
> Whoops, I rebased against v3.0 instead of latest master.
> 
> > It also seem like it basically should not be be opencoded but in a
> > wrapper around dentry_lru_del for all cases but the lazy removal from
> > LRU in case that is referenced, with some comments explaining the whole
> > thing.
> 
> Yeah, that's a bit better.  There are four dentry_lru_del() callers, two 
> where we there is a reference, and two where we want to ->d_prune too.

The code in the patch doesn't explain to me why you'd need to call
dentry_lru_prune() rather than dentry_lru_del()? It's something to
do with the difference between active and inactive LRU removal, but
I can't really tell. My patchset removes the LRU abuse from
select_parent, so I'm kind of wondering what the correct thing is to
do there. 

Hence, can you add a bit of documentation to those functions
explaining why and when you should use one or the other?  i.e
document the situations where the FS needs to be notified of
pruning, rather than leaving anyone who is reading the code
guessing.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2011-10-10  5:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06  4:26 [PATCH] d_prune dentry_operation Sage Weil
2011-10-06  4:26 ` [PATCH] vfs: add d_prune dentry operation Sage Weil
2011-10-06 21:21   ` Christoph Hellwig
2011-10-06 22:20     ` Sage Weil
2011-10-09 13:21       ` Christoph Hellwig
2011-10-10  5:11       ` Dave Chinner [this message]
2011-10-10 11:23         ` Christoph Hellwig
2011-10-10 16:19         ` Sage Weil
2011-10-10 16:21           ` Christoph Hellwig
2011-10-11 15:39             ` Sage Weil
2011-10-11 21:56               ` Dave Chinner
2011-10-28 12:16           ` Christoph Hellwig
2011-10-28 17:02             ` Sage Weil
  -- strict thread matches above, loose matches on Subject: below --
2011-07-08 21:10 Sage Weil
2011-07-26 23:24 ` Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111010051141.GV3159@dastard \
    --to=david@fromorbit.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rwheeler@redhat.com \
    --cc=sage@newdream.net \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox