HomeFreeBSD

namei: Add cn_flags bits for OPENREAD and OPENWRITE

Description

namei: Add cn_flags bits for OPENREAD and OPENWRITE

VOP_LOOKUP() is called with cn_flags bits ISLASTCN and ISOPEN
to indicate that the lookup is for the last component of a pathname
when doing open.

If the cn_flags also indicates if the open is for Reading, Writing or Both,
the NFSv4 client can do an NFSv4 Open operation in the same compound
RPC as Lookup, often avoiding the additional Open RPC now done when
VOP_OPEN() is called.

This patch defines two new cn_flags bits called OPENREAD and OPENWRITE
and sets these in open2nameif() based on FREAD, FWRITE flag bits.
This will allow a subsequent patch to the NFSv4 client to do the Open
operation in the same RPC as Lookup.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31431

Details

Provenance
rmacklemAuthored on Aug 7 2021, 1:41 AM
Reviewer
kib
Differential Revision
D31431: Add new cn_flags bits that indicate an Open for Reading and/or Writing
Parents
rGfd0ffba3b4c9: Fix pathconf.2 documentation error
Branches
Unknown
Tags
Unknown