linux/tools/net/sunrpc/xdrgen/generators
Chuck Lever 0cfead4c11 xdrgen: Share void RPC procedure handlers across programs
The generated server-side decoder and encoder for a void procedure
argument or result are named after the RPC program (for example,
nfs_svc_decode_void). xdrgen derives that prefix from the program
name alone, not the version, so two versions of one program built
into the same module emit the identical symbol. NFSv2 and NFSv3
both declare program NFS_PROGRAM; once both are converted, fs/nfsd
fails to link with multiple definitions of nfs_svc_decode_void and
nfs_svc_encode_void.

A void handler carries no program- or version-specific behavior:
each merely forwards to xdrgen_decode_void() or xdrgen_encode_void().
Define one shared pair, xdrgen_svc_decode_void() and
xdrgen_svc_encode_void(), in the xdrgen builtins, and stop the
program generator from emitting a per-program void handler.

lockd is the one in-tree consumer that already emits per-program
void handlers, so regenerate the NLMv3 and NLMv4 XDR code to drop
nlm_svc_{decode,encode}_void() and nlm4_svc_{decode,encode}_void()
and point both procedure tables at the shared handlers. The shared
handlers are identical to the generated ones they replace, so no
wire behavior changes.

Only the server (svc) handlers are affected. The client-side void
stubs remain static and per-program, so they do not collide.

Link: https://patch.msgid.link/20260712193122.116845-3-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
2026-08-10 09:54:35 -04:00
..
__init__.py xdrgen: Implement short (16-bit) integer types 2026-01-26 10:10:58 -05:00
constant.py tools: Add xdrgen 2024-09-20 19:31:39 -04:00
enum.py xdrgen: Add enum value validation to generated decoders 2026-01-26 10:10:58 -05:00
header_bottom.py tools: Add xdrgen 2024-09-20 19:31:39 -04:00
header_top.py tools: Add xdrgen 2024-09-20 19:31:39 -04:00
passthru.py xdrgen: Implement pass-through lines in specifications 2026-01-29 09:48:33 -05:00
pointer.py xdrgen: Add generator code for XDR width macros 2024-11-11 13:42:05 -05:00
program.py xdrgen: Share void RPC procedure handlers across programs 2026-08-10 09:54:35 -04:00
source_top.py tools: Add xdrgen 2024-09-20 19:31:39 -04:00
struct.py xdrgen: Add generator code for XDR width macros 2024-11-11 13:42:05 -05:00
typedef.py xdrgen: improve error reporting for invalid void declarations 2026-01-26 10:10:58 -05:00
union.py xdrgen: Generate "if" instead of "switch" for boolean union enumerators 2026-01-26 10:10:58 -05:00