xref: /linux/fs/lockd/nlm4xdr_gen.c (revision 0fc8f6200d2313278fbf4539bbab74677c685531)
1 // SPDX-License-Identifier: GPL-2.0
2 // Generated by xdrgen. Manual edits will be lost.
3 // XDR specification file: ../../Documentation/sunrpc/xdr/nlm4.x
4 // XDR specification modification time: Thu Dec 25 13:10:19 2025
5 
6 #include <linux/sunrpc/svc.h>
7 
8 #include "nlm4xdr_gen.h"
9 
10 static bool __maybe_unused
11 xdrgen_decode_netobj(struct xdr_stream *xdr, netobj *ptr)
12 {
13 	return xdrgen_decode_opaque(xdr, ptr, MAXNETOBJ_SZ);
14 }
15 
16 static bool __maybe_unused
17 xdrgen_decode_fsh4_mode(struct xdr_stream *xdr, fsh4_mode *ptr)
18 {
19 	u32 val;
20 
21 	if (xdr_stream_decode_u32(xdr, &val) < 0)
22 		return false;
23 	*ptr = val;
24 	return true;
25 }
26 
27 static bool __maybe_unused
28 xdrgen_decode_fsh4_access(struct xdr_stream *xdr, fsh4_access *ptr)
29 {
30 	u32 val;
31 
32 	if (xdr_stream_decode_u32(xdr, &val) < 0)
33 		return false;
34 	*ptr = val;
35 	return true;
36 }
37 
38 static bool __maybe_unused
39 xdrgen_decode_uint64(struct xdr_stream *xdr, uint64 *ptr)
40 {
41 	return xdrgen_decode_unsigned_hyper(xdr, ptr);
42 }
43 
44 static bool __maybe_unused
45 xdrgen_decode_int64(struct xdr_stream *xdr, int64 *ptr)
46 {
47 	return xdrgen_decode_hyper(xdr, ptr);
48 }
49 
50 static bool __maybe_unused
51 xdrgen_decode_uint32(struct xdr_stream *xdr, uint32 *ptr)
52 {
53 	return xdrgen_decode_unsigned_long(xdr, ptr);
54 }
55 
56 static bool __maybe_unused
57 xdrgen_decode_int32(struct xdr_stream *xdr, int32 *ptr)
58 {
59 	return xdrgen_decode_long(xdr, ptr);
60 }
61 
62 static bool __maybe_unused
63 xdrgen_decode_nlm4_stats(struct xdr_stream *xdr, nlm4_stats *ptr)
64 {
65 	return xdr_stream_decode_be32(xdr, ptr) == 0;
66 }
67 
68 static bool __maybe_unused
69 xdrgen_decode_nlm4_holder(struct xdr_stream *xdr, struct nlm4_holder *ptr)
70 {
71 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
72 		return false;
73 	if (!xdrgen_decode_int32(xdr, &ptr->svid))
74 		return false;
75 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
76 		return false;
77 	if (!xdrgen_decode_uint64(xdr, &ptr->l_offset))
78 		return false;
79 	if (!xdrgen_decode_uint64(xdr, &ptr->l_len))
80 		return false;
81 	return true;
82 }
83 
84 static bool __maybe_unused
85 xdrgen_decode_nlm4_testrply(struct xdr_stream *xdr, struct nlm4_testrply *ptr)
86 {
87 	if (!xdrgen_decode_nlm4_stats(xdr, &ptr->stat))
88 		return false;
89 	switch (ptr->stat) {
90 	case __constant_cpu_to_be32(NLM4_DENIED):
91 		if (!xdrgen_decode_nlm4_holder(xdr, &ptr->u.holder))
92 			return false;
93 		break;
94 	default:
95 		break;
96 	}
97 	return true;
98 }
99 
100 static bool __maybe_unused
101 xdrgen_decode_nlm4_stat(struct xdr_stream *xdr, struct nlm4_stat *ptr)
102 {
103 	if (!xdrgen_decode_nlm4_stats(xdr, &ptr->stat))
104 		return false;
105 	return true;
106 }
107 
108 static bool __maybe_unused
109 xdrgen_decode_nlm4_res(struct xdr_stream *xdr, struct nlm4_res *ptr)
110 {
111 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
112 		return false;
113 	if (!xdrgen_decode_nlm4_stat(xdr, &ptr->stat))
114 		return false;
115 	return true;
116 }
117 
118 static bool __maybe_unused
119 xdrgen_decode_nlm4_testres(struct xdr_stream *xdr, struct nlm4_testres *ptr)
120 {
121 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
122 		return false;
123 	if (!xdrgen_decode_nlm4_testrply(xdr, &ptr->stat))
124 		return false;
125 	return true;
126 }
127 
128 static bool __maybe_unused
129 xdrgen_decode_nlm4_lock(struct xdr_stream *xdr, struct nlm4_lock *ptr)
130 {
131 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXSTRLEN))
132 		return false;
133 	if (!xdrgen_decode_netobj(xdr, &ptr->fh))
134 		return false;
135 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
136 		return false;
137 	if (!xdrgen_decode_int32(xdr, &ptr->svid))
138 		return false;
139 	if (!xdrgen_decode_uint64(xdr, &ptr->l_offset))
140 		return false;
141 	if (!xdrgen_decode_uint64(xdr, &ptr->l_len))
142 		return false;
143 	return true;
144 }
145 
146 static bool __maybe_unused
147 xdrgen_decode_nlm4_lockargs(struct xdr_stream *xdr, struct nlm4_lockargs *ptr)
148 {
149 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
150 		return false;
151 	if (!xdrgen_decode_bool(xdr, &ptr->block))
152 		return false;
153 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
154 		return false;
155 	if (!xdrgen_decode_nlm4_lock(xdr, &ptr->alock))
156 		return false;
157 	if (!xdrgen_decode_bool(xdr, &ptr->reclaim))
158 		return false;
159 	if (!xdrgen_decode_int32(xdr, &ptr->state))
160 		return false;
161 	return true;
162 }
163 
164 static bool __maybe_unused
165 xdrgen_decode_nlm4_cancargs(struct xdr_stream *xdr, struct nlm4_cancargs *ptr)
166 {
167 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
168 		return false;
169 	if (!xdrgen_decode_bool(xdr, &ptr->block))
170 		return false;
171 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
172 		return false;
173 	if (!xdrgen_decode_nlm4_lock(xdr, &ptr->alock))
174 		return false;
175 	return true;
176 }
177 
178 static bool __maybe_unused
179 xdrgen_decode_nlm4_testargs(struct xdr_stream *xdr, struct nlm4_testargs *ptr)
180 {
181 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
182 		return false;
183 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
184 		return false;
185 	if (!xdrgen_decode_nlm4_lock(xdr, &ptr->alock))
186 		return false;
187 	return true;
188 }
189 
190 static bool __maybe_unused
191 xdrgen_decode_nlm4_unlockargs(struct xdr_stream *xdr, struct nlm4_unlockargs *ptr)
192 {
193 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
194 		return false;
195 	if (!xdrgen_decode_nlm4_lock(xdr, &ptr->alock))
196 		return false;
197 	return true;
198 }
199 
200 static bool __maybe_unused
201 xdrgen_decode_nlm4_share(struct xdr_stream *xdr, struct nlm4_share *ptr)
202 {
203 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXSTRLEN))
204 		return false;
205 	if (!xdrgen_decode_netobj(xdr, &ptr->fh))
206 		return false;
207 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
208 		return false;
209 	if (!xdrgen_decode_fsh4_mode(xdr, &ptr->mode))
210 		return false;
211 	if (!xdrgen_decode_fsh4_access(xdr, &ptr->access))
212 		return false;
213 	return true;
214 }
215 
216 static bool __maybe_unused
217 xdrgen_decode_nlm4_shareargs(struct xdr_stream *xdr, struct nlm4_shareargs *ptr)
218 {
219 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
220 		return false;
221 	if (!xdrgen_decode_nlm4_share(xdr, &ptr->share))
222 		return false;
223 	if (!xdrgen_decode_bool(xdr, &ptr->reclaim))
224 		return false;
225 	return true;
226 }
227 
228 static bool __maybe_unused
229 xdrgen_decode_nlm4_shareres(struct xdr_stream *xdr, struct nlm4_shareres *ptr)
230 {
231 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
232 		return false;
233 	if (!xdrgen_decode_nlm4_stats(xdr, &ptr->stat))
234 		return false;
235 	if (!xdrgen_decode_int32(xdr, &ptr->sequence))
236 		return false;
237 	return true;
238 }
239 
240 static bool __maybe_unused
241 xdrgen_decode_nlm4_notify(struct xdr_stream *xdr, struct nlm4_notify *ptr)
242 {
243 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXNAMELEN))
244 		return false;
245 	if (!xdrgen_decode_int32(xdr, &ptr->state))
246 		return false;
247 	return true;
248 }
249 
250 static bool __maybe_unused
251 xdrgen_decode_nlm4_notifyargs(struct xdr_stream *xdr, struct nlm4_notifyargs *ptr)
252 {
253 	if (!xdrgen_decode_nlm4_notify(xdr, &ptr->notify))
254 		return false;
255 	if (xdr_stream_decode_opaque_fixed(xdr, ptr->private, SM_PRIV_SIZE) < 0)
256 		return false;
257 	return true;
258 }
259 
260 /**
261  * nlm4_svc_decode_void - Decode a void argument
262  * @rqstp: RPC transaction context
263  * @xdr: source XDR data stream
264  *
265  * Return values:
266  *   %true: procedure arguments decoded successfully
267  *   %false: decode failed
268  */
269 bool nlm4_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
270 {
271 	return xdrgen_decode_void(xdr);
272 }
273 
274 /**
275  * nlm4_svc_decode_nlm4_testargs - Decode a nlm4_testargs argument
276  * @rqstp: RPC transaction context
277  * @xdr: source XDR data stream
278  *
279  * Return values:
280  *   %true: procedure arguments decoded successfully
281  *   %false: decode failed
282  */
283 bool nlm4_svc_decode_nlm4_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
284 {
285 	struct nlm4_testargs *argp = rqstp->rq_argp;
286 
287 	return xdrgen_decode_nlm4_testargs(xdr, argp);
288 }
289 
290 /**
291  * nlm4_svc_decode_nlm4_lockargs - Decode a nlm4_lockargs argument
292  * @rqstp: RPC transaction context
293  * @xdr: source XDR data stream
294  *
295  * Return values:
296  *   %true: procedure arguments decoded successfully
297  *   %false: decode failed
298  */
299 bool nlm4_svc_decode_nlm4_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
300 {
301 	struct nlm4_lockargs *argp = rqstp->rq_argp;
302 
303 	return xdrgen_decode_nlm4_lockargs(xdr, argp);
304 }
305 
306 /**
307  * nlm4_svc_decode_nlm4_cancargs - Decode a nlm4_cancargs argument
308  * @rqstp: RPC transaction context
309  * @xdr: source XDR data stream
310  *
311  * Return values:
312  *   %true: procedure arguments decoded successfully
313  *   %false: decode failed
314  */
315 bool nlm4_svc_decode_nlm4_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
316 {
317 	struct nlm4_cancargs *argp = rqstp->rq_argp;
318 
319 	return xdrgen_decode_nlm4_cancargs(xdr, argp);
320 }
321 
322 /**
323  * nlm4_svc_decode_nlm4_unlockargs - Decode a nlm4_unlockargs argument
324  * @rqstp: RPC transaction context
325  * @xdr: source XDR data stream
326  *
327  * Return values:
328  *   %true: procedure arguments decoded successfully
329  *   %false: decode failed
330  */
331 bool nlm4_svc_decode_nlm4_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
332 {
333 	struct nlm4_unlockargs *argp = rqstp->rq_argp;
334 
335 	return xdrgen_decode_nlm4_unlockargs(xdr, argp);
336 }
337 
338 /**
339  * nlm4_svc_decode_nlm4_testres - Decode a nlm4_testres argument
340  * @rqstp: RPC transaction context
341  * @xdr: source XDR data stream
342  *
343  * Return values:
344  *   %true: procedure arguments decoded successfully
345  *   %false: decode failed
346  */
347 bool nlm4_svc_decode_nlm4_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
348 {
349 	struct nlm4_testres *argp = rqstp->rq_argp;
350 
351 	return xdrgen_decode_nlm4_testres(xdr, argp);
352 }
353 
354 /**
355  * nlm4_svc_decode_nlm4_res - Decode a nlm4_res argument
356  * @rqstp: RPC transaction context
357  * @xdr: source XDR data stream
358  *
359  * Return values:
360  *   %true: procedure arguments decoded successfully
361  *   %false: decode failed
362  */
363 bool nlm4_svc_decode_nlm4_res(struct svc_rqst *rqstp, struct xdr_stream *xdr)
364 {
365 	struct nlm4_res *argp = rqstp->rq_argp;
366 
367 	return xdrgen_decode_nlm4_res(xdr, argp);
368 }
369 
370 /**
371  * nlm4_svc_decode_nlm4_notifyargs - Decode a nlm4_notifyargs argument
372  * @rqstp: RPC transaction context
373  * @xdr: source XDR data stream
374  *
375  * Return values:
376  *   %true: procedure arguments decoded successfully
377  *   %false: decode failed
378  */
379 bool nlm4_svc_decode_nlm4_notifyargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
380 {
381 	struct nlm4_notifyargs *argp = rqstp->rq_argp;
382 
383 	return xdrgen_decode_nlm4_notifyargs(xdr, argp);
384 }
385 
386 /**
387  * nlm4_svc_decode_nlm4_shareargs - Decode a nlm4_shareargs argument
388  * @rqstp: RPC transaction context
389  * @xdr: source XDR data stream
390  *
391  * Return values:
392  *   %true: procedure arguments decoded successfully
393  *   %false: decode failed
394  */
395 bool nlm4_svc_decode_nlm4_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
396 {
397 	struct nlm4_shareargs *argp = rqstp->rq_argp;
398 
399 	return xdrgen_decode_nlm4_shareargs(xdr, argp);
400 }
401 
402 /**
403  * nlm4_svc_decode_nlm4_notify - Decode a nlm4_notify argument
404  * @rqstp: RPC transaction context
405  * @xdr: source XDR data stream
406  *
407  * Return values:
408  *   %true: procedure arguments decoded successfully
409  *   %false: decode failed
410  */
411 bool nlm4_svc_decode_nlm4_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr)
412 {
413 	struct nlm4_notify *argp = rqstp->rq_argp;
414 
415 	return xdrgen_decode_nlm4_notify(xdr, argp);
416 }
417 
418 static bool __maybe_unused
419 xdrgen_encode_netobj(struct xdr_stream *xdr, const netobj value)
420 {
421 	return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
422 }
423 
424 static bool __maybe_unused
425 xdrgen_encode_fsh4_mode(struct xdr_stream *xdr, fsh4_mode value)
426 {
427 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
428 }
429 
430 static bool __maybe_unused
431 xdrgen_encode_fsh4_access(struct xdr_stream *xdr, fsh4_access value)
432 {
433 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
434 }
435 
436 static bool __maybe_unused
437 xdrgen_encode_uint64(struct xdr_stream *xdr, const uint64 value)
438 {
439 	return xdrgen_encode_unsigned_hyper(xdr, value);
440 }
441 
442 static bool __maybe_unused
443 xdrgen_encode_int64(struct xdr_stream *xdr, const int64 value)
444 {
445 	return xdrgen_encode_hyper(xdr, value);
446 }
447 
448 static bool __maybe_unused
449 xdrgen_encode_uint32(struct xdr_stream *xdr, const uint32 value)
450 {
451 	return xdrgen_encode_unsigned_long(xdr, value);
452 }
453 
454 static bool __maybe_unused
455 xdrgen_encode_int32(struct xdr_stream *xdr, const int32 value)
456 {
457 	return xdrgen_encode_long(xdr, value);
458 }
459 
460 static bool __maybe_unused
461 xdrgen_encode_nlm4_stats(struct xdr_stream *xdr, nlm4_stats value)
462 {
463 	return xdr_stream_encode_be32(xdr, value) == XDR_UNIT;
464 }
465 
466 static bool __maybe_unused
467 xdrgen_encode_nlm4_holder(struct xdr_stream *xdr, const struct nlm4_holder *value)
468 {
469 	if (!xdrgen_encode_bool(xdr, value->exclusive))
470 		return false;
471 	if (!xdrgen_encode_int32(xdr, value->svid))
472 		return false;
473 	if (!xdrgen_encode_netobj(xdr, value->oh))
474 		return false;
475 	if (!xdrgen_encode_uint64(xdr, value->l_offset))
476 		return false;
477 	if (!xdrgen_encode_uint64(xdr, value->l_len))
478 		return false;
479 	return true;
480 }
481 
482 static bool __maybe_unused
483 xdrgen_encode_nlm4_testrply(struct xdr_stream *xdr, const struct nlm4_testrply *ptr)
484 {
485 	if (!xdrgen_encode_nlm4_stats(xdr, ptr->stat))
486 		return false;
487 	switch (ptr->stat) {
488 	case __constant_cpu_to_be32(NLM4_DENIED):
489 		if (!xdrgen_encode_nlm4_holder(xdr, &ptr->u.holder))
490 			return false;
491 		break;
492 	default:
493 		break;
494 	}
495 	return true;
496 }
497 
498 static bool __maybe_unused
499 xdrgen_encode_nlm4_stat(struct xdr_stream *xdr, const struct nlm4_stat *value)
500 {
501 	if (!xdrgen_encode_nlm4_stats(xdr, value->stat))
502 		return false;
503 	return true;
504 }
505 
506 static bool __maybe_unused
507 xdrgen_encode_nlm4_res(struct xdr_stream *xdr, const struct nlm4_res *value)
508 {
509 	if (!xdrgen_encode_netobj(xdr, value->cookie))
510 		return false;
511 	if (!xdrgen_encode_nlm4_stat(xdr, &value->stat))
512 		return false;
513 	return true;
514 }
515 
516 static bool __maybe_unused
517 xdrgen_encode_nlm4_testres(struct xdr_stream *xdr, const struct nlm4_testres *value)
518 {
519 	if (!xdrgen_encode_netobj(xdr, value->cookie))
520 		return false;
521 	if (!xdrgen_encode_nlm4_testrply(xdr, &value->stat))
522 		return false;
523 	return true;
524 }
525 
526 static bool __maybe_unused
527 xdrgen_encode_nlm4_lock(struct xdr_stream *xdr, const struct nlm4_lock *value)
528 {
529 	if (value->caller_name.len > LM_MAXSTRLEN)
530 		return false;
531 	if (xdr_stream_encode_opaque(xdr, value->caller_name.data, value->caller_name.len) < 0)
532 		return false;
533 	if (!xdrgen_encode_netobj(xdr, value->fh))
534 		return false;
535 	if (!xdrgen_encode_netobj(xdr, value->oh))
536 		return false;
537 	if (!xdrgen_encode_int32(xdr, value->svid))
538 		return false;
539 	if (!xdrgen_encode_uint64(xdr, value->l_offset))
540 		return false;
541 	if (!xdrgen_encode_uint64(xdr, value->l_len))
542 		return false;
543 	return true;
544 }
545 
546 static bool __maybe_unused
547 xdrgen_encode_nlm4_lockargs(struct xdr_stream *xdr, const struct nlm4_lockargs *value)
548 {
549 	if (!xdrgen_encode_netobj(xdr, value->cookie))
550 		return false;
551 	if (!xdrgen_encode_bool(xdr, value->block))
552 		return false;
553 	if (!xdrgen_encode_bool(xdr, value->exclusive))
554 		return false;
555 	if (!xdrgen_encode_nlm4_lock(xdr, &value->alock))
556 		return false;
557 	if (!xdrgen_encode_bool(xdr, value->reclaim))
558 		return false;
559 	if (!xdrgen_encode_int32(xdr, value->state))
560 		return false;
561 	return true;
562 }
563 
564 static bool __maybe_unused
565 xdrgen_encode_nlm4_cancargs(struct xdr_stream *xdr, const struct nlm4_cancargs *value)
566 {
567 	if (!xdrgen_encode_netobj(xdr, value->cookie))
568 		return false;
569 	if (!xdrgen_encode_bool(xdr, value->block))
570 		return false;
571 	if (!xdrgen_encode_bool(xdr, value->exclusive))
572 		return false;
573 	if (!xdrgen_encode_nlm4_lock(xdr, &value->alock))
574 		return false;
575 	return true;
576 }
577 
578 static bool __maybe_unused
579 xdrgen_encode_nlm4_testargs(struct xdr_stream *xdr, const struct nlm4_testargs *value)
580 {
581 	if (!xdrgen_encode_netobj(xdr, value->cookie))
582 		return false;
583 	if (!xdrgen_encode_bool(xdr, value->exclusive))
584 		return false;
585 	if (!xdrgen_encode_nlm4_lock(xdr, &value->alock))
586 		return false;
587 	return true;
588 }
589 
590 static bool __maybe_unused
591 xdrgen_encode_nlm4_unlockargs(struct xdr_stream *xdr, const struct nlm4_unlockargs *value)
592 {
593 	if (!xdrgen_encode_netobj(xdr, value->cookie))
594 		return false;
595 	if (!xdrgen_encode_nlm4_lock(xdr, &value->alock))
596 		return false;
597 	return true;
598 }
599 
600 static bool __maybe_unused
601 xdrgen_encode_nlm4_share(struct xdr_stream *xdr, const struct nlm4_share *value)
602 {
603 	if (value->caller_name.len > LM_MAXSTRLEN)
604 		return false;
605 	if (xdr_stream_encode_opaque(xdr, value->caller_name.data, value->caller_name.len) < 0)
606 		return false;
607 	if (!xdrgen_encode_netobj(xdr, value->fh))
608 		return false;
609 	if (!xdrgen_encode_netobj(xdr, value->oh))
610 		return false;
611 	if (!xdrgen_encode_fsh4_mode(xdr, value->mode))
612 		return false;
613 	if (!xdrgen_encode_fsh4_access(xdr, value->access))
614 		return false;
615 	return true;
616 }
617 
618 static bool __maybe_unused
619 xdrgen_encode_nlm4_shareargs(struct xdr_stream *xdr, const struct nlm4_shareargs *value)
620 {
621 	if (!xdrgen_encode_netobj(xdr, value->cookie))
622 		return false;
623 	if (!xdrgen_encode_nlm4_share(xdr, &value->share))
624 		return false;
625 	if (!xdrgen_encode_bool(xdr, value->reclaim))
626 		return false;
627 	return true;
628 }
629 
630 static bool __maybe_unused
631 xdrgen_encode_nlm4_shareres(struct xdr_stream *xdr, const struct nlm4_shareres *value)
632 {
633 	if (!xdrgen_encode_netobj(xdr, value->cookie))
634 		return false;
635 	if (!xdrgen_encode_nlm4_stats(xdr, value->stat))
636 		return false;
637 	if (!xdrgen_encode_int32(xdr, value->sequence))
638 		return false;
639 	return true;
640 }
641 
642 static bool __maybe_unused
643 xdrgen_encode_nlm4_notify(struct xdr_stream *xdr, const struct nlm4_notify *value)
644 {
645 	if (value->name.len > LM_MAXNAMELEN)
646 		return false;
647 	if (xdr_stream_encode_opaque(xdr, value->name.data, value->name.len) < 0)
648 		return false;
649 	if (!xdrgen_encode_int32(xdr, value->state))
650 		return false;
651 	return true;
652 }
653 
654 static bool __maybe_unused
655 xdrgen_encode_nlm4_notifyargs(struct xdr_stream *xdr, const struct nlm4_notifyargs *value)
656 {
657 	if (!xdrgen_encode_nlm4_notify(xdr, &value->notify))
658 		return false;
659 	if (xdr_stream_encode_opaque_fixed(xdr, value->private, SM_PRIV_SIZE) < 0)
660 		return false;
661 	return true;
662 }
663 
664 /**
665  * nlm4_svc_encode_void - Encode a void result
666  * @rqstp: RPC transaction context
667  * @xdr: target XDR data stream
668  *
669  * Return values:
670  *   %true: procedure results encoded successfully
671  *   %false: encode failed
672  */
673 bool nlm4_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
674 {
675 	return xdrgen_encode_void(xdr);
676 }
677 
678 /**
679  * nlm4_svc_encode_nlm4_testres - Encode a nlm4_testres result
680  * @rqstp: RPC transaction context
681  * @xdr: target XDR data stream
682  *
683  * Return values:
684  *   %true: procedure results encoded successfully
685  *   %false: encode failed
686  */
687 bool nlm4_svc_encode_nlm4_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
688 {
689 	struct nlm4_testres *resp = rqstp->rq_resp;
690 
691 	return xdrgen_encode_nlm4_testres(xdr, resp);
692 }
693 
694 /**
695  * nlm4_svc_encode_nlm4_res - Encode a nlm4_res result
696  * @rqstp: RPC transaction context
697  * @xdr: target XDR data stream
698  *
699  * Return values:
700  *   %true: procedure results encoded successfully
701  *   %false: encode failed
702  */
703 bool nlm4_svc_encode_nlm4_res(struct svc_rqst *rqstp, struct xdr_stream *xdr)
704 {
705 	struct nlm4_res *resp = rqstp->rq_resp;
706 
707 	return xdrgen_encode_nlm4_res(xdr, resp);
708 }
709 
710 /**
711  * nlm4_svc_encode_nlm4_shareres - Encode a nlm4_shareres result
712  * @rqstp: RPC transaction context
713  * @xdr: target XDR data stream
714  *
715  * Return values:
716  *   %true: procedure results encoded successfully
717  *   %false: encode failed
718  */
719 bool nlm4_svc_encode_nlm4_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
720 {
721 	struct nlm4_shareres *resp = rqstp->rq_resp;
722 
723 	return xdrgen_encode_nlm4_shareres(xdr, resp);
724 }
725