Re: [PATCH RFC 1/3] fs: introduce helper d_path_fast()

From: Al Viro
Date: Sun May 09 2021 - 01:04:13 EST


On Sun, May 09, 2021 at 02:20:32AM +0000, Al Viro wrote:
> Umm... Interesting, especially considering the way dyname_dname() looks like.
dynamic_dname(), obviously.

> Looks like there's a piece of prepend() open-coded in it. And
> since all ->d_dname() instances are either simple_dname() or end up
> with call of dynamic_dname()...
>
> Might make sense to turn that method into
> int (*d_dname)(struct dentry *, struct prepend_buffer *);
>
> Followup patch, obviously, but it might be worth looking into.
>
> Another thing that keeps bugging me about prepend_path() is the
> set of return values. I mean, 0/1/2/3/-ENAMETOOLONG, and all
> except 0 are unlikely? Might as well make that 0/1/2/3/-1, if
> not an outright 0/1/2/3/4. And prepend() could return bool, while
> we are at it (true - success, false - overflow)...

OK... I think I see how to carve it up sanely, will post after I
get some sleep.