]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Add support for a NFSv4 AppendWrite RPC
authorRick Macklem <rmacklem@FreeBSD.org>
Sat, 30 Apr 2022 20:49:23 +0000 (13:49 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Thu, 9 Jun 2022 20:46:14 +0000 (13:46 -0700)
commit8929caf5587b26798caba6435d500a26158afbda
tree79a986ef23470d9116d25e20b051f6b5508e1b60
parent2e6b10dc5bd991a7438724a18a532ab73eb1ace0
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)
sys/fs/nfs/nfs_var.h
sys/fs/nfsclient/nfs.h
sys/fs/nfsclient/nfs_clbio.c
sys/fs/nfsclient/nfs_clrpcops.c
sys/fs/nfsclient/nfs_clvnops.c