HomeFreeBSD

nfscl: Add support for a NFSv4 AppendWrite RPC

Description

nfscl: Add support for a NFSv4 AppendWrite RPC

For IO_APPEND VOP_WRITE()s, the code first does a
Getattr RPC to acquire the file's size, before it
can do the Write RPC.

Although NFS does not have an append write operation,
an NFSv4 compound can use a Verify operation to check
that the client's notion of the file's size is
correct, followed by the Write operation.

This patch modifies the NFSv4 client to use an Appendwrite
RPC, which does a Verify to check the file's size before
doing the Write. This avoids the need for a Getattr RPC
to preceed this RPC and reduces the RPC count by half for
IO_APPEND writes, so long as the client knows the file's
size.

The nfsd structure was moved from the stack to be malloc()'d,
since the kernel stack limit was being exceeded.

While here, fix the types of a few variables, although
there should not be any semantics change caused by these
type changes.

(cherry picked from commit 5218d82c81f987223054671b9821d39f08d87599)

Details

Provenance
rmacklemAuthored on Apr 30 2022, 8:49 PM
Parents
rG2e6b10dc5bd9: nfscl: Add support for a NFSv4 AppendWrite RPC
Branches
Unknown
Tags
Unknown