]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lockd: Convert NLMv3 server-side undefined procedures to xdrgen
authorChuck Lever <chuck.lever@oracle.com>
Tue, 12 May 2026 18:14:06 +0000 (14:14 -0400)
committerChuck Lever <cel@kernel.org>
Tue, 9 Jun 2026 20:32:59 +0000 (16:32 -0400)
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>
fs/lockd/svcproc.c

index e0328dc89debba21a4c6d1c474f148ba0b56cb84..79c410a751563fd9e23751ede25a283b1c33313e 100644 (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,