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 getdirentries and calls 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.