fs: add support for LOOKUP_CACHED
[ Upstream commit 6c6ec2b0a3e0381d886d531bd1471dfdb1509237 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
36ec31201a
commit
c1fe7bd3e1
@@ -46,6 +46,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};
|
||||
#define LOOKUP_NO_XDEV 0x040000 /* No mountpoint crossing. */
|
||||
#define LOOKUP_BENEATH 0x080000 /* No escaping from starting point. */
|
||||
#define LOOKUP_IN_ROOT 0x100000 /* Treat dirfd as fs root. */
|
||||
#define LOOKUP_CACHED 0x200000 /* Only do cached lookup */
|
||||
/* LOOKUP_* flags which do scope-related checks based on the dirfd. */
|
||||
#define LOOKUP_IS_SCOPED (LOOKUP_BENEATH | LOOKUP_IN_ROOT)
|
||||
|
||||
|
Reference in New Issue
Block a user