aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/namei.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-12-27 23:33:04 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-12-28 01:53:27 +0000
commit002e18eb7f3e1ae972827cb35705502e91c540e3 (patch)
treeb3549f70606303b99454321e84ae5f521db23ea1 /sys/sys/namei.h
parentff97bc034fcdf16207ed75e43622e9f0d91fa553 (diff)
downloadsrc-002e18eb7f3e1ae972827cb35705502e91c540e3.tar.gz
src-002e18eb7f3e1ae972827cb35705502e91c540e3.zip
vfs: add FAILIFEXISTS flag
Both FreeBSD and Linux mkdir -p walk the tree up ignoring any EEXIST on the way and both are used a lot when building respective kernels. This poses a problem as spurious locking avoidably interferes with concurrent operations like getdirentries on affected directories. Work around the problem by adding FAILIFEXISTS flag. In case of lockless lookup this manages to avoid any work to begin with, there is no speed up for the locked case but perhaps this can be augmented later on. For simplicity the only supported semantics are as used by mkdir. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D27789
Diffstat (limited to 'sys/sys/namei.h')
-rw-r--r--sys/sys/namei.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index dfb5e5e4cec3..ddba9cbd8912 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -143,7 +143,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status,
#define LOCKLEAF 0x0004 /* lock vnode on return */
#define LOCKPARENT 0x0008 /* want parent vnode returned locked */
#define WANTPARENT 0x0010 /* want parent vnode returned unlocked */
-/* UNUSED 0x0020 */
+#define FAILIFEXISTS 0x0020 /* return EEXIST if found */
#define FOLLOW 0x0040 /* follow symbolic links */
#define BENEATH 0x0080 /* No escape from the start dir */
#define LOCKSHARED 0x0100 /* Shared lock leaf */