Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1{# SPDX-License-Identifier: GPL-2.0 #}
2
3/**
4 * {{ program }}_svc_encode_{{ result }} - Encode a {{ result }} result
5 * @rqstp: RPC transaction context
6 * @xdr: target XDR data stream
7 *
8 * Return values:
9 * %true: procedure results encoded successfully
10 * %false: encode failed
11 */
12bool {{ program }}_svc_encode_{{ result }}(struct svc_rqst *rqstp, struct xdr_stream *xdr)
13{
14{% if result == 'void' %}
15 return xdrgen_encode_void(xdr);
16{% else %}
17{% if result in structs %}
18 struct {{ result }} *resp = rqstp->rq_resp;
19
20 return xdrgen_encode_{{ result }}(xdr, resp);
21{% else %}
22 {{ result }} *resp = rqstp->rq_resp;
23
24 return xdrgen_encode_{{ result }}(xdr, *resp);
25{% endif %}
26{% endif %}
27}