mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
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>
This commit is contained in:
@@ -271,20 +271,6 @@ xdrgen_decode_nlm_notifyargs(struct xdr_stream *xdr, struct nlm_notifyargs *ptr)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm_svc_decode_void - Decode a void argument
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: source XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure arguments decoded successfully
|
||||
* %false: decode failed
|
||||
*/
|
||||
bool nlm_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_decode_void(xdr);
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm_svc_decode_nlm_testargs - Decode a nlm_testargs argument
|
||||
* @rqstp: RPC transaction context
|
||||
@@ -651,20 +637,6 @@ xdrgen_encode_nlm_notifyargs(struct xdr_stream *xdr, const struct nlm_notifyargs
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm_svc_encode_void - Encode a void result
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: target XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure results encoded successfully
|
||||
* %false: encode failed
|
||||
*/
|
||||
bool nlm_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_encode_void(xdr);
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm_svc_encode_nlm_testres - Encode a nlm_testres result
|
||||
* @rqstp: RPC transaction context
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/sunrpc/xdrgen/_builtins.h>
|
||||
#include <linux/sunrpc/xdrgen/nlm3.h>
|
||||
|
||||
bool nlm_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_decode_nlm_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_decode_nlm_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_decode_nlm_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
@@ -24,7 +23,6 @@ bool nlm_svc_decode_nlm_notifyargs(struct svc_rqst *rqstp, struct xdr_stream *xd
|
||||
bool nlm_svc_decode_nlm_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_decode_nlm_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
|
||||
bool nlm_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_encode_nlm_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_encode_nlm_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm_svc_encode_nlm_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
|
||||
@@ -300,20 +300,6 @@ xdrgen_decode_nlm4_notifyargs(struct xdr_stream *xdr, struct nlm4_notifyargs *pt
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm4_svc_decode_void - Decode a void argument
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: source XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure arguments decoded successfully
|
||||
* %false: decode failed
|
||||
*/
|
||||
bool nlm4_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_decode_void(xdr);
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm4_svc_decode_nlm4_testargs - Decode a nlm4_testargs argument
|
||||
* @rqstp: RPC transaction context
|
||||
@@ -704,20 +690,6 @@ xdrgen_encode_nlm4_notifyargs(struct xdr_stream *xdr, const struct nlm4_notifyar
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm4_svc_encode_void - Encode a void result
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: target XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure results encoded successfully
|
||||
* %false: encode failed
|
||||
*/
|
||||
bool nlm4_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_encode_void(xdr);
|
||||
}
|
||||
|
||||
/**
|
||||
* nlm4_svc_encode_nlm4_testres - Encode a nlm4_testres result
|
||||
* @rqstp: RPC transaction context
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/sunrpc/xdrgen/_builtins.h>
|
||||
#include <linux/sunrpc/xdrgen/nlm4.h>
|
||||
|
||||
bool nlm4_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_decode_nlm4_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_decode_nlm4_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_decode_nlm4_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
@@ -24,7 +23,6 @@ bool nlm4_svc_decode_nlm4_notifyargs(struct svc_rqst *rqstp, struct xdr_stream *
|
||||
bool nlm4_svc_decode_nlm4_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_decode_nlm4_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
|
||||
bool nlm4_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_encode_nlm4_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_encode_nlm4_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
bool nlm4_svc_encode_nlm4_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
|
||||
|
||||
@@ -1167,8 +1167,8 @@ static __be32 nlm4svc_proc_free_all(struct svc_rqst *rqstp)
|
||||
static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_NULL] = {
|
||||
.pc_func = nlm4svc_proc_null,
|
||||
.pc_decode = nlm4_svc_decode_void,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = XDR_void,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1228,7 +1228,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_TEST_MSG] = {
|
||||
.pc_func = nlm4svc_proc_test_msg,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_testargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_testargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1238,7 +1238,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_LOCK_MSG] = {
|
||||
.pc_func = nlm4svc_proc_lock_msg,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_lockargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_lockargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1248,7 +1248,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_CANCEL_MSG] = {
|
||||
.pc_func = nlm4svc_proc_cancel_msg,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_cancargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_cancargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1258,7 +1258,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_UNLOCK_MSG] = {
|
||||
.pc_func = nlm4svc_proc_unlock_msg,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_unlockargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_unlockargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1268,7 +1268,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_GRANTED_MSG] = {
|
||||
.pc_func = nlm4svc_proc_granted_msg,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_testargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_testargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1278,7 +1278,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_TEST_RES] = {
|
||||
.pc_func = nlm4svc_proc_null,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_testres,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_testres),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1288,7 +1288,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_LOCK_RES] = {
|
||||
.pc_func = nlm4svc_proc_null,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_res,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1298,7 +1298,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_CANCEL_RES] = {
|
||||
.pc_func = nlm4svc_proc_null,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_res,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1308,7 +1308,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_UNLOCK_RES] = {
|
||||
.pc_func = nlm4svc_proc_null,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_res,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1318,7 +1318,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_GRANTED_RES] = {
|
||||
.pc_func = nlm4svc_proc_granted_res,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_res,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_res_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1328,7 +1328,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_SM_NOTIFY] = {
|
||||
.pc_func = nlm4svc_proc_sm_notify,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_notifyargs,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_notifyargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1337,8 +1337,8 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
},
|
||||
[17] = {
|
||||
.pc_func = nlm4svc_proc_unused,
|
||||
.pc_decode = nlm4_svc_decode_void,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1347,8 +1347,8 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
},
|
||||
[18] = {
|
||||
.pc_func = nlm4svc_proc_unused,
|
||||
.pc_decode = nlm4_svc_decode_void,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1357,8 +1357,8 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
},
|
||||
[19] = {
|
||||
.pc_func = nlm4svc_proc_unused,
|
||||
.pc_decode = nlm4_svc_decode_void,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1398,7 +1398,7 @@ static const struct svc_procedure nlm4svc_procedures[24] = {
|
||||
[NLMPROC4_FREE_ALL] = {
|
||||
.pc_func = nlm4svc_proc_free_all,
|
||||
.pc_decode = nlm4_svc_decode_nlm4_notify,
|
||||
.pc_encode = nlm4_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm4_notify_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
|
||||
@@ -1176,8 +1176,8 @@ static __be32 nlmsvc_proc_free_all(struct svc_rqst *rqstp)
|
||||
static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_NULL] = {
|
||||
.pc_func = nlmsvc_proc_null,
|
||||
.pc_decode = nlm_svc_decode_void,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = XDR_void,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1237,7 +1237,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_TEST_MSG] = {
|
||||
.pc_func = nlmsvc_proc_test_msg,
|
||||
.pc_decode = nlm_svc_decode_nlm_testargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_testargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1247,7 +1247,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_LOCK_MSG] = {
|
||||
.pc_func = nlmsvc_proc_lock_msg,
|
||||
.pc_decode = nlm_svc_decode_nlm_lockargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_lockargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1257,7 +1257,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_CANCEL_MSG] = {
|
||||
.pc_func = nlmsvc_proc_cancel_msg,
|
||||
.pc_decode = nlm_svc_decode_nlm_cancargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_cancargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1267,7 +1267,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_UNLOCK_MSG] = {
|
||||
.pc_func = nlmsvc_proc_unlock_msg,
|
||||
.pc_decode = nlm_svc_decode_nlm_unlockargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_unlockargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1277,7 +1277,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_GRANTED_MSG] = {
|
||||
.pc_func = nlmsvc_proc_granted_msg,
|
||||
.pc_decode = nlm_svc_decode_nlm_testargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_testargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1287,7 +1287,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_TEST_RES] = {
|
||||
.pc_func = nlmsvc_proc_null,
|
||||
.pc_decode = nlm_svc_decode_nlm_testres,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_testres),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1297,7 +1297,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_LOCK_RES] = {
|
||||
.pc_func = nlmsvc_proc_null,
|
||||
.pc_decode = nlm_svc_decode_nlm_res,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1307,7 +1307,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_CANCEL_RES] = {
|
||||
.pc_func = nlmsvc_proc_null,
|
||||
.pc_decode = nlm_svc_decode_nlm_res,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1317,7 +1317,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_UNLOCK_RES] = {
|
||||
.pc_func = nlmsvc_proc_null,
|
||||
.pc_decode = nlm_svc_decode_nlm_res,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_res),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1327,7 +1327,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_GRANTED_RES] = {
|
||||
.pc_func = nlmsvc_proc_granted_res,
|
||||
.pc_decode = nlm_svc_decode_nlm_res,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_res_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1337,7 +1337,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_SM_NOTIFY] = {
|
||||
.pc_func = nlmsvc_proc_sm_notify,
|
||||
.pc_decode = nlm_svc_decode_nlm_notifyargs,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_notifyargs_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1346,8 +1346,8 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
},
|
||||
[17] = {
|
||||
.pc_func = nlmsvc_proc_unused,
|
||||
.pc_decode = nlm_svc_decode_void,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1356,8 +1356,8 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
},
|
||||
[18] = {
|
||||
.pc_func = nlmsvc_proc_unused,
|
||||
.pc_decode = nlm_svc_decode_void,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1366,8 +1366,8 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
},
|
||||
[19] = {
|
||||
.pc_func = nlmsvc_proc_unused,
|
||||
.pc_decode = nlm_svc_decode_void,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_decode = xdrgen_svc_decode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = 0,
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
@@ -1407,7 +1407,7 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
|
||||
[NLM_FREE_ALL] = {
|
||||
.pc_func = nlmsvc_proc_free_all,
|
||||
.pc_decode = nlm_svc_decode_nlm_notify,
|
||||
.pc_encode = nlm_svc_encode_void,
|
||||
.pc_encode = xdrgen_svc_encode_void,
|
||||
.pc_argsize = sizeof(struct nlm_notify_wrapper),
|
||||
.pc_argzero = 0,
|
||||
.pc_ressize = 0,
|
||||
|
||||
@@ -296,4 +296,36 @@ xdrgen_encode_opaque(struct xdr_stream *xdr, opaque val)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct svc_rqst;
|
||||
|
||||
/**
|
||||
* xdrgen_svc_decode_void - Decode a void argument
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: source XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure arguments decoded successfully
|
||||
* %false: decode failed
|
||||
*/
|
||||
static inline bool
|
||||
xdrgen_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_decode_void(xdr);
|
||||
}
|
||||
|
||||
/**
|
||||
* xdrgen_svc_encode_void - Encode a void result
|
||||
* @rqstp: RPC transaction context
|
||||
* @xdr: target XDR data stream
|
||||
*
|
||||
* Return values:
|
||||
* %true: procedure results encoded successfully
|
||||
* %false: encode failed
|
||||
*/
|
||||
static inline bool
|
||||
xdrgen_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
return xdrgen_encode_void(xdr);
|
||||
}
|
||||
|
||||
#endif /* _SUNRPC_XDRGEN__BUILTINS_H_ */
|
||||
|
||||
@@ -38,6 +38,8 @@ def emit_version_declarations(
|
||||
arguments = dict.fromkeys([])
|
||||
for procedure in version.procedures:
|
||||
if procedure.name not in excluded_apis:
|
||||
if procedure.argument.type_name == "void":
|
||||
continue
|
||||
arguments[procedure.argument.type_name] = None
|
||||
if len(arguments) > 0:
|
||||
print("")
|
||||
@@ -48,6 +50,8 @@ def emit_version_declarations(
|
||||
results = dict.fromkeys([])
|
||||
for procedure in version.procedures:
|
||||
if procedure.name not in excluded_apis:
|
||||
if procedure.result.type_name == "void":
|
||||
continue
|
||||
results[procedure.result.type_name] = None
|
||||
if len(results) > 0:
|
||||
print("")
|
||||
@@ -63,6 +67,8 @@ def emit_version_argument_decoders(
|
||||
arguments = dict.fromkeys([])
|
||||
for procedure in version.procedures:
|
||||
if procedure.name not in excluded_apis:
|
||||
if procedure.argument.type_name == "void":
|
||||
continue
|
||||
arguments[procedure.argument.type_name] = None
|
||||
|
||||
template = environment.get_template("decoder/argument.j2")
|
||||
@@ -105,6 +111,8 @@ def emit_version_result_encoders(
|
||||
results = dict.fromkeys([])
|
||||
for procedure in version.procedures:
|
||||
if procedure.name not in excluded_apis:
|
||||
if procedure.result.type_name == "void":
|
||||
continue
|
||||
results[procedure.result.type_name] = None
|
||||
|
||||
template = environment.get_template("encoder/result.j2")
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
*/
|
||||
bool {{ program }}_svc_decode_{{ argument }}(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
{% if argument == 'void' %}
|
||||
return xdrgen_decode_void(xdr);
|
||||
{% else %}
|
||||
{% if argument in structs %}
|
||||
struct {{ argument }} *argp = rqstp->rq_argp;
|
||||
{% else %}
|
||||
@@ -21,5 +18,4 @@ bool {{ program }}_svc_decode_{{ argument }}(struct svc_rqst *rqstp, struct xdr_
|
||||
{% endif %}
|
||||
|
||||
return xdrgen_decode_{{ argument }}(xdr, argp);
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
*/
|
||||
bool {{ program }}_svc_encode_{{ result }}(struct svc_rqst *rqstp, struct xdr_stream *xdr)
|
||||
{
|
||||
{% if result == 'void' %}
|
||||
return xdrgen_encode_void(xdr);
|
||||
{% else %}
|
||||
{% if result in structs %}
|
||||
struct {{ result }} *resp = rqstp->rq_resp;
|
||||
|
||||
@@ -23,5 +20,4 @@ bool {{ program }}_svc_encode_{{ result }}(struct svc_rqst *rqstp, struct xdr_st
|
||||
|
||||
return xdrgen_encode_{{ result }}(xdr, *resp);
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user