diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-12-17 09:19:09 -0700 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2021-01-04 11:42:21 -0500 |
commit | 6c6ec2b0a3e0381d886d531bd1471dfdb1509237 (patch) | |
tree | 87edec0a250e14b3929f970917f34547a316c850 /include/linux/namei.h | |
parent | ae66db45fd309fd1c6d4e846dfc8414dfec7d6ad (diff) | |
download | lwn-6c6ec2b0a3e0381d886d531bd1471dfdb1509237.tar.gz lwn-6c6ec2b0a3e0381d886d531bd1471dfdb1509237.zip |
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>
Diffstat (limited to 'include/linux/namei.h')
-rw-r--r-- | include/linux/namei.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h index a4bb992623c4..b9605b2b46e7 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -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) |