Re: [PATCH v3 01/14] fs/namei.c: use trailing_slashes()
From: Jori Koolstra
Date: Mon Jul 06 2026 - 16:56:51 EST
> Op 06-07-2026 09:29 CEST schreef David Laight <david.laight.linux@xxxxxxxxx>:
>
>
> On Mon, 06 Jul 2026 13:56:00 +1000
> NeilBrown <neilb@xxxxxxxxxxx> wrote:
>
> > On Sun, 05 Jul 2026, Jori Koolstra wrote:
> > > There are several places in fs/namei.c that can use the
> > > trailing_slashes() function to improve intent.
> >
> > I think it would help to state here that trailing_slashes() is changed
> > to take a qstr instead of a nameidata as that is useful in more places.
Yes, thanks.
>
> It is also taking the struct 'by value' so should really be always_inline
> before something makes a compiler decide it should be a real function.
>
> (Or make it take a pointer)
>
> David
You know more about this compiler optimization stuff than I do, David. So:
is there any chance this does not get inlined? I am fine with always_inline,
but I don't see it often in these scenarios (just inline usually). Is there
a reason for that?
Pointer is also OK, but this is just two register copies (even if it does not get
inlined) on 64-bit. Is that really less fast than one copy and a pointer deref?
Genuine question, I am no expert on this.
Thanks,
Jori.