namei: add getname_uflags()
authorDmitry Kadashev <dkadashev@gmail.com>
Thu, 8 Jul 2021 06:34:42 +0000 (13:34 +0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 19:41:26 +0000 (13:41 -0600)
commit8228e2c313194f13f1d1806ed5734a26c38d49ac
tree84d58d03dbd06a8258bed089f2f435cff4c63f38
parentda2d0cede330192879e8e16ddb3158aa76ba5ec2
namei: add getname_uflags()

There are a couple of places where we already open-code the (flags &
AT_EMPTY_PATH) check and io_uring will likely add another one in the
future.  Let's just add a simple helper getname_uflags() that handles
this directly and use it.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/io-uring/20210415100815.edrn4a7cy26wkowe@wittgenstein/
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Dmitry Kadashev <dkadashev@gmail.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20210708063447.3556403-7-dkadashev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/exec.c
fs/namei.c
include/linux/fs.h