Lines Matching refs:xdr

75 static __be32 *read_buf(struct xdr_stream *xdr, size_t nbytes)  in read_buf()  argument
79 p = xdr_inline_decode(xdr, nbytes); in read_buf()
85 static __be32 decode_string(struct xdr_stream *xdr, unsigned int *len, in decode_string() argument
90 err = xdr_stream_decode_opaque_inline(xdr, (void **)str, maxlen); in decode_string()
97 static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh) in decode_fh() argument
101 p = read_buf(xdr, 4); in decode_fh()
107 p = read_buf(xdr, fh->size); in decode_fh()
115 static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) in decode_bitmap() argument
120 p = read_buf(xdr, 4); in decode_bitmap()
124 p = read_buf(xdr, attrlen << 2); in decode_bitmap()
134 static __be32 decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) in decode_stateid() argument
138 p = read_buf(xdr, NFS4_STATEID_SIZE); in decode_stateid()
145 static __be32 decode_delegation_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) in decode_delegation_stateid() argument
148 return decode_stateid(xdr, stateid); in decode_delegation_stateid()
151 static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr) in decode_compound_hdr_arg() argument
156 status = decode_string(xdr, &hdr->taglen, &hdr->tag, CB_OP_TAGLEN_MAXSZ); in decode_compound_hdr_arg()
159 p = read_buf(xdr, 12); in decode_compound_hdr_arg()
176 static __be32 decode_op_hdr(struct xdr_stream *xdr, unsigned int *op) in decode_op_hdr() argument
179 p = read_buf(xdr, 4); in decode_op_hdr()
187 struct xdr_stream *xdr, void *argp) in decode_getattr_args() argument
192 status = decode_fh(xdr, &args->fh); in decode_getattr_args()
195 return decode_bitmap(xdr, args->bitmap); in decode_getattr_args()
199 struct xdr_stream *xdr, void *argp) in decode_recall_args() argument
205 status = decode_delegation_stateid(xdr, &args->stateid); in decode_recall_args()
208 p = read_buf(xdr, 4); in decode_recall_args()
212 return decode_fh(xdr, &args->fh); in decode_recall_args()
216 static __be32 decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) in decode_layout_stateid() argument
219 return decode_stateid(xdr, stateid); in decode_layout_stateid()
223 struct xdr_stream *xdr, void *argp) in decode_layoutrecall_args() argument
230 p = read_buf(xdr, 4 * sizeof(uint32_t)); in decode_layoutrecall_args()
244 status = decode_fh(xdr, &args->cbl_fh); in decode_layoutrecall_args()
248 p = read_buf(xdr, 2 * sizeof(uint64_t)); in decode_layoutrecall_args()
253 return decode_layout_stateid(xdr, &args->cbl_stateid); in decode_layoutrecall_args()
255 p = read_buf(xdr, 2 * sizeof(uint64_t)); in decode_layoutrecall_args()
267 struct xdr_stream *xdr, in decode_devicenotify_args() argument
278 p = read_buf(xdr, sizeof(uint32_t)); in decode_devicenotify_args()
301 p = read_buf(xdr, (4 * sizeof(uint32_t)) + NFS4_DEVICEID4_SIZE); in decode_devicenotify_args()
332 p = read_buf(xdr, sizeof(uint32_t)); in decode_devicenotify_args()
357 static __be32 decode_sessionid(struct xdr_stream *xdr, in decode_sessionid() argument
362 p = read_buf(xdr, NFS4_MAX_SESSIONID_LEN); in decode_sessionid()
370 static __be32 decode_rc_list(struct xdr_stream *xdr, in decode_rc_list() argument
377 status = decode_sessionid(xdr, &rc_list->rcl_sessionid); in decode_rc_list()
382 p = read_buf(xdr, sizeof(uint32_t)); in decode_rc_list()
388 p = read_buf(xdr, in decode_rc_list()
409 struct xdr_stream *xdr, in decode_cb_sequence_args() argument
417 status = decode_sessionid(xdr, &args->csa_sessionid); in decode_cb_sequence_args()
421 p = read_buf(xdr, 5 * sizeof(uint32_t)); in decode_cb_sequence_args()
440 status = decode_rc_list(xdr, &args->csa_rclists[i]); in decode_cb_sequence_args()
457 struct xdr_stream *xdr, in decode_recallany_args() argument
464 p = read_buf(xdr, 4); in decode_recallany_args()
468 status = decode_bitmap(xdr, bitmap); in decode_recallany_args()
477 struct xdr_stream *xdr, in decode_recallslot_args() argument
483 p = read_buf(xdr, 4); in decode_recallslot_args()
490 static __be32 decode_lockowner(struct xdr_stream *xdr, struct cb_notify_lock_args *args) in decode_lockowner() argument
495 p = read_buf(xdr, 12); in decode_lockowner()
502 p = read_buf(xdr, len); in decode_lockowner()
521 struct xdr_stream *xdr, void *argp) in decode_notify_lock_args() argument
526 status = decode_fh(xdr, &args->cbnl_fh); in decode_notify_lock_args()
529 return decode_lockowner(xdr, args); in decode_notify_lock_args()
534 static __be32 decode_write_response(struct xdr_stream *xdr, in decode_write_response() argument
540 p = read_buf(xdr, 4); in decode_write_response()
546 p = xdr_inline_decode(xdr, 8 + 4); in decode_write_response()
551 p = xdr_inline_decode(xdr, NFS4_VERIFIER_SIZE); in decode_write_response()
562 struct xdr_stream *xdr, in decode_offload_args() argument
570 status = decode_fh(xdr, &args->coa_fh); in decode_offload_args()
575 status = decode_stateid(xdr, &args->coa_stateid); in decode_offload_args()
580 p = read_buf(xdr, 4); in decode_offload_args()
585 status = decode_write_response(xdr, args); in decode_offload_args()
589 p = xdr_inline_decode(xdr, 8); in decode_offload_args()
599 static __be32 encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) in encode_string() argument
601 if (unlikely(xdr_stream_encode_opaque(xdr, str, len) < 0)) in encode_string()
606 static __be32 encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, size_t sz) in encode_attr_bitmap() argument
608 if (xdr_stream_encode_uint32_array(xdr, bitmap, sz) < 0) in encode_attr_bitmap()
613 static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change) in encode_attr_change() argument
619 p = xdr_reserve_space(xdr, 8); in encode_attr_change()
626 static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size) in encode_attr_size() argument
632 p = xdr_reserve_space(xdr, 8); in encode_attr_size()
639 static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *time) in encode_attr_time() argument
643 p = xdr_reserve_space(xdr, 12); in encode_attr_time()
651 static __be32 encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timesp… in encode_attr_ctime() argument
655 return encode_attr_time(xdr,time); in encode_attr_ctime()
658 static __be32 encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timesp… in encode_attr_mtime() argument
662 return encode_attr_time(xdr,time); in encode_attr_mtime()
665 static __be32 encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr) in encode_compound_hdr_res() argument
669 hdr->status = xdr_reserve_space(xdr, 4); in encode_compound_hdr_res()
672 status = encode_string(xdr, hdr->taglen, hdr->tag); in encode_compound_hdr_res()
675 hdr->nops = xdr_reserve_space(xdr, 4); in encode_compound_hdr_res()
681 static __be32 encode_op_hdr(struct xdr_stream *xdr, uint32_t op, __be32 res) in encode_op_hdr() argument
685 p = xdr_reserve_space(xdr, 8); in encode_op_hdr()
693 static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, in encode_getattr_res() argument
702 status = encode_attr_bitmap(xdr, res->bitmap, ARRAY_SIZE(res->bitmap)); in encode_getattr_res()
706 savep = xdr_reserve_space(xdr, sizeof(*savep)); in encode_getattr_res()
709 status = encode_attr_change(xdr, res->bitmap, res->change_attr); in encode_getattr_res()
712 status = encode_attr_size(xdr, res->bitmap, res->size); in encode_getattr_res()
715 status = encode_attr_ctime(xdr, res->bitmap, &res->ctime); in encode_getattr_res()
718 status = encode_attr_mtime(xdr, res->bitmap, &res->mtime); in encode_getattr_res()
719 *savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1))); in encode_getattr_res()
726 static __be32 encode_sessionid(struct xdr_stream *xdr, in encode_sessionid() argument
731 p = xdr_reserve_space(xdr, NFS4_MAX_SESSIONID_LEN); in encode_sessionid()
740 struct xdr_stream *xdr, in encode_cb_sequence_res() argument
750 status = encode_sessionid(xdr, &res->csr_sessionid); in encode_cb_sequence_res()
754 p = xdr_reserve_space(xdr, 4 * sizeof(uint32_t)); in encode_cb_sequence_res()