diff options
| author | Chuck Lever <cel@kernel.org> | 2026-09-16 12:28:42 -0400 |
|---|---|---|
| committer | Chuck Lever <cel@kernel.org> | 2026-10-11 23:12:30 -0400 |
| commit | 781dbb8a91457e973b361e14565163969ef2a660 (patch) | |
| tree | fd39a9b82bc4751e0bf89647af11657a2d147927 /tools/lib/python | |
| parent | 463ffa098a429f7a1bca64646c945c6886c45bee (diff) | |
| download | linux-next-781dbb8a91457e973b361e14565163969ef2a660.tar.gz linux-next-781dbb8a91457e973b361e14565163969ef2a660.zip | |
NFSD: Use xdrgen XDR functions for NFSv2 READLINK procedure
Replace the hand-written NFSv2 READLINK codec pair with the
xdrgen-generated functions. The NFSPROC_READLINK entry in the
nfsd_procedures2 array now dispatches nfs_svc_decode_fhandle and
nfs_svc_encode_readlinkres. A wrapper structure bridges the
generated xdrgen fhandle type and the legacy svc_fh representation
the NFSD VFS layer still uses.
The link target does not reside at the data pointer of the
readlinkres union arm: nfsd_readlink() deposits it directly in a
page of the Reply buffer, so the generic encoder that copies an
opaque from the member's data pointer cannot encode it. Mark the
arm with the "pragma pages" directive so the generated encoder
calls svcxdr_encode_opaque_payload(), which encodes the length
prefix and inserts the payload page into the stream by reference.
The page anchor that the result structure carried duplicated
rq_res.pages -- svc_process() points rq_res.pages at the first
Reply page before dispatch, and the fhandle argument decoder
consumes no pages -- so the helper locates the payload through the
Reply buffer itself, and the wrapper collapses to the generated
readlinkres type.
The pc_argzero field is now set to zero for the NFSv2 READLINK
procedure. The xdrgen decoders are trusted to initialize all
arguments in the argp->xdrgen field, making the early defensive
memset unnecessary. The remaining argp fields are cleared as
needed.
Acked-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260916162859.2051-14-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
