2 * linux/fs/nfs/callback_xdr.c
4 * Copyright (C) 2004 Trond Myklebust
6 * NFSv4 callback encode/decode procedures
8 #include <linux/kernel.h>
9 #include <linux/sunrpc/svc.h>
10 #include <linux/nfs4.h>
11 #include <linux/nfs_fs.h>
12 #include <linux/slab.h>
13 #include <linux/sunrpc/bc_xprt.h>
18 #define CB_OP_TAGLEN_MAXSZ (512)
19 #define CB_OP_HDR_RES_MAXSZ (2 + CB_OP_TAGLEN_MAXSZ)
20 #define CB_OP_GETATTR_BITMAP_MAXSZ (4)
21 #define CB_OP_GETATTR_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ + \
22 CB_OP_GETATTR_BITMAP_MAXSZ + \
24 #define CB_OP_RECALL_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ)
26 #if defined(CONFIG_NFS_V4_1)
27 #define CB_OP_SEQUENCE_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ + \
29 #define CB_OP_RECALLANY_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ)
30 #define CB_OP_RECALLSLOT_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ)
31 #endif /* CONFIG_NFS_V4_1 */
33 #define NFSDBG_FACILITY NFSDBG_CALLBACK
35 /* Internal error code */
36 #define NFS4ERR_RESOURCE_HDR 11050
38 typedef __be32 (*callback_process_op_t)(void *, void *,
39 struct cb_process_state *);
40 typedef __be32 (*callback_decode_arg_t)(struct svc_rqst *, struct xdr_stream *, void *);
41 typedef __be32 (*callback_encode_res_t)(struct svc_rqst *, struct xdr_stream *, void *);
45 callback_process_op_t process_op;
46 callback_decode_arg_t decode_args;
47 callback_encode_res_t encode_res;
51 static struct callback_op callback_ops[];
53 static __be32 nfs4_callback_null(struct svc_rqst *rqstp, void *argp, void *resp)
55 return htonl(NFS4_OK);
58 static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
60 return xdr_argsize_check(rqstp, p);
63 static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
65 return xdr_ressize_check(rqstp, p);
68 static __be32 *read_buf(struct xdr_stream *xdr, int nbytes)
72 p = xdr_inline_decode(xdr, nbytes);
73 if (unlikely(p == NULL))
74 printk(KERN_WARNING "NFSv4 callback reply buffer overflowed!\n");
78 static __be32 decode_string(struct xdr_stream *xdr, unsigned int *len, const char **str)
83 if (unlikely(p == NULL))
84 return htonl(NFS4ERR_RESOURCE);
88 p = read_buf(xdr, *len);
89 if (unlikely(p == NULL))
90 return htonl(NFS4ERR_RESOURCE);
91 *str = (const char *)p;
98 static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
102 p = read_buf(xdr, 4);
103 if (unlikely(p == NULL))
104 return htonl(NFS4ERR_RESOURCE);
105 fh->size = ntohl(*p);
106 if (fh->size > NFS4_FHSIZE)
107 return htonl(NFS4ERR_BADHANDLE);
108 p = read_buf(xdr, fh->size);
109 if (unlikely(p == NULL))
110 return htonl(NFS4ERR_RESOURCE);
111 memcpy(&fh->data[0], p, fh->size);
112 memset(&fh->data[fh->size], 0, sizeof(fh->data) - fh->size);
116 static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
119 unsigned int attrlen;
121 p = read_buf(xdr, 4);
122 if (unlikely(p == NULL))
123 return htonl(NFS4ERR_RESOURCE);
125 p = read_buf(xdr, attrlen << 2);
126 if (unlikely(p == NULL))
127 return htonl(NFS4ERR_RESOURCE);
128 if (likely(attrlen > 0))
129 bitmap[0] = ntohl(*p++);
131 bitmap[1] = ntohl(*p);
135 static __be32 decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid)
139 p = read_buf(xdr, 16);
140 if (unlikely(p == NULL))
141 return htonl(NFS4ERR_RESOURCE);
142 memcpy(stateid->data, p, 16);
146 static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr)
151 status = decode_string(xdr, &hdr->taglen, &hdr->tag);
152 if (unlikely(status != 0))
154 /* We do not like overly long tags! */
155 if (hdr->taglen > CB_OP_TAGLEN_MAXSZ - 12) {
156 printk("NFSv4 CALLBACK %s: client sent tag of length %u\n",
157 __func__, hdr->taglen);
158 return htonl(NFS4ERR_RESOURCE);
160 p = read_buf(xdr, 12);
161 if (unlikely(p == NULL))
162 return htonl(NFS4ERR_RESOURCE);
163 hdr->minorversion = ntohl(*p++);
164 /* Check minor version is zero or one. */
165 if (hdr->minorversion <= 1) {
166 hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */
168 printk(KERN_WARNING "%s: NFSv4 server callback with "
169 "illegal minor version %u!\n",
170 __func__, hdr->minorversion);
171 return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
173 hdr->nops = ntohl(*p);
174 dprintk("%s: minorversion %d nops %d\n", __func__,
175 hdr->minorversion, hdr->nops);
179 static __be32 decode_op_hdr(struct xdr_stream *xdr, unsigned int *op)
182 p = read_buf(xdr, 4);
183 if (unlikely(p == NULL))
184 return htonl(NFS4ERR_RESOURCE_HDR);
189 static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_getattrargs *args)
193 status = decode_fh(xdr, &args->fh);
194 if (unlikely(status != 0))
196 args->addr = svc_addr(rqstp);
197 status = decode_bitmap(xdr, args->bitmap);
199 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
203 static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_recallargs *args)
208 args->addr = svc_addr(rqstp);
209 status = decode_stateid(xdr, &args->stateid);
210 if (unlikely(status != 0))
212 p = read_buf(xdr, 4);
213 if (unlikely(p == NULL)) {
214 status = htonl(NFS4ERR_RESOURCE);
217 args->truncate = ntohl(*p);
218 status = decode_fh(xdr, &args->fh);
220 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
224 #if defined(CONFIG_NFS_V4_1)
226 static __be32 decode_sessionid(struct xdr_stream *xdr,
227 struct nfs4_sessionid *sid)
230 int len = NFS4_MAX_SESSIONID_LEN;
232 p = read_buf(xdr, len);
233 if (unlikely(p == NULL))
234 return htonl(NFS4ERR_RESOURCE);
236 memcpy(sid->data, p, len);
240 static __be32 decode_rc_list(struct xdr_stream *xdr,
241 struct referring_call_list *rc_list)
247 status = decode_sessionid(xdr, &rc_list->rcl_sessionid);
251 status = htonl(NFS4ERR_RESOURCE);
252 p = read_buf(xdr, sizeof(uint32_t));
253 if (unlikely(p == NULL))
256 rc_list->rcl_nrefcalls = ntohl(*p++);
257 if (rc_list->rcl_nrefcalls) {
259 rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t));
260 if (unlikely(p == NULL))
262 rc_list->rcl_refcalls = kmalloc(rc_list->rcl_nrefcalls *
263 sizeof(*rc_list->rcl_refcalls),
265 if (unlikely(rc_list->rcl_refcalls == NULL))
267 for (i = 0; i < rc_list->rcl_nrefcalls; i++) {
268 rc_list->rcl_refcalls[i].rc_sequenceid = ntohl(*p++);
269 rc_list->rcl_refcalls[i].rc_slotid = ntohl(*p++);
278 static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp,
279 struct xdr_stream *xdr,
280 struct cb_sequenceargs *args)
286 status = decode_sessionid(xdr, &args->csa_sessionid);
290 status = htonl(NFS4ERR_RESOURCE);
291 p = read_buf(xdr, 5 * sizeof(uint32_t));
292 if (unlikely(p == NULL))
295 args->csa_addr = svc_addr(rqstp);
296 args->csa_sequenceid = ntohl(*p++);
297 args->csa_slotid = ntohl(*p++);
298 args->csa_highestslotid = ntohl(*p++);
299 args->csa_cachethis = ntohl(*p++);
300 args->csa_nrclists = ntohl(*p++);
301 args->csa_rclists = NULL;
302 if (args->csa_nrclists) {
303 args->csa_rclists = kmalloc(args->csa_nrclists *
304 sizeof(*args->csa_rclists),
306 if (unlikely(args->csa_rclists == NULL))
309 for (i = 0; i < args->csa_nrclists; i++) {
310 status = decode_rc_list(xdr, &args->csa_rclists[i]);
317 dprintk("%s: sessionid %x:%x:%x:%x sequenceid %u slotid %u "
318 "highestslotid %u cachethis %d nrclists %u\n",
320 ((u32 *)&args->csa_sessionid)[0],
321 ((u32 *)&args->csa_sessionid)[1],
322 ((u32 *)&args->csa_sessionid)[2],
323 ((u32 *)&args->csa_sessionid)[3],
324 args->csa_sequenceid, args->csa_slotid,
325 args->csa_highestslotid, args->csa_cachethis,
328 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
332 for (i = 0; i < args->csa_nrclists; i++)
333 kfree(args->csa_rclists[i].rcl_refcalls);
334 kfree(args->csa_rclists);
338 static __be32 decode_recallany_args(struct svc_rqst *rqstp,
339 struct xdr_stream *xdr,
340 struct cb_recallanyargs *args)
344 args->craa_addr = svc_addr(rqstp);
345 p = read_buf(xdr, 4);
346 if (unlikely(p == NULL))
347 return htonl(NFS4ERR_BADXDR);
348 args->craa_objs_to_keep = ntohl(*p++);
349 p = read_buf(xdr, 4);
350 if (unlikely(p == NULL))
351 return htonl(NFS4ERR_BADXDR);
352 args->craa_type_mask = ntohl(*p);
357 static __be32 decode_recallslot_args(struct svc_rqst *rqstp,
358 struct xdr_stream *xdr,
359 struct cb_recallslotargs *args)
363 args->crsa_addr = svc_addr(rqstp);
364 p = read_buf(xdr, 4);
365 if (unlikely(p == NULL))
366 return htonl(NFS4ERR_BADXDR);
367 args->crsa_target_max_slots = ntohl(*p++);
371 #endif /* CONFIG_NFS_V4_1 */
373 static __be32 encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
377 p = xdr_reserve_space(xdr, 4 + len);
378 if (unlikely(p == NULL))
379 return htonl(NFS4ERR_RESOURCE);
380 xdr_encode_opaque(p, str, len);
384 #define CB_SUPPORTED_ATTR0 (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE)
385 #define CB_SUPPORTED_ATTR1 (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY)
386 static __be32 encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, __be32 **savep)
391 bm[0] = htonl(bitmap[0] & CB_SUPPORTED_ATTR0);
392 bm[1] = htonl(bitmap[1] & CB_SUPPORTED_ATTR1);
394 p = xdr_reserve_space(xdr, 16);
395 if (unlikely(p == NULL))
396 return htonl(NFS4ERR_RESOURCE);
400 } else if (bm[0] != 0) {
401 p = xdr_reserve_space(xdr, 12);
402 if (unlikely(p == NULL))
403 return htonl(NFS4ERR_RESOURCE);
407 p = xdr_reserve_space(xdr, 8);
408 if (unlikely(p == NULL))
409 return htonl(NFS4ERR_RESOURCE);
416 static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change)
420 if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
422 p = xdr_reserve_space(xdr, 8);
424 return htonl(NFS4ERR_RESOURCE);
425 p = xdr_encode_hyper(p, change);
429 static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size)
433 if (!(bitmap[0] & FATTR4_WORD0_SIZE))
435 p = xdr_reserve_space(xdr, 8);
437 return htonl(NFS4ERR_RESOURCE);
438 p = xdr_encode_hyper(p, size);
442 static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *time)
446 p = xdr_reserve_space(xdr, 12);
448 return htonl(NFS4ERR_RESOURCE);
449 p = xdr_encode_hyper(p, time->tv_sec);
450 *p = htonl(time->tv_nsec);
454 static __be32 encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
456 if (!(bitmap[1] & FATTR4_WORD1_TIME_METADATA))
458 return encode_attr_time(xdr,time);
461 static __be32 encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
463 if (!(bitmap[1] & FATTR4_WORD1_TIME_MODIFY))
465 return encode_attr_time(xdr,time);
468 static __be32 encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr)
472 hdr->status = xdr_reserve_space(xdr, 4);
473 if (unlikely(hdr->status == NULL))
474 return htonl(NFS4ERR_RESOURCE);
475 status = encode_string(xdr, hdr->taglen, hdr->tag);
476 if (unlikely(status != 0))
478 hdr->nops = xdr_reserve_space(xdr, 4);
479 if (unlikely(hdr->nops == NULL))
480 return htonl(NFS4ERR_RESOURCE);
484 static __be32 encode_op_hdr(struct xdr_stream *xdr, uint32_t op, __be32 res)
488 p = xdr_reserve_space(xdr, 8);
489 if (unlikely(p == NULL))
490 return htonl(NFS4ERR_RESOURCE_HDR);
496 static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res)
498 __be32 *savep = NULL;
499 __be32 status = res->status;
501 if (unlikely(status != 0))
503 status = encode_attr_bitmap(xdr, res->bitmap, &savep);
504 if (unlikely(status != 0))
506 status = encode_attr_change(xdr, res->bitmap, res->change_attr);
507 if (unlikely(status != 0))
509 status = encode_attr_size(xdr, res->bitmap, res->size);
510 if (unlikely(status != 0))
512 status = encode_attr_ctime(xdr, res->bitmap, &res->ctime);
513 if (unlikely(status != 0))
515 status = encode_attr_mtime(xdr, res->bitmap, &res->mtime);
516 *savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1)));
518 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
522 #if defined(CONFIG_NFS_V4_1)
524 static __be32 encode_sessionid(struct xdr_stream *xdr,
525 const struct nfs4_sessionid *sid)
528 int len = NFS4_MAX_SESSIONID_LEN;
530 p = xdr_reserve_space(xdr, len);
531 if (unlikely(p == NULL))
532 return htonl(NFS4ERR_RESOURCE);
538 static __be32 encode_cb_sequence_res(struct svc_rqst *rqstp,
539 struct xdr_stream *xdr,
540 const struct cb_sequenceres *res)
543 unsigned status = res->csr_status;
545 if (unlikely(status != 0))
548 encode_sessionid(xdr, &res->csr_sessionid);
550 p = xdr_reserve_space(xdr, 4 * sizeof(uint32_t));
551 if (unlikely(p == NULL))
552 return htonl(NFS4ERR_RESOURCE);
554 *p++ = htonl(res->csr_sequenceid);
555 *p++ = htonl(res->csr_slotid);
556 *p++ = htonl(res->csr_highestslotid);
557 *p++ = htonl(res->csr_target_highestslotid);
559 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
564 preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op)
566 if (op_nr == OP_CB_SEQUENCE) {
568 return htonl(NFS4ERR_SEQUENCE_POS);
571 return htonl(NFS4ERR_OP_NOT_IN_SESSION);
578 case OP_CB_RECALL_ANY:
579 case OP_CB_RECALL_SLOT:
580 *op = &callback_ops[op_nr];
583 case OP_CB_LAYOUTRECALL:
584 case OP_CB_NOTIFY_DEVICEID:
586 case OP_CB_PUSH_DELEG:
587 case OP_CB_RECALLABLE_OBJ_AVAIL:
588 case OP_CB_WANTS_CANCELLED:
589 case OP_CB_NOTIFY_LOCK:
590 return htonl(NFS4ERR_NOTSUPP);
593 return htonl(NFS4ERR_OP_ILLEGAL);
596 return htonl(NFS_OK);
599 static void nfs4_callback_free_slot(struct nfs4_session *session)
601 struct nfs4_slot_table *tbl = &session->bc_slot_table;
603 spin_lock(&tbl->slot_tbl_lock);
605 * Let the state manager know callback processing done.
606 * A single slot, so highest used slotid is either 0 or -1
608 tbl->highest_used_slotid--;
609 nfs4_check_drain_bc_complete(session);
610 spin_unlock(&tbl->slot_tbl_lock);
613 static void nfs4_cb_free_slot(struct nfs_client *clp)
615 if (clp && clp->cl_session)
616 nfs4_callback_free_slot(clp->cl_session);
619 /* A single slot, so highest used slotid is either 0 or -1 */
620 void nfs4_cb_take_slot(struct nfs_client *clp)
622 struct nfs4_slot_table *tbl = &clp->cl_session->bc_slot_table;
624 spin_lock(&tbl->slot_tbl_lock);
625 tbl->highest_used_slotid++;
626 BUG_ON(tbl->highest_used_slotid != 0);
627 spin_unlock(&tbl->slot_tbl_lock);
630 #else /* CONFIG_NFS_V4_1 */
633 preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op)
635 return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
638 static void nfs4_cb_free_slot(struct nfs_client *clp)
641 #endif /* CONFIG_NFS_V4_1 */
644 preprocess_nfs4_op(unsigned int op_nr, struct callback_op **op)
649 *op = &callback_ops[op_nr];
652 return htonl(NFS4ERR_OP_ILLEGAL);
655 return htonl(NFS_OK);
658 static __be32 process_op(uint32_t minorversion, int nop,
659 struct svc_rqst *rqstp,
660 struct xdr_stream *xdr_in, void *argp,
661 struct xdr_stream *xdr_out, void *resp,
662 struct cb_process_state *cps)
664 struct callback_op *op = &callback_ops[0];
670 dprintk("%s: start\n", __func__);
671 status = decode_op_hdr(xdr_in, &op_nr);
672 if (unlikely(status))
675 dprintk("%s: minorversion=%d nop=%d op_nr=%u\n",
676 __func__, minorversion, nop, op_nr);
678 status = minorversion ? preprocess_nfs41_op(nop, op_nr, &op) :
679 preprocess_nfs4_op(op_nr, &op);
680 if (status == htonl(NFS4ERR_OP_ILLEGAL))
681 op_nr = OP_CB_ILLEGAL;
685 if (cps->drc_status) {
686 status = cps->drc_status;
690 maxlen = xdr_out->end - xdr_out->p;
691 if (maxlen > 0 && maxlen < PAGE_SIZE) {
692 status = op->decode_args(rqstp, xdr_in, argp);
693 if (likely(status == 0))
694 status = op->process_op(argp, resp, cps);
696 status = htonl(NFS4ERR_RESOURCE);
699 res = encode_op_hdr(xdr_out, op_nr, status);
702 if (op->encode_res != NULL && status == 0)
703 status = op->encode_res(rqstp, xdr_out, resp);
704 dprintk("%s: done, status = %d\n", __func__, ntohl(status));
709 * Decode, process and encode a COMPOUND
711 static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp)
713 struct cb_compound_hdr_arg hdr_arg = { 0 };
714 struct cb_compound_hdr_res hdr_res = { NULL };
715 struct xdr_stream xdr_in, xdr_out;
717 struct cb_process_state cps = {
721 unsigned int nops = 0;
723 dprintk("%s: start\n", __func__);
725 xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
727 p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
728 xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
730 status = decode_compound_hdr_arg(&xdr_in, &hdr_arg);
731 if (status == __constant_htonl(NFS4ERR_RESOURCE))
732 return rpc_garbage_args;
734 if (hdr_arg.minorversion == 0) {
735 cps.clp = nfs4_find_client_ident(hdr_arg.cb_ident);
737 return rpc_drop_reply;
739 cps.svc_sid = bc_xprt_sid(rqstp);
741 hdr_res.taglen = hdr_arg.taglen;
742 hdr_res.tag = hdr_arg.tag;
743 if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0)
744 return rpc_system_err;
746 while (status == 0 && nops != hdr_arg.nops) {
747 status = process_op(hdr_arg.minorversion, nops, rqstp,
748 &xdr_in, argp, &xdr_out, resp, &cps);
752 /* Buffer overflow in decode_ops_hdr or encode_ops_hdr. Return
753 * resource error in cb_compound status without returning op */
754 if (unlikely(status == htonl(NFS4ERR_RESOURCE_HDR))) {
755 status = htonl(NFS4ERR_RESOURCE);
759 *hdr_res.status = status;
760 *hdr_res.nops = htonl(nops);
761 nfs4_cb_free_slot(cps.clp);
762 nfs_put_client(cps.clp);
763 dprintk("%s: done, status = %u\n", __func__, ntohl(status));
768 * Define NFS4 callback COMPOUND ops.
770 static struct callback_op callback_ops[] = {
772 .res_maxsize = CB_OP_HDR_RES_MAXSZ,
775 .process_op = (callback_process_op_t)nfs4_callback_getattr,
776 .decode_args = (callback_decode_arg_t)decode_getattr_args,
777 .encode_res = (callback_encode_res_t)encode_getattr_res,
778 .res_maxsize = CB_OP_GETATTR_RES_MAXSZ,
781 .process_op = (callback_process_op_t)nfs4_callback_recall,
782 .decode_args = (callback_decode_arg_t)decode_recall_args,
783 .res_maxsize = CB_OP_RECALL_RES_MAXSZ,
785 #if defined(CONFIG_NFS_V4_1)
787 .process_op = (callback_process_op_t)nfs4_callback_sequence,
788 .decode_args = (callback_decode_arg_t)decode_cb_sequence_args,
789 .encode_res = (callback_encode_res_t)encode_cb_sequence_res,
790 .res_maxsize = CB_OP_SEQUENCE_RES_MAXSZ,
792 [OP_CB_RECALL_ANY] = {
793 .process_op = (callback_process_op_t)nfs4_callback_recallany,
794 .decode_args = (callback_decode_arg_t)decode_recallany_args,
795 .res_maxsize = CB_OP_RECALLANY_RES_MAXSZ,
797 [OP_CB_RECALL_SLOT] = {
798 .process_op = (callback_process_op_t)nfs4_callback_recallslot,
799 .decode_args = (callback_decode_arg_t)decode_recallslot_args,
800 .res_maxsize = CB_OP_RECALLSLOT_RES_MAXSZ,
802 #endif /* CONFIG_NFS_V4_1 */
806 * Define NFS4 callback procedures
808 static struct svc_procedure nfs4_callback_procedures1[] = {
810 .pc_func = nfs4_callback_null,
811 .pc_decode = (kxdrproc_t)nfs4_decode_void,
812 .pc_encode = (kxdrproc_t)nfs4_encode_void,
816 .pc_func = nfs4_callback_compound,
817 .pc_encode = (kxdrproc_t)nfs4_encode_void,
820 .pc_xdrressize = NFS4_CALLBACK_BUFSIZE,
824 struct svc_version nfs4_callback_version1 = {
826 .vs_nproc = ARRAY_SIZE(nfs4_callback_procedures1),
827 .vs_proc = nfs4_callback_procedures1,
828 .vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
833 struct svc_version nfs4_callback_version4 = {
835 .vs_nproc = ARRAY_SIZE(nfs4_callback_procedures1),
836 .vs_proc = nfs4_callback_procedures1,
837 .vs_xdrsize = NFS4_CALLBACK_XDRSIZE,