From: Chuck Lever Date: Tue, 12 May 2026 18:14:06 +0000 (-0400) Subject: lockd: Convert NLMv3 server-side undefined procedures to xdrgen X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2403834551a9a36e937eeb1fc8522f5a0f5ce6e7;p=thirdparty%2Fkernel%2Flinux.git lockd: Convert NLMv3 server-side undefined procedures to xdrgen Complete the xdrgen migration of NLMv3 server-side procedures by converting the three unused procedure slots (17, 18, and 19). These slots already returned rpc_proc_unavail; they are converted here only to retire the last users of the hand-coded nlmsvc_decode_void and nlmsvc_encode_void helpers. The three undefined procedure entries now use the xdrgen functions nlm_svc_decode_void and nlm_svc_encode_void. The nlmsvc_proc_unused function is also moved earlier in the file to follow the convention of placing procedure implementations before the procedure table. The pc_argsize, pc_ressize, and pc_argzero fields are now set to zero since no arguments or results are processed. Setting pc_xdrressize to XDR_void reflects that these procedures return no reply payload; the previous value of St over-reserved a status word in the reply buffer. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index e0328dc89debb..79c410a751563 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c @@ -1067,6 +1067,18 @@ static __be32 nlmsvc_proc_sm_notify(struct svc_rqst *rqstp) return rpc_success; } +/** + * nlmsvc_proc_unused - stub for unused procedures + * @rqstp: RPC transaction context + * + * Returns: + * %rpc_proc_unavail: Program can't support procedure. + */ +static __be32 nlmsvc_proc_unused(struct svc_rqst *rqstp) +{ + return rpc_proc_unavail; +} + /* * SHARE: create a DOS share or alter existing share. */ @@ -1174,12 +1186,6 @@ nlmsvc_proc_free_all(struct svc_rqst *rqstp) return rpc_success; } -static __be32 -nlmsvc_proc_unused(struct svc_rqst *rqstp) -{ - return rpc_proc_unavail; -} - /* * NLM Server procedures. */ @@ -1363,34 +1369,34 @@ static const struct svc_procedure nlmsvc_procedures[24] = { .pc_name = "SM_NOTIFY", }, [17] = { - .pc_func = nlmsvc_proc_unused, - .pc_decode = nlmsvc_decode_void, - .pc_encode = nlmsvc_encode_void, - .pc_argsize = sizeof(struct nlm_void), - .pc_argzero = sizeof(struct nlm_void), - .pc_ressize = sizeof(struct nlm_void), - .pc_xdrressize = St, - .pc_name = "UNUSED", + .pc_func = nlmsvc_proc_unused, + .pc_decode = nlm_svc_decode_void, + .pc_encode = nlm_svc_encode_void, + .pc_argsize = 0, + .pc_argzero = 0, + .pc_ressize = 0, + .pc_xdrressize = XDR_void, + .pc_name = "UNUSED", }, [18] = { - .pc_func = nlmsvc_proc_unused, - .pc_decode = nlmsvc_decode_void, - .pc_encode = nlmsvc_encode_void, - .pc_argsize = sizeof(struct nlm_void), - .pc_argzero = sizeof(struct nlm_void), - .pc_ressize = sizeof(struct nlm_void), - .pc_xdrressize = St, - .pc_name = "UNUSED", + .pc_func = nlmsvc_proc_unused, + .pc_decode = nlm_svc_decode_void, + .pc_encode = nlm_svc_encode_void, + .pc_argsize = 0, + .pc_argzero = 0, + .pc_ressize = 0, + .pc_xdrressize = XDR_void, + .pc_name = "UNUSED", }, [19] = { - .pc_func = nlmsvc_proc_unused, - .pc_decode = nlmsvc_decode_void, - .pc_encode = nlmsvc_encode_void, - .pc_argsize = sizeof(struct nlm_void), - .pc_argzero = sizeof(struct nlm_void), - .pc_ressize = sizeof(struct nlm_void), - .pc_xdrressize = St, - .pc_name = "UNUSED", + .pc_func = nlmsvc_proc_unused, + .pc_decode = nlm_svc_decode_void, + .pc_encode = nlm_svc_encode_void, + .pc_argsize = 0, + .pc_argzero = 0, + .pc_ressize = 0, + .pc_xdrressize = XDR_void, + .pc_name = "UNUSED", }, [NLMPROC_SHARE] = { .pc_func = nlmsvc_proc_share,