xref: /linux/fs/lockd/nlm3xdr_gen.c (revision 0eaed89c18aeedf0898baf2dbf5ff027c6795152)
1 // SPDX-License-Identifier: GPL-2.0
2 // Generated by xdrgen. Manual edits will be lost.
3 // XDR specification file: ../../Documentation/sunrpc/xdr/nlm3.x
4 // XDR specification modification time: Thu Apr 23 10:56:34 2026
5 
6 #include <linux/sunrpc/svc.h>
7 
8 #include "nlm3xdr_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_nlm_stats(struct xdr_stream *xdr, nlm_stats *ptr)
18 {
19 	__be32 raw;
20 	u32 val;
21 
22 	if (xdr_stream_decode_be32(xdr, &raw) < 0)
23 		return false;
24 	val = be32_to_cpu(raw);
25 	/* Compiler may optimize to a range check for dense enums */
26 	switch (val) {
27 	case LCK_GRANTED:
28 	case LCK_DENIED:
29 	case LCK_DENIED_NOLOCKS:
30 	case LCK_BLOCKED:
31 	case LCK_DENIED_GRACE_PERIOD:
32 		break;
33 	default:
34 		return false;
35 	}
36 	*ptr = raw;
37 	return true;
38 }
39 
40 static bool __maybe_unused
41 xdrgen_decode_nlm_stat(struct xdr_stream *xdr, struct nlm_stat *ptr)
42 {
43 	if (!xdrgen_decode_nlm_stats(xdr, &ptr->stat))
44 		return false;
45 	return true;
46 }
47 
48 static bool __maybe_unused
49 xdrgen_decode_nlm_res(struct xdr_stream *xdr, struct nlm_res *ptr)
50 {
51 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
52 		return false;
53 	if (!xdrgen_decode_nlm_stat(xdr, &ptr->stat))
54 		return false;
55 	return true;
56 }
57 
58 static bool __maybe_unused
59 xdrgen_decode_nlm_holder(struct xdr_stream *xdr, struct nlm_holder *ptr)
60 {
61 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
62 		return false;
63 	if (!xdrgen_decode_int(xdr, &ptr->uppid))
64 		return false;
65 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
66 		return false;
67 	if (!xdrgen_decode_unsigned_int(xdr, &ptr->l_offset))
68 		return false;
69 	if (!xdrgen_decode_unsigned_int(xdr, &ptr->l_len))
70 		return false;
71 	return true;
72 }
73 
74 static bool __maybe_unused
75 xdrgen_decode_nlm_testrply(struct xdr_stream *xdr, struct nlm_testrply *ptr)
76 {
77 	if (!xdrgen_decode_nlm_stats(xdr, &ptr->stat))
78 		return false;
79 	switch (ptr->stat) {
80 	case __constant_cpu_to_be32(LCK_DENIED):
81 		if (!xdrgen_decode_nlm_holder(xdr, &ptr->u.holder))
82 			return false;
83 		break;
84 	default:
85 		break;
86 	}
87 	return true;
88 }
89 
90 static bool __maybe_unused
91 xdrgen_decode_nlm_testres(struct xdr_stream *xdr, struct nlm_testres *ptr)
92 {
93 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
94 		return false;
95 	if (!xdrgen_decode_nlm_testrply(xdr, &ptr->test_stat))
96 		return false;
97 	return true;
98 }
99 
100 static bool __maybe_unused
101 xdrgen_decode_nlm_lock(struct xdr_stream *xdr, struct nlm_lock *ptr)
102 {
103 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXSTRLEN))
104 		return false;
105 	if (!xdrgen_decode_netobj(xdr, &ptr->fh))
106 		return false;
107 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
108 		return false;
109 	if (!xdrgen_decode_int(xdr, &ptr->uppid))
110 		return false;
111 	if (!xdrgen_decode_unsigned_int(xdr, &ptr->l_offset))
112 		return false;
113 	if (!xdrgen_decode_unsigned_int(xdr, &ptr->l_len))
114 		return false;
115 	return true;
116 }
117 
118 static bool __maybe_unused
119 xdrgen_decode_nlm_lockargs(struct xdr_stream *xdr, struct nlm_lockargs *ptr)
120 {
121 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
122 		return false;
123 	if (!xdrgen_decode_bool(xdr, &ptr->block))
124 		return false;
125 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
126 		return false;
127 	if (!xdrgen_decode_nlm_lock(xdr, &ptr->alock))
128 		return false;
129 	if (!xdrgen_decode_bool(xdr, &ptr->reclaim))
130 		return false;
131 	if (!xdrgen_decode_int(xdr, &ptr->state))
132 		return false;
133 	return true;
134 }
135 
136 static bool __maybe_unused
137 xdrgen_decode_nlm_cancargs(struct xdr_stream *xdr, struct nlm_cancargs *ptr)
138 {
139 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
140 		return false;
141 	if (!xdrgen_decode_bool(xdr, &ptr->block))
142 		return false;
143 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
144 		return false;
145 	if (!xdrgen_decode_nlm_lock(xdr, &ptr->alock))
146 		return false;
147 	return true;
148 }
149 
150 static bool __maybe_unused
151 xdrgen_decode_nlm_testargs(struct xdr_stream *xdr, struct nlm_testargs *ptr)
152 {
153 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
154 		return false;
155 	if (!xdrgen_decode_bool(xdr, &ptr->exclusive))
156 		return false;
157 	if (!xdrgen_decode_nlm_lock(xdr, &ptr->alock))
158 		return false;
159 	return true;
160 }
161 
162 static bool __maybe_unused
163 xdrgen_decode_nlm_unlockargs(struct xdr_stream *xdr, struct nlm_unlockargs *ptr)
164 {
165 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
166 		return false;
167 	if (!xdrgen_decode_nlm_lock(xdr, &ptr->alock))
168 		return false;
169 	return true;
170 }
171 
172 static bool __maybe_unused
173 xdrgen_decode_fsh_mode(struct xdr_stream *xdr, fsh_mode *ptr)
174 {
175 	u32 val;
176 
177 	if (xdr_stream_decode_u32(xdr, &val) < 0)
178 		return false;
179 	/* Compiler may optimize to a range check for dense enums */
180 	switch (val) {
181 	case fsm_DN:
182 	case fsm_DR:
183 	case fsm_DW:
184 	case fsm_DRW:
185 		break;
186 	default:
187 		return false;
188 	}
189 	*ptr = val;
190 	return true;
191 }
192 
193 static bool __maybe_unused
194 xdrgen_decode_fsh_access(struct xdr_stream *xdr, fsh_access *ptr)
195 {
196 	u32 val;
197 
198 	if (xdr_stream_decode_u32(xdr, &val) < 0)
199 		return false;
200 	/* Compiler may optimize to a range check for dense enums */
201 	switch (val) {
202 	case fsa_NONE:
203 	case fsa_R:
204 	case fsa_W:
205 	case fsa_RW:
206 		break;
207 	default:
208 		return false;
209 	}
210 	*ptr = val;
211 	return true;
212 }
213 
214 static bool __maybe_unused
215 xdrgen_decode_nlm_share(struct xdr_stream *xdr, struct nlm_share *ptr)
216 {
217 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXSTRLEN))
218 		return false;
219 	if (!xdrgen_decode_netobj(xdr, &ptr->fh))
220 		return false;
221 	if (!xdrgen_decode_netobj(xdr, &ptr->oh))
222 		return false;
223 	if (!xdrgen_decode_fsh_mode(xdr, &ptr->mode))
224 		return false;
225 	if (!xdrgen_decode_fsh_access(xdr, &ptr->access))
226 		return false;
227 	return true;
228 }
229 
230 static bool __maybe_unused
231 xdrgen_decode_nlm_shareargs(struct xdr_stream *xdr, struct nlm_shareargs *ptr)
232 {
233 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
234 		return false;
235 	if (!xdrgen_decode_nlm_share(xdr, &ptr->share))
236 		return false;
237 	if (!xdrgen_decode_bool(xdr, &ptr->reclaim))
238 		return false;
239 	return true;
240 }
241 
242 static bool __maybe_unused
243 xdrgen_decode_nlm_shareres(struct xdr_stream *xdr, struct nlm_shareres *ptr)
244 {
245 	if (!xdrgen_decode_netobj(xdr, &ptr->cookie))
246 		return false;
247 	if (!xdrgen_decode_nlm_stats(xdr, &ptr->stat))
248 		return false;
249 	if (!xdrgen_decode_int(xdr, &ptr->sequence))
250 		return false;
251 	return true;
252 }
253 
254 static bool __maybe_unused
255 xdrgen_decode_nlm_notify(struct xdr_stream *xdr, struct nlm_notify *ptr)
256 {
257 	if (!xdrgen_decode_string(xdr, (string *)ptr, LM_MAXNAMELEN))
258 		return false;
259 	if (!xdrgen_decode_long(xdr, &ptr->state))
260 		return false;
261 	return true;
262 }
263 
264 static bool __maybe_unused
265 xdrgen_decode_nlm_notifyargs(struct xdr_stream *xdr, struct nlm_notifyargs *ptr)
266 {
267 	if (!xdrgen_decode_nlm_notify(xdr, &ptr->notify))
268 		return false;
269 	if (xdr_stream_decode_opaque_fixed(xdr, ptr->private, SM_PRIV_SIZE) < 0)
270 		return false;
271 	return true;
272 }
273 
274 /**
275  * nlm_svc_decode_void - Decode a void 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 nlm_svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
284 {
285 	return xdrgen_decode_void(xdr);
286 }
287 
288 /**
289  * nlm_svc_decode_nlm_testargs - Decode a nlm_testargs argument
290  * @rqstp: RPC transaction context
291  * @xdr: source XDR data stream
292  *
293  * Return values:
294  *   %true: procedure arguments decoded successfully
295  *   %false: decode failed
296  */
297 bool nlm_svc_decode_nlm_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
298 {
299 	struct nlm_testargs *argp = rqstp->rq_argp;
300 
301 	return xdrgen_decode_nlm_testargs(xdr, argp);
302 }
303 
304 /**
305  * nlm_svc_decode_nlm_lockargs - Decode a nlm_lockargs argument
306  * @rqstp: RPC transaction context
307  * @xdr: source XDR data stream
308  *
309  * Return values:
310  *   %true: procedure arguments decoded successfully
311  *   %false: decode failed
312  */
313 bool nlm_svc_decode_nlm_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
314 {
315 	struct nlm_lockargs *argp = rqstp->rq_argp;
316 
317 	return xdrgen_decode_nlm_lockargs(xdr, argp);
318 }
319 
320 /**
321  * nlm_svc_decode_nlm_cancargs - Decode a nlm_cancargs argument
322  * @rqstp: RPC transaction context
323  * @xdr: source XDR data stream
324  *
325  * Return values:
326  *   %true: procedure arguments decoded successfully
327  *   %false: decode failed
328  */
329 bool nlm_svc_decode_nlm_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
330 {
331 	struct nlm_cancargs *argp = rqstp->rq_argp;
332 
333 	return xdrgen_decode_nlm_cancargs(xdr, argp);
334 }
335 
336 /**
337  * nlm_svc_decode_nlm_unlockargs - Decode a nlm_unlockargs argument
338  * @rqstp: RPC transaction context
339  * @xdr: source XDR data stream
340  *
341  * Return values:
342  *   %true: procedure arguments decoded successfully
343  *   %false: decode failed
344  */
345 bool nlm_svc_decode_nlm_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
346 {
347 	struct nlm_unlockargs *argp = rqstp->rq_argp;
348 
349 	return xdrgen_decode_nlm_unlockargs(xdr, argp);
350 }
351 
352 /**
353  * nlm_svc_decode_nlm_testres - Decode a nlm_testres argument
354  * @rqstp: RPC transaction context
355  * @xdr: source XDR data stream
356  *
357  * Return values:
358  *   %true: procedure arguments decoded successfully
359  *   %false: decode failed
360  */
361 bool nlm_svc_decode_nlm_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
362 {
363 	struct nlm_testres *argp = rqstp->rq_argp;
364 
365 	return xdrgen_decode_nlm_testres(xdr, argp);
366 }
367 
368 /**
369  * nlm_svc_decode_nlm_res - Decode a nlm_res argument
370  * @rqstp: RPC transaction context
371  * @xdr: source XDR data stream
372  *
373  * Return values:
374  *   %true: procedure arguments decoded successfully
375  *   %false: decode failed
376  */
377 bool nlm_svc_decode_nlm_res(struct svc_rqst *rqstp, struct xdr_stream *xdr)
378 {
379 	struct nlm_res *argp = rqstp->rq_argp;
380 
381 	return xdrgen_decode_nlm_res(xdr, argp);
382 }
383 
384 /**
385  * nlm_svc_decode_nlm_notifyargs - Decode a nlm_notifyargs argument
386  * @rqstp: RPC transaction context
387  * @xdr: source XDR data stream
388  *
389  * Return values:
390  *   %true: procedure arguments decoded successfully
391  *   %false: decode failed
392  */
393 bool nlm_svc_decode_nlm_notifyargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
394 {
395 	struct nlm_notifyargs *argp = rqstp->rq_argp;
396 
397 	return xdrgen_decode_nlm_notifyargs(xdr, argp);
398 }
399 
400 /**
401  * nlm_svc_decode_nlm_shareargs - Decode a nlm_shareargs argument
402  * @rqstp: RPC transaction context
403  * @xdr: source XDR data stream
404  *
405  * Return values:
406  *   %true: procedure arguments decoded successfully
407  *   %false: decode failed
408  */
409 bool nlm_svc_decode_nlm_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
410 {
411 	struct nlm_shareargs *argp = rqstp->rq_argp;
412 
413 	return xdrgen_decode_nlm_shareargs(xdr, argp);
414 }
415 
416 /**
417  * nlm_svc_decode_nlm_notify - Decode a nlm_notify argument
418  * @rqstp: RPC transaction context
419  * @xdr: source XDR data stream
420  *
421  * Return values:
422  *   %true: procedure arguments decoded successfully
423  *   %false: decode failed
424  */
425 bool nlm_svc_decode_nlm_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr)
426 {
427 	struct nlm_notify *argp = rqstp->rq_argp;
428 
429 	return xdrgen_decode_nlm_notify(xdr, argp);
430 }
431 
432 static bool __maybe_unused
433 xdrgen_encode_netobj(struct xdr_stream *xdr, const netobj value)
434 {
435 	return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
436 }
437 
438 static bool __maybe_unused
439 xdrgen_encode_nlm_stats(struct xdr_stream *xdr, nlm_stats value)
440 {
441 	return xdr_stream_encode_be32(xdr, value) == XDR_UNIT;
442 }
443 
444 static bool __maybe_unused
445 xdrgen_encode_nlm_stat(struct xdr_stream *xdr, const struct nlm_stat *value)
446 {
447 	if (!xdrgen_encode_nlm_stats(xdr, value->stat))
448 		return false;
449 	return true;
450 }
451 
452 static bool __maybe_unused
453 xdrgen_encode_nlm_res(struct xdr_stream *xdr, const struct nlm_res *value)
454 {
455 	if (!xdrgen_encode_netobj(xdr, value->cookie))
456 		return false;
457 	if (!xdrgen_encode_nlm_stat(xdr, &value->stat))
458 		return false;
459 	return true;
460 }
461 
462 static bool __maybe_unused
463 xdrgen_encode_nlm_holder(struct xdr_stream *xdr, const struct nlm_holder *value)
464 {
465 	if (!xdrgen_encode_bool(xdr, value->exclusive))
466 		return false;
467 	if (!xdrgen_encode_int(xdr, value->uppid))
468 		return false;
469 	if (!xdrgen_encode_netobj(xdr, value->oh))
470 		return false;
471 	if (!xdrgen_encode_unsigned_int(xdr, value->l_offset))
472 		return false;
473 	if (!xdrgen_encode_unsigned_int(xdr, value->l_len))
474 		return false;
475 	return true;
476 }
477 
478 static bool __maybe_unused
479 xdrgen_encode_nlm_testrply(struct xdr_stream *xdr, const struct nlm_testrply *ptr)
480 {
481 	if (!xdrgen_encode_nlm_stats(xdr, ptr->stat))
482 		return false;
483 	switch (ptr->stat) {
484 	case __constant_cpu_to_be32(LCK_DENIED):
485 		if (!xdrgen_encode_nlm_holder(xdr, &ptr->u.holder))
486 			return false;
487 		break;
488 	default:
489 		break;
490 	}
491 	return true;
492 }
493 
494 static bool __maybe_unused
495 xdrgen_encode_nlm_testres(struct xdr_stream *xdr, const struct nlm_testres *value)
496 {
497 	if (!xdrgen_encode_netobj(xdr, value->cookie))
498 		return false;
499 	if (!xdrgen_encode_nlm_testrply(xdr, &value->test_stat))
500 		return false;
501 	return true;
502 }
503 
504 static bool __maybe_unused
505 xdrgen_encode_nlm_lock(struct xdr_stream *xdr, const struct nlm_lock *value)
506 {
507 	if (value->caller_name.len > LM_MAXSTRLEN)
508 		return false;
509 	if (xdr_stream_encode_opaque(xdr, value->caller_name.data, value->caller_name.len) < 0)
510 		return false;
511 	if (!xdrgen_encode_netobj(xdr, value->fh))
512 		return false;
513 	if (!xdrgen_encode_netobj(xdr, value->oh))
514 		return false;
515 	if (!xdrgen_encode_int(xdr, value->uppid))
516 		return false;
517 	if (!xdrgen_encode_unsigned_int(xdr, value->l_offset))
518 		return false;
519 	if (!xdrgen_encode_unsigned_int(xdr, value->l_len))
520 		return false;
521 	return true;
522 }
523 
524 static bool __maybe_unused
525 xdrgen_encode_nlm_lockargs(struct xdr_stream *xdr, const struct nlm_lockargs *value)
526 {
527 	if (!xdrgen_encode_netobj(xdr, value->cookie))
528 		return false;
529 	if (!xdrgen_encode_bool(xdr, value->block))
530 		return false;
531 	if (!xdrgen_encode_bool(xdr, value->exclusive))
532 		return false;
533 	if (!xdrgen_encode_nlm_lock(xdr, &value->alock))
534 		return false;
535 	if (!xdrgen_encode_bool(xdr, value->reclaim))
536 		return false;
537 	if (!xdrgen_encode_int(xdr, value->state))
538 		return false;
539 	return true;
540 }
541 
542 static bool __maybe_unused
543 xdrgen_encode_nlm_cancargs(struct xdr_stream *xdr, const struct nlm_cancargs *value)
544 {
545 	if (!xdrgen_encode_netobj(xdr, value->cookie))
546 		return false;
547 	if (!xdrgen_encode_bool(xdr, value->block))
548 		return false;
549 	if (!xdrgen_encode_bool(xdr, value->exclusive))
550 		return false;
551 	if (!xdrgen_encode_nlm_lock(xdr, &value->alock))
552 		return false;
553 	return true;
554 }
555 
556 static bool __maybe_unused
557 xdrgen_encode_nlm_testargs(struct xdr_stream *xdr, const struct nlm_testargs *value)
558 {
559 	if (!xdrgen_encode_netobj(xdr, value->cookie))
560 		return false;
561 	if (!xdrgen_encode_bool(xdr, value->exclusive))
562 		return false;
563 	if (!xdrgen_encode_nlm_lock(xdr, &value->alock))
564 		return false;
565 	return true;
566 }
567 
568 static bool __maybe_unused
569 xdrgen_encode_nlm_unlockargs(struct xdr_stream *xdr, const struct nlm_unlockargs *value)
570 {
571 	if (!xdrgen_encode_netobj(xdr, value->cookie))
572 		return false;
573 	if (!xdrgen_encode_nlm_lock(xdr, &value->alock))
574 		return false;
575 	return true;
576 }
577 
578 static bool __maybe_unused
579 xdrgen_encode_fsh_mode(struct xdr_stream *xdr, fsh_mode value)
580 {
581 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
582 }
583 
584 static bool __maybe_unused
585 xdrgen_encode_fsh_access(struct xdr_stream *xdr, fsh_access value)
586 {
587 	return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
588 }
589 
590 static bool __maybe_unused
591 xdrgen_encode_nlm_share(struct xdr_stream *xdr, const struct nlm_share *value)
592 {
593 	if (value->caller_name.len > LM_MAXSTRLEN)
594 		return false;
595 	if (xdr_stream_encode_opaque(xdr, value->caller_name.data, value->caller_name.len) < 0)
596 		return false;
597 	if (!xdrgen_encode_netobj(xdr, value->fh))
598 		return false;
599 	if (!xdrgen_encode_netobj(xdr, value->oh))
600 		return false;
601 	if (!xdrgen_encode_fsh_mode(xdr, value->mode))
602 		return false;
603 	if (!xdrgen_encode_fsh_access(xdr, value->access))
604 		return false;
605 	return true;
606 }
607 
608 static bool __maybe_unused
609 xdrgen_encode_nlm_shareargs(struct xdr_stream *xdr, const struct nlm_shareargs *value)
610 {
611 	if (!xdrgen_encode_netobj(xdr, value->cookie))
612 		return false;
613 	if (!xdrgen_encode_nlm_share(xdr, &value->share))
614 		return false;
615 	if (!xdrgen_encode_bool(xdr, value->reclaim))
616 		return false;
617 	return true;
618 }
619 
620 static bool __maybe_unused
621 xdrgen_encode_nlm_shareres(struct xdr_stream *xdr, const struct nlm_shareres *value)
622 {
623 	if (!xdrgen_encode_netobj(xdr, value->cookie))
624 		return false;
625 	if (!xdrgen_encode_nlm_stats(xdr, value->stat))
626 		return false;
627 	if (!xdrgen_encode_int(xdr, value->sequence))
628 		return false;
629 	return true;
630 }
631 
632 static bool __maybe_unused
633 xdrgen_encode_nlm_notify(struct xdr_stream *xdr, const struct nlm_notify *value)
634 {
635 	if (value->name.len > LM_MAXNAMELEN)
636 		return false;
637 	if (xdr_stream_encode_opaque(xdr, value->name.data, value->name.len) < 0)
638 		return false;
639 	if (!xdrgen_encode_long(xdr, value->state))
640 		return false;
641 	return true;
642 }
643 
644 static bool __maybe_unused
645 xdrgen_encode_nlm_notifyargs(struct xdr_stream *xdr, const struct nlm_notifyargs *value)
646 {
647 	if (!xdrgen_encode_nlm_notify(xdr, &value->notify))
648 		return false;
649 	if (xdr_stream_encode_opaque_fixed(xdr, value->private, SM_PRIV_SIZE) < 0)
650 		return false;
651 	return true;
652 }
653 
654 /**
655  * nlm_svc_encode_void - Encode a void result
656  * @rqstp: RPC transaction context
657  * @xdr: target XDR data stream
658  *
659  * Return values:
660  *   %true: procedure results encoded successfully
661  *   %false: encode failed
662  */
663 bool nlm_svc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr)
664 {
665 	return xdrgen_encode_void(xdr);
666 }
667 
668 /**
669  * nlm_svc_encode_nlm_testres - Encode a nlm_testres result
670  * @rqstp: RPC transaction context
671  * @xdr: target XDR data stream
672  *
673  * Return values:
674  *   %true: procedure results encoded successfully
675  *   %false: encode failed
676  */
677 bool nlm_svc_encode_nlm_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
678 {
679 	struct nlm_testres *resp = rqstp->rq_resp;
680 
681 	return xdrgen_encode_nlm_testres(xdr, resp);
682 }
683 
684 /**
685  * nlm_svc_encode_nlm_res - Encode a nlm_res result
686  * @rqstp: RPC transaction context
687  * @xdr: target XDR data stream
688  *
689  * Return values:
690  *   %true: procedure results encoded successfully
691  *   %false: encode failed
692  */
693 bool nlm_svc_encode_nlm_res(struct svc_rqst *rqstp, struct xdr_stream *xdr)
694 {
695 	struct nlm_res *resp = rqstp->rq_resp;
696 
697 	return xdrgen_encode_nlm_res(xdr, resp);
698 }
699 
700 /**
701  * nlm_svc_encode_nlm_shareres - Encode a nlm_shareres result
702  * @rqstp: RPC transaction context
703  * @xdr: target XDR data stream
704  *
705  * Return values:
706  *   %true: procedure results encoded successfully
707  *   %false: encode failed
708  */
709 bool nlm_svc_encode_nlm_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
710 {
711 	struct nlm_shareres *resp = rqstp->rq_resp;
712 
713 	return xdrgen_encode_nlm_shareres(xdr, resp);
714 }
715