Re: [PATCH 01/10] vfs: add d_walk()

From: Al Viro
Date: Wed Sep 04 2013 - 14:12:30 EST


On Wed, Sep 04, 2013 at 04:05:47PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@xxxxxxx>
>
> 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...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/