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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Chuck Lever 2026-05-12 14:14:06 -04:00 committed by Chuck Lever
parent 371275eeb0
commit 2403834551

View File

@ -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,