]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: move vnodes out of filedesc into a dedicated structure
authorMateusz Guzik <mjg@FreeBSD.org>
Sun, 1 Mar 2020 21:53:46 +0000 (21:53 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Sun, 1 Mar 2020 21:53:46 +0000 (21:53 +0000)
commit8d03b99b9dafe92896f405c79f846667637c0194
tree7652a4a2fd9f888c114b8b0b375db5a54efd1b9f
parent8243063f9b51391032ce09c18a5adbdc29263d0d
fd: move vnodes out of filedesc into a dedicated structure

The new structure is copy-on-write. With the assumption that path lookups are
significantly more frequent than chdirs and chrooting this is a win.

This provides stable root and jail root vnodes without the need to reference
them on lookup, which in turn means less work on globally shared structures.
Note this also happens to fix a bug where jail vnode was never referenced,
meaning subsequent access on lookup could run into use-after-free.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23884
lib/libprocstat/libprocstat.c
sys/compat/linprocfs/linprocfs.c
sys/kern/kern_descrip.c
sys/kern/kern_linker.c
sys/kern/vfs_cache.c
sys/kern/vfs_lookup.c
sys/kern/vfs_mountroot.c
sys/security/audit/audit_bsm_klib.c
sys/sys/filedesc.h
sys/ufs/ffs/ffs_alloc.c