HomeFreeBSD

vfs: add FAILIFEXISTS flag

Description

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

Details

Provenance
mjgAuthored on Dec 27 2020, 11:33 PM
Reviewer
kib
Differential Revision
D27789: vfs: add FAILIFEXISTS flag
Parents
rGff97bc034fcd: cache: simplify lockless dot lookups
Branches
Unknown
Tags
Unknown