]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
namei: Add cn_flags bits for OPENREAD and OPENWRITE
authorRick Macklem <rmacklem@FreeBSD.org>
Sat, 7 Aug 2021 01:41:11 +0000 (18:41 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Sat, 7 Aug 2021 01:41:11 +0000 (18:41 -0700)
commitc18c74a87c15f5f8774df7e2f8fa0fe72422203d
tree5223810c2526b7178f47ccb9fe5ca2a53ae06d2c
parentfd0ffba3b4c9edfc79590f98729dfa34abba6100
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
sys/kern/vfs_vnops.c
sys/sys/namei.h