diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2026-09-16 12:28:45 -0400 |
|---|---|---|
| committer | Chuck Lever <cel@kernel.org> | 2026-10-11 23:12:36 -0400 |
| commit | 7a839d9ed76f945d3b224e64904bf81f2bb7e9c0 (patch) | |
| tree | 53f5c61e7f9861a5d33ce47db93d7f1a504f615a /tools/lib/python | |
| parent | 2c9d3a4ff074895e5521a6f3aca2229fe3dd0801 (diff) | |
| download | linux-next-7a839d9ed76f945d3b224e64904bf81f2bb7e9c0.tar.gz linux-next-7a839d9ed76f945d3b224e64904bf81f2bb7e9c0.zip | |
NFSD: Use xdrgen XDR functions for NFSv2 WRITE procedure
The NFSv2 WRITE argument decoder could not be generated because
the write payload must be directed into the server's page cache
and decoded in place; a materializing decoder would copy every
write. The "pages" directive now expresses this: it represents
the payload as a struct xdr_buf and decodes it with
svcxdr_decode_opaque_payload(), which subsegments the source
stream in place rather than copying it.
Annotate the data member of writeargs with "pragma pages" and
replace the NFSPROC_WRITE entry in nfsd_procedures2 with the
generated nfs_svc_decode_writeargs and nfs_svc_encode_attrstat. A
wrapper structure bridges the generated writeargs type and the
svc_fh the NFSD VFS layer still uses; the result reuses the
attrstat wrapper from the GETATTR conversion.
The pc_argzero field is now set to zero for the NFSv2 WRITE
procedure. The generated decoder initializes every argument in
the argp->xdrgen field, making the early defensive memset
unnecessary.
This refactor replaces the use of svcxdr_encode_fattr(), so the
reference to the file handle can be released directly by
nfsd_proc_write(). A separate ->pc_release callback is thus no
longer needed. This makes it straightforward to confirm that the
file handle is properly released during every error flow.
Acked-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260916162859.2051-17-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
