]> git.baikalelectronics.ru Git - kernel.git/commit
fs: add support for LOOKUP_CACHED
authorJens Axboe <axboe@kernel.dk>
Thu, 17 Dec 2020 16:19:09 +0000 (09:19 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Jan 2021 16:42:21 +0000 (11:42 -0500)
commit31b5ea1b0c2b8ea06fcfce409c166f8bb8eb1ce0
tree87edec0a250e14b3929f970917f34547a316c850
parent2e0b93eebaf9d2ae7fa6cca74a25beed7be7dcf2
fs: add support for LOOKUP_CACHED

io_uring always punts opens to async context, since there's no control
over whether the lookup blocks or not. Add LOOKUP_CACHED to support
just doing the fast RCU based lookups, which we know will not block. If
we can do a cached path resolution of the filename, then we don't have
to always punt lookups for a worker.

During path resolution, we always do LOOKUP_RCU first. If that fails and
we terminate LOOKUP_RCU, then fail a LOOKUP_CACHED attempt as well.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c
include/linux/namei.h