]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfs: link_path_walk: simplify name hash flow
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Jun 2024 00:55:00 +0000 (17:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 19 Jun 2024 19:35:56 +0000 (12:35 -0700)
commit7d286849a8de41c1aee2957e224c5802d3488c8d
tree9ade2fac2e278553916a51434846507a73b6a878
parent6ba59ff4227927d3a8530fc2973b80e94b54d58f
vfs: link_path_walk: simplify name hash flow

This is one of those hot functions in path walking, and it's doing
things in just the wrong order that causes slightly unnecessary extra
work.

Move the name pointer update and the setting of 'nd->last' up a bit, so
that the (unlikely) filesystem-specific hashing can run on them in
place, instead of having to set up a copy on the stack and copy things
back and forth.

Because even when the hashing is not run, it causes the stack frame of
the function to be bigger to hold the unnecessary temporary copy.

This also means that we never then reference the full "hashlen" field
after calculating it, and can clarify the code with just using the
length part.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c