lkml.org 
[lkml]   [2013]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/10] vfs: add d_walk()
On Wed, Sep 04, 2013 at 04:05:47PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
>
> This one replaces three instances open coded tree walking (have_submounts,
> select_parent, d_genocide) with a common helper.
>
> In addition to slightly reducing the kernel size, this simplifies the
> callers and makes them less bug prone.

Two notes:

1) I'd probably kill select_parent() - it made sense when it was a huge
function called in a loop, but when it's a simple call of d_walk()...
Might as well do it directly in shrink_dcache_parent(). Moreover, in
that case we'd be free to embed list_head into your struct select_data,
rather than passing pointers.

2) I'm not sure we need the "leave" callback at all; the only user is
d_genocide() and AFAICS it can bloody well be done as part of
d_genocide_check() - we care about having it done to all nodes in
the tree, but we don't really care about the order in which it's
done...


\
 
 \ /
  Last update: 2013-09-04 21:21    [W:1.461 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site