HomeFreeBSD

unionfs: Implement VOP_GETLOWVNODE

Description

unionfs: Implement VOP_GETLOWVNODE

This function returns the vnode that will be used to resolve the
access type specified in the 'flags' argument, and is useful for
optimal behavior of vn_copy_file_range(). While most filesystems
can simply use the default implementation which returns the passed-
in vnode, unionfs (like nullfs) ideally should resolve the access
request to whichever base layer vnode will be used for the I/O.

For unionfs, write accesses must be resolved through the upper vnode,
while read accesses will be resolved through the upper vnode if
present or the lower vnode otherwise. Provide a simple
unionfs_getlowvnode() implementation that reflects this policy.

Reviewed by: kib, olce
Tested by: pho
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53988

Details

Provenance
jahAuthored on Nov 28 2025, 7:36 AM
Reviewer
kib
Differential Revision
D53988: unionfs: Implement VOP_GETLOWVNODE and employ it for basicmount-time deadlock detection
Parents
rG38d60d453caa: vnode_if.src: fix function name in locking annotation
Branches
Unknown
Tags
Unknown