Lines Matching refs:argp

114  * @argp: NFSv4 compound argument structure
118 * operation described in @argp finishes.
121 svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, u32 len)
128 tb->next = argp->to_free;
129 argp->to_free = tb;
141 svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len)
143 char *p = svcxdr_tmpalloc(argp, len + 1);
153 svcxdr_savemem(struct nfsd4_compoundargs *argp, __be32 *p, u32 len)
161 if (p != argp->xdr->scratch.iov_base)
164 tmp = svcxdr_tmpalloc(argp, len);
180 nfsd4_decode_ignored_string(struct nfsd4_compoundargs *argp, u32 maxlen)
184 if (xdr_stream_decode_u32(argp->xdr, &len) < 0)
188 if (!xdr_inline_decode(argp->xdr, len))
195 nfsd4_decode_opaque(struct nfsd4_compoundargs *argp, struct xdr_netobj *o)
200 if (xdr_stream_decode_u32(argp->xdr, &len) < 0)
204 p = xdr_inline_decode(argp->xdr, len);
207 o->data = svcxdr_savemem(argp, p, len);
216 nfsd4_decode_component4(struct nfsd4_compoundargs *argp, char **namp, u32 *lenp)
220 if (xdr_stream_decode_u32(argp->xdr, lenp) < 0)
222 p = xdr_inline_decode(argp->xdr, *lenp);
228 *namp = svcxdr_savemem(argp, p, *lenp);
236 nfsd4_decode_nfstime4(struct nfsd4_compoundargs *argp, struct timespec64 *tv)
240 p = xdr_inline_decode(argp->xdr, XDR_UNIT * 3);
251 nfsd4_decode_verifier4(struct nfsd4_compoundargs *argp, nfs4_verifier *verf)
255 p = xdr_inline_decode(argp->xdr, NFS4_VERIFIER_SIZE);
264 * @argp: NFSv4 compound argument structure
280 nfsd4_decode_bitmap4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen)
284 status = xdr_stream_decode_uint32_array(argp->xdr, bmval, bmlen);
289 nfsd4_decode_nfsace4(struct nfsd4_compoundargs *argp, struct nfs4_ace *ace)
294 if (xdr_stream_decode_u32(argp->xdr, &ace->type) < 0)
296 if (xdr_stream_decode_u32(argp->xdr, &ace->flag) < 0)
298 if (xdr_stream_decode_u32(argp->xdr, &ace->access_mask) < 0)
301 if (xdr_stream_decode_u32(argp->xdr, &length) < 0)
303 p = xdr_inline_decode(argp->xdr, length);
310 status = nfsd_map_name_to_gid(argp->rqstp,
313 status = nfsd_map_name_to_uid(argp->rqstp,
321 nfsd4_decode_acl(struct nfsd4_compoundargs *argp, struct nfs4_acl **acl)
327 if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
330 if (count > xdr_stream_remaining(argp->xdr) / 20)
338 *acl = svcxdr_tmpalloc(argp, nfs4_acl_bytes(count));
344 status = nfsd4_decode_nfsace4(argp, ace);
353 nfsd4_decode_security_label(struct nfsd4_compoundargs *argp,
359 if (xdr_stream_decode_u32(argp->xdr, &lfs) < 0)
361 if (xdr_stream_decode_u32(argp->xdr, &pi) < 0)
364 if (xdr_stream_decode_u32(argp->xdr, &length) < 0)
368 p = xdr_inline_decode(argp->xdr, length);
372 label->data = svcxdr_dupstr(argp, p, length);
380 nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen,
389 status = nfsd4_decode_bitmap4(argp, bmval, bmlen);
396 if (nfsd_attrs_supported(argp->minorversion, bmval))
401 if (xdr_stream_decode_u32(argp->xdr, &attrlist4_count) < 0)
403 starting_pos = xdr_stream_pos(argp->xdr);
408 if (xdr_stream_decode_u64(argp->xdr, &size) < 0)
414 status = nfsd4_decode_acl(argp, acl);
422 if (xdr_stream_decode_u32(argp->xdr, &mode) < 0)
431 if (xdr_stream_decode_u32(argp->xdr, &length) < 0)
433 p = xdr_inline_decode(argp->xdr, length);
436 status = nfsd_map_name_to_uid(argp->rqstp, (char *)p, length,
445 if (xdr_stream_decode_u32(argp->xdr, &length) < 0)
447 p = xdr_inline_decode(argp->xdr, length);
450 status = nfsd_map_name_to_gid(argp->rqstp, (char *)p, length,
459 if (xdr_stream_decode_u32(argp->xdr, &set_it) < 0)
463 status = nfsd4_decode_nfstime4(argp, &iattr->ia_atime);
480 status = nfsd4_decode_nfstime4(argp, &ts);
487 if (xdr_stream_decode_u32(argp->xdr, &set_it) < 0)
491 status = nfsd4_decode_nfstime4(argp, &iattr->ia_mtime);
506 status = nfsd4_decode_security_label(argp, label);
515 if (xdr_stream_decode_u32(argp->xdr, &mode) < 0)
518 if (xdr_stream_decode_u32(argp->xdr, &mask) < 0)
525 if (attrlist4_count != xdr_stream_pos(argp->xdr) - starting_pos)
532 nfsd4_decode_stateid4(struct nfsd4_compoundargs *argp, stateid_t *sid)
536 p = xdr_inline_decode(argp->xdr, NFS4_STATEID_SIZE);
545 nfsd4_decode_clientid4(struct nfsd4_compoundargs *argp, clientid_t *clientid)
549 p = xdr_inline_decode(argp->xdr, sizeof(__be64));
557 nfsd4_decode_state_owner4(struct nfsd4_compoundargs *argp,
562 status = nfsd4_decode_clientid4(argp, clientid);
565 return nfsd4_decode_opaque(argp, owner);
570 nfsd4_decode_deviceid4(struct nfsd4_compoundargs *argp,
575 p = xdr_inline_decode(argp->xdr, NFS4_DEVICEID4_SIZE);
583 nfsd4_decode_layoutupdate4(struct nfsd4_compoundargs *argp,
586 if (xdr_stream_decode_u32(argp->xdr, &lcp->lc_layout_type) < 0)
593 if (xdr_stream_decode_u32(argp->xdr, &lcp->lc_up_len) < 0)
596 lcp->lc_up_layout = xdr_inline_decode(argp->xdr, lcp->lc_up_len);
605 nfsd4_decode_layoutreturn4(struct nfsd4_compoundargs *argp,
610 if (xdr_stream_decode_u32(argp->xdr, &lrp->lr_return_type) < 0)
614 if (xdr_stream_decode_u64(argp->xdr, &lrp->lr_seg.offset) < 0)
616 if (xdr_stream_decode_u64(argp->xdr, &lrp->lr_seg.length) < 0)
618 status = nfsd4_decode_stateid4(argp, &lrp->lr_sid);
621 if (xdr_stream_decode_u32(argp->xdr, &lrp->lrf_body_len) < 0)
624 lrp->lrf_body = xdr_inline_decode(argp->xdr, lrp->lrf_body_len);
644 nfsd4_decode_sessionid4(struct nfsd4_compoundargs *argp,
649 p = xdr_inline_decode(argp->xdr, NFS4_MAX_SESSIONID_LEN);
658 nfsd4_decode_authsys_parms(struct nfsd4_compoundargs *argp,
664 if (xdr_stream_decode_u32(argp->xdr, &stamp) < 0)
667 status = nfsd4_decode_ignored_string(argp, 255);
670 if (xdr_stream_decode_u32(argp->xdr, &uid) < 0)
672 if (xdr_stream_decode_u32(argp->xdr, &gid) < 0)
674 if (xdr_stream_decode_u32(argp->xdr, &gidcount) < 0)
678 p = xdr_inline_decode(argp->xdr, gidcount << 2);
682 struct user_namespace *userns = nfsd_user_namespace(argp->rqstp);
699 nfsd4_decode_gss_cb_handles4(struct nfsd4_compoundargs *argp,
707 if (xdr_stream_decode_u32(argp->xdr, &service) < 0)
712 status = nfsd4_decode_ignored_string(argp, 0);
716 status = nfsd4_decode_ignored_string(argp, 0);
725 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_cb_sec *cbs)
731 if (xdr_stream_decode_u32(argp->xdr, &nr_secflavs) < 0)
740 if (xdr_stream_decode_u32(argp->xdr, &secflavor) < 0)
749 status = nfsd4_decode_authsys_parms(argp, cbs);
754 status = nfsd4_decode_gss_cb_handles4(argp, cbs);
772 nfsd4_decode_access(struct nfsd4_compoundargs *argp,
776 if (xdr_stream_decode_u32(argp->xdr, &access->ac_req_access) < 0)
782 nfsd4_decode_close(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
785 if (xdr_stream_decode_u32(argp->xdr, &close->cl_seqid) < 0)
787 return nfsd4_decode_stateid4(argp, &close->cl_stateid);
792 nfsd4_decode_commit(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
795 if (xdr_stream_decode_u64(argp->xdr, &commit->co_offset) < 0)
797 if (xdr_stream_decode_u32(argp->xdr, &commit->co_count) < 0)
804 nfsd4_decode_create(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
810 if (xdr_stream_decode_u32(argp->xdr, &create->cr_type) < 0)
814 if (xdr_stream_decode_u32(argp->xdr, &create->cr_datalen) < 0)
816 p = xdr_inline_decode(argp->xdr, create->cr_datalen);
819 create->cr_data = svcxdr_dupstr(argp, p, create->cr_datalen);
825 if (xdr_stream_decode_u32(argp->xdr, &create->cr_specdata1) < 0)
827 if (xdr_stream_decode_u32(argp->xdr, &create->cr_specdata2) < 0)
836 status = nfsd4_decode_component4(argp, &create->cr_name,
840 status = nfsd4_decode_fattr4(argp, create->cr_bmval,
851 nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
854 return nfsd4_decode_stateid4(argp, &dr->dr_stateid);
858 nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
862 return nfsd4_decode_bitmap4(argp, getattr->ga_bmval,
867 nfsd4_decode_link(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
871 return nfsd4_decode_component4(argp, &link->li_name, &link->li_namelen);
875 nfsd4_decode_open_to_lock_owner4(struct nfsd4_compoundargs *argp,
880 if (xdr_stream_decode_u32(argp->xdr, &lock->lk_new_open_seqid) < 0)
882 status = nfsd4_decode_stateid4(argp, &lock->lk_new_open_stateid);
885 if (xdr_stream_decode_u32(argp->xdr, &lock->lk_new_lock_seqid) < 0)
887 return nfsd4_decode_state_owner4(argp, &lock->lk_new_clientid,
892 nfsd4_decode_exist_lock_owner4(struct nfsd4_compoundargs *argp,
897 status = nfsd4_decode_stateid4(argp, &lock->lk_old_lock_stateid);
900 if (xdr_stream_decode_u32(argp->xdr, &lock->lk_old_lock_seqid) < 0)
907 nfsd4_decode_locker4(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
909 if (xdr_stream_decode_bool(argp->xdr, &lock->lk_is_new) < 0)
912 return nfsd4_decode_open_to_lock_owner4(argp, lock);
913 return nfsd4_decode_exist_lock_owner4(argp, lock);
917 nfsd4_decode_lock(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
921 if (xdr_stream_decode_u32(argp->xdr, &lock->lk_type) < 0)
925 if (xdr_stream_decode_bool(argp->xdr, &lock->lk_reclaim) < 0)
927 if (xdr_stream_decode_u64(argp->xdr, &lock->lk_offset) < 0)
929 if (xdr_stream_decode_u64(argp->xdr, &lock->lk_length) < 0)
931 return nfsd4_decode_locker4(argp, lock);
935 nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
939 if (xdr_stream_decode_u32(argp->xdr, &lockt->lt_type) < 0)
943 if (xdr_stream_decode_u64(argp->xdr, &lockt->lt_offset) < 0)
945 if (xdr_stream_decode_u64(argp->xdr, &lockt->lt_length) < 0)
947 return nfsd4_decode_state_owner4(argp, &lockt->lt_clientid,
952 nfsd4_decode_locku(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
957 if (xdr_stream_decode_u32(argp->xdr, &locku->lu_type) < 0)
961 if (xdr_stream_decode_u32(argp->xdr, &locku->lu_seqid) < 0)
963 status = nfsd4_decode_stateid4(argp, &locku->lu_stateid);
966 if (xdr_stream_decode_u64(argp->xdr, &locku->lu_offset) < 0)
968 if (xdr_stream_decode_u64(argp->xdr, &locku->lu_length) < 0)
975 nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
978 return nfsd4_decode_component4(argp, &lookup->lo_name, &lookup->lo_len);
982 nfsd4_decode_createhow4(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
986 if (xdr_stream_decode_u32(argp->xdr, &open->op_createmode) < 0)
991 status = nfsd4_decode_fattr4(argp, open->op_bmval,
999 status = nfsd4_decode_verifier4(argp, &open->op_verf);
1004 if (argp->minorversion < 1)
1006 status = nfsd4_decode_verifier4(argp, &open->op_verf);
1009 status = nfsd4_decode_fattr4(argp, open->op_bmval,
1024 nfsd4_decode_openflag4(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
1028 if (xdr_stream_decode_u32(argp->xdr, &open->op_create) < 0)
1034 status = nfsd4_decode_createhow4(argp, open);
1045 static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *share_access, u32 *deleg_want, u32 *deleg_when)
1049 if (xdr_stream_decode_u32(argp->xdr, &w) < 0)
1067 if (!argp->minorversion)
1096 static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
1098 if (xdr_stream_decode_u32(argp->xdr, x) < 0)
1108 nfsd4_decode_open_claim4(struct nfsd4_compoundargs *argp,
1113 if (xdr_stream_decode_u32(argp->xdr, &open->op_claim_type) < 0)
1118 status = nfsd4_decode_component4(argp, &open->op_fname,
1124 if (xdr_stream_decode_u32(argp->xdr, &open->op_delegate_type) < 0)
1128 status = nfsd4_decode_stateid4(argp, &open->op_delegate_stateid);
1131 status = nfsd4_decode_component4(argp, &open->op_fname,
1138 if (argp->minorversion < 1)
1143 if (argp->minorversion < 1)
1145 status = nfsd4_decode_stateid4(argp, &open->op_delegate_stateid);
1157 nfsd4_decode_open(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1165 if (xdr_stream_decode_u32(argp->xdr, &open->op_seqid) < 0)
1168 status = nfsd4_decode_share_access(argp, &open->op_share_access,
1172 status = nfsd4_decode_share_deny(argp, &open->op_share_deny);
1175 status = nfsd4_decode_state_owner4(argp, &open->op_clientid,
1179 status = nfsd4_decode_openflag4(argp, open);
1182 return nfsd4_decode_open_claim4(argp, open);
1186 nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp,
1192 if (argp->minorversion >= 1)
1195 status = nfsd4_decode_stateid4(argp, &open_conf->oc_req_stateid);
1198 if (xdr_stream_decode_u32(argp->xdr, &open_conf->oc_seqid) < 0)
1207 nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp,
1214 status = nfsd4_decode_stateid4(argp, &open_down->od_stateid);
1217 if (xdr_stream_decode_u32(argp->xdr, &open_down->od_seqid) < 0)
1220 status = nfsd4_decode_share_access(argp, &open_down->od_share_access,
1224 return nfsd4_decode_share_deny(argp, &open_down->od_share_deny);
1228 nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1233 if (xdr_stream_decode_u32(argp->xdr, &putfh->pf_fhlen) < 0)
1237 p = xdr_inline_decode(argp->xdr, putfh->pf_fhlen);
1240 putfh->pf_fhval = svcxdr_savemem(argp, p, putfh->pf_fhlen);
1249 nfsd4_decode_putpubfh(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
1251 if (argp->minorversion == 0)
1257 nfsd4_decode_read(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1263 status = nfsd4_decode_stateid4(argp, &read->rd_stateid);
1266 if (xdr_stream_decode_u64(argp->xdr, &read->rd_offset) < 0)
1268 if (xdr_stream_decode_u32(argp->xdr, &read->rd_length) < 0)
1275 nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1281 if (xdr_stream_decode_u64(argp->xdr, &readdir->rd_cookie) < 0)
1283 status = nfsd4_decode_verifier4(argp, &readdir->rd_verf);
1286 if (xdr_stream_decode_u32(argp->xdr, &readdir->rd_dircount) < 0)
1288 if (xdr_stream_decode_u32(argp->xdr, &readdir->rd_maxcount) < 0)
1290 if (xdr_stream_decode_uint32_array(argp->xdr, readdir->rd_bmval,
1298 nfsd4_decode_remove(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1302 return nfsd4_decode_component4(argp, &remove->rm_name, &remove->rm_namelen);
1306 nfsd4_decode_rename(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1312 status = nfsd4_decode_component4(argp, &rename->rn_sname, &rename->rn_snamelen);
1315 return nfsd4_decode_component4(argp, &rename->rn_tname, &rename->rn_tnamelen);
1319 nfsd4_decode_renew(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1322 return nfsd4_decode_clientid4(argp, clientid);
1326 nfsd4_decode_secinfo(struct nfsd4_compoundargs *argp,
1331 return nfsd4_decode_component4(argp, &secinfo->si_name, &secinfo->si_namelen);
1335 nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1341 status = nfsd4_decode_stateid4(argp, &setattr->sa_stateid);
1344 return nfsd4_decode_fattr4(argp, setattr->sa_bmval,
1351 nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1358 if (argp->minorversion >= 1)
1361 status = nfsd4_decode_verifier4(argp, &setclientid->se_verf);
1364 status = nfsd4_decode_opaque(argp, &setclientid->se_name);
1367 if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_prog) < 0)
1369 if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_netid_len) < 0)
1371 p = xdr_inline_decode(argp->xdr, setclientid->se_callback_netid_len);
1374 setclientid->se_callback_netid_val = svcxdr_savemem(argp, p,
1379 if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_addr_len) < 0)
1381 p = xdr_inline_decode(argp->xdr, setclientid->se_callback_addr_len);
1384 setclientid->se_callback_addr_val = svcxdr_savemem(argp, p,
1388 if (xdr_stream_decode_u32(argp->xdr, &setclientid->se_callback_ident) < 0)
1395 nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp,
1401 if (argp->minorversion >= 1)
1404 status = nfsd4_decode_clientid4(argp, &scd_c->sc_clientid);
1407 return nfsd4_decode_verifier4(argp, &scd_c->sc_confirm);
1412 nfsd4_decode_verify(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1419 status = nfsd4_decode_bitmap4(argp, verify->ve_bmval,
1427 if (xdr_stream_decode_u32(argp->xdr, &verify->ve_attrlen) < 0)
1429 p = xdr_inline_decode(argp->xdr, verify->ve_attrlen);
1432 verify->ve_attrval = svcxdr_savemem(argp, p, verify->ve_attrlen);
1440 nfsd4_decode_write(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1445 status = nfsd4_decode_stateid4(argp, &write->wr_stateid);
1448 if (xdr_stream_decode_u64(argp->xdr, &write->wr_offset) < 0)
1450 if (xdr_stream_decode_u32(argp->xdr, &write->wr_stable_how) < 0)
1454 if (xdr_stream_decode_u32(argp->xdr, &write->wr_buflen) < 0)
1456 if (!xdr_stream_subsegment(argp->xdr, &write->wr_payload, write->wr_buflen))
1466 nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp,
1472 if (argp->minorversion >= 1)
1475 status = nfsd4_decode_state_owner4(argp, &rlockowner->rl_clientid,
1480 if (argp->minorversion && !zero_clientid(&rlockowner->rl_clientid))
1486 static __be32 nfsd4_decode_backchannel_ctl(struct nfsd4_compoundargs *argp,
1491 if (xdr_stream_decode_u32(argp->xdr, &bc->bc_cb_program) < 0)
1493 return nfsd4_decode_cb_sec(argp, &bc->bc_cb_sec);
1496 static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp,
1504 status = nfsd4_decode_sessionid4(argp, &bcts->sessionid);
1507 if (xdr_stream_decode_u32(argp->xdr, &bcts->dir) < 0)
1509 if (xdr_stream_decode_u32(argp->xdr, &use_conn_in_rdma_mode) < 0)
1516 nfsd4_decode_state_protect_ops(struct nfsd4_compoundargs *argp,
1521 status = nfsd4_decode_bitmap4(argp, exid->spo_must_enforce,
1525 status = nfsd4_decode_bitmap4(argp, exid->spo_must_allow,
1538 nfsd4_decode_ssv_sp_parms(struct nfsd4_compoundargs *argp,
1545 status = nfsd4_decode_state_protect_ops(argp, exid);
1550 if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
1553 status = nfsd4_decode_ignored_string(argp, 0);
1559 if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
1562 status = nfsd4_decode_ignored_string(argp, 0);
1567 if (xdr_stream_decode_u32(argp->xdr, &window) < 0)
1569 if (xdr_stream_decode_u32(argp->xdr, &num_gss_handles) < 0)
1576 nfsd4_decode_state_protect4_a(struct nfsd4_compoundargs *argp,
1581 if (xdr_stream_decode_u32(argp->xdr, &exid->spa_how) < 0)
1587 status = nfsd4_decode_state_protect_ops(argp, exid);
1592 status = nfsd4_decode_ssv_sp_parms(argp, exid);
1604 nfsd4_decode_nfs_impl_id4(struct nfsd4_compoundargs *argp,
1610 if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
1619 status = nfsd4_decode_opaque(argp, &exid->nii_domain);
1625 status = nfsd4_decode_opaque(argp, &exid->nii_name);
1628 status = nfsd4_decode_nfstime4(argp, &exid->nii_time);
1640 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,
1647 status = nfsd4_decode_verifier4(argp, &exid->verifier);
1650 status = nfsd4_decode_opaque(argp, &exid->clname);
1653 if (xdr_stream_decode_u32(argp->xdr, &exid->flags) < 0)
1655 status = nfsd4_decode_state_protect4_a(argp, exid);
1658 return nfsd4_decode_nfs_impl_id4(argp, exid);
1662 nfsd4_decode_channel_attrs4(struct nfsd4_compoundargs *argp,
1667 p = xdr_inline_decode(argp->xdr, XDR_UNIT * 7);
1683 if (xdr_stream_decode_u32(argp->xdr, &ca->rdma_attrs) < 0)
1694 nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,
1701 status = nfsd4_decode_clientid4(argp, &sess->clientid);
1704 if (xdr_stream_decode_u32(argp->xdr, &sess->seqid) < 0)
1706 if (xdr_stream_decode_u32(argp->xdr, &sess->flags) < 0)
1708 status = nfsd4_decode_channel_attrs4(argp, &sess->fore_channel);
1711 status = nfsd4_decode_channel_attrs4(argp, &sess->back_channel);
1714 if (xdr_stream_decode_u32(argp->xdr, &sess->callback_prog) < 0)
1716 return nfsd4_decode_cb_sec(argp, &sess->cb_sec);
1720 nfsd4_decode_destroy_session(struct nfsd4_compoundargs *argp,
1724 return nfsd4_decode_sessionid4(argp, &destroy_session->sessionid);
1728 nfsd4_decode_free_stateid(struct nfsd4_compoundargs *argp,
1732 return nfsd4_decode_stateid4(argp, &free_stateid->fr_stateid);
1737 nfsd4_decode_getdeviceinfo(struct nfsd4_compoundargs *argp,
1744 status = nfsd4_decode_deviceid4(argp, &gdev->gd_devid);
1747 if (xdr_stream_decode_u32(argp->xdr, &gdev->gd_layout_type) < 0)
1749 if (xdr_stream_decode_u32(argp->xdr, &gdev->gd_maxcount) < 0)
1751 if (xdr_stream_decode_uint32_array(argp->xdr,
1759 nfsd4_decode_layoutcommit(struct nfsd4_compoundargs *argp,
1766 if (xdr_stream_decode_u64(argp->xdr, &lcp->lc_seg.offset) < 0)
1768 if (xdr_stream_decode_u64(argp->xdr, &lcp->lc_seg.length) < 0)
1770 if (xdr_stream_decode_bool(argp->xdr, &lcp->lc_reclaim) < 0)
1772 status = nfsd4_decode_stateid4(argp, &lcp->lc_sid);
1775 if (xdr_stream_decode_u32(argp->xdr, &lcp->lc_newoffset) < 0)
1778 if (xdr_stream_decode_u64(argp->xdr, &lcp->lc_last_wr) < 0)
1782 p = xdr_inline_decode(argp->xdr, XDR_UNIT);
1786 status = nfsd4_decode_nfstime4(argp, &lcp->lc_mtime);
1792 return nfsd4_decode_layoutupdate4(argp, lcp);
1796 nfsd4_decode_layoutget(struct nfsd4_compoundargs *argp,
1803 if (xdr_stream_decode_u32(argp->xdr, &lgp->lg_signal) < 0)
1805 if (xdr_stream_decode_u32(argp->xdr, &lgp->lg_layout_type) < 0)
1807 if (xdr_stream_decode_u32(argp->xdr, &lgp->lg_seg.iomode) < 0)
1809 if (xdr_stream_decode_u64(argp->xdr, &lgp->lg_seg.offset) < 0)
1811 if (xdr_stream_decode_u64(argp->xdr, &lgp->lg_seg.length) < 0)
1813 if (xdr_stream_decode_u64(argp->xdr, &lgp->lg_minlength) < 0)
1815 status = nfsd4_decode_stateid4(argp, &lgp->lg_sid);
1818 if (xdr_stream_decode_u32(argp->xdr, &lgp->lg_maxcount) < 0)
1825 nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp,
1830 if (xdr_stream_decode_bool(argp->xdr, &lrp->lr_reclaim) < 0)
1832 if (xdr_stream_decode_u32(argp->xdr, &lrp->lr_layout_type) < 0)
1834 if (xdr_stream_decode_u32(argp->xdr, &lrp->lr_seg.iomode) < 0)
1836 return nfsd4_decode_layoutreturn4(argp, lrp);
1840 static __be32 nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp,
1844 if (xdr_stream_decode_u32(argp->xdr, &sin->sin_style) < 0)
1852 nfsd4_decode_sequence(struct nfsd4_compoundargs *argp,
1858 status = nfsd4_decode_sessionid4(argp, &seq->sessionid);
1861 p = xdr_inline_decode(argp->xdr, XDR_UNIT * 4);
1874 nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp,
1883 if (xdr_stream_decode_u32(argp->xdr, &test_stateid->ts_num_ids) < 0)
1888 stateid = svcxdr_tmpalloc(argp, sizeof(*stateid));
1893 status = nfsd4_decode_stateid4(argp, &stateid->ts_id_stateid);
1901 static __be32 nfsd4_decode_destroy_clientid(struct nfsd4_compoundargs *argp,
1905 return nfsd4_decode_clientid4(argp, &dc->clientid);
1908 static __be32 nfsd4_decode_reclaim_complete(struct nfsd4_compoundargs *argp,
1912 if (xdr_stream_decode_bool(argp->xdr, &rc->rca_one_fs) < 0)
1918 nfsd4_decode_fallocate(struct nfsd4_compoundargs *argp,
1924 status = nfsd4_decode_stateid4(argp, &fallocate->falloc_stateid);
1927 if (xdr_stream_decode_u64(argp->xdr, &fallocate->falloc_offset) < 0)
1929 if (xdr_stream_decode_u64(argp->xdr, &fallocate->falloc_length) < 0)
1935 static __be32 nfsd4_decode_nl4_server(struct nfsd4_compoundargs *argp,
1941 if (xdr_stream_decode_u32(argp->xdr, &ns->nl4_type) < 0)
1949 if (xdr_stream_decode_u32(argp->xdr, &naddr->netid_len) < 0)
1954 p = xdr_inline_decode(argp->xdr, naddr->netid_len);
1959 if (xdr_stream_decode_u32(argp->xdr, &naddr->addr_len) < 0)
1964 p = xdr_inline_decode(argp->xdr, naddr->addr_len);
1977 nfsd4_decode_copy(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
1985 status = nfsd4_decode_stateid4(argp, &copy->cp_src_stateid);
1988 status = nfsd4_decode_stateid4(argp, &copy->cp_dst_stateid);
1991 if (xdr_stream_decode_u64(argp->xdr, &copy->cp_src_pos) < 0)
1993 if (xdr_stream_decode_u64(argp->xdr, &copy->cp_dst_pos) < 0)
1995 if (xdr_stream_decode_u64(argp->xdr, &copy->cp_count) < 0)
1998 if (xdr_stream_decode_u32(argp->xdr, &consecutive) < 0)
2000 if (xdr_stream_decode_bool(argp->xdr, &sync) < 0)
2004 if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
2006 copy->cp_src = svcxdr_tmpalloc(argp, sizeof(*copy->cp_src));
2015 status = nfsd4_decode_nl4_server(argp, copy->cp_src);
2023 status = nfsd4_decode_nl4_server(argp, ns_dummy);
2035 nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp,
2042 cn->cpn_src = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_src));
2045 cn->cpn_dst = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_dst));
2049 status = nfsd4_decode_stateid4(argp, &cn->cpn_src_stateid);
2052 return nfsd4_decode_nl4_server(argp, cn->cpn_dst);
2056 nfsd4_decode_offload_status(struct nfsd4_compoundargs *argp,
2062 return nfsd4_decode_stateid4(argp, &os->stateid);
2066 nfsd4_decode_seek(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
2071 status = nfsd4_decode_stateid4(argp, &seek->seek_stateid);
2074 if (xdr_stream_decode_u64(argp->xdr, &seek->seek_offset) < 0)
2076 if (xdr_stream_decode_u32(argp->xdr, &seek->seek_whence) < 0)
2085 nfsd4_decode_clone(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
2090 status = nfsd4_decode_stateid4(argp, &clone->cl_src_stateid);
2093 status = nfsd4_decode_stateid4(argp, &clone->cl_dst_stateid);
2096 if (xdr_stream_decode_u64(argp->xdr, &clone->cl_src_pos) < 0)
2098 if (xdr_stream_decode_u64(argp->xdr, &clone->cl_dst_pos) < 0)
2100 if (xdr_stream_decode_u64(argp->xdr, &clone->cl_count) < 0)
2119 nfsd4_vbuf_from_vector(struct nfsd4_compoundargs *argp, struct xdr_buf *xdr,
2136 tmp = svcxdr_tmpalloc(argp, buflen);
2164 nfsd4_decode_xattr_name(struct nfsd4_compoundargs *argp, char **namep)
2170 if (xdr_stream_decode_u32(argp->xdr, &namelen) < 0)
2176 p = xdr_inline_decode(argp->xdr, namelen);
2179 name = svcxdr_tmpalloc(argp, namelen + XATTR_USER_PREFIX_LEN + 1);
2211 nfsd4_decode_getxattr(struct nfsd4_compoundargs *argp,
2219 status = nfsd4_decode_xattr_name(argp, &getxattr->getxa_name);
2223 maxcount = svc_max_payload(argp->rqstp);
2231 nfsd4_decode_setxattr(struct nfsd4_compoundargs *argp,
2240 if (xdr_stream_decode_u32(argp->xdr, &flags) < 0)
2247 status = nfsd4_decode_xattr_name(argp, &setxattr->setxa_name);
2251 maxcount = svc_max_payload(argp->rqstp);
2254 if (xdr_stream_decode_u32(argp->xdr, &size) < 0)
2263 if (!xdr_stream_subsegment(argp->xdr, &payload, size))
2265 status = nfsd4_vbuf_from_vector(argp, &payload,
2273 nfsd4_decode_listxattrs(struct nfsd4_compoundargs *argp,
2281 if (xdr_stream_decode_u64(argp->xdr, &listxattrs->lsxa_cookie) < 0)
2292 if (xdr_stream_decode_u32(argp->xdr, &maxcount) < 0)
2298 maxcount = min(maxcount, svc_max_payload(argp->rqstp));
2305 nfsd4_decode_removexattr(struct nfsd4_compoundargs *argp,
2310 return nfsd4_decode_xattr_name(argp, &removexattr->rmxa_name);
2314 nfsd4_decode_noop(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
2320 nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
2325 typedef __be32(*nfsd4_dec)(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u);
2417 nfsd4_opnum_in_range(struct nfsd4_compoundargs *argp, struct nfsd4_op *op)
2421 else if (argp->minorversion == 0 && op->opnum > LAST_NFS40_OP)
2423 else if (argp->minorversion == 1 && op->opnum > LAST_NFS41_OP)
2425 else if (argp->minorversion == 2 && op->opnum > LAST_NFS42_OP)
2431 nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
2435 int auth_slack= argp->rqstp->rq_auth_slack;
2442 if (xdr_stream_decode_u32(argp->xdr, &argp->taglen) < 0)
2445 argp->tag = NULL;
2446 if (unlikely(argp->taglen)) {
2447 if (argp->taglen > NFSD4_MAX_TAGLEN)
2449 p = xdr_inline_decode(argp->xdr, argp->taglen);
2452 argp->tag = svcxdr_savemem(argp, p, argp->taglen);
2453 if (!argp->tag)
2455 max_reply += xdr_align_size(argp->taglen);
2458 if (xdr_stream_decode_u32(argp->xdr, &argp->minorversion) < 0)
2460 if (xdr_stream_decode_u32(argp->xdr, &argp->client_opcnt) < 0)
2462 argp->opcnt = min_t(u32, argp->client_opcnt,
2465 if (argp->opcnt > ARRAY_SIZE(argp->iops)) {
2466 argp->ops = vcalloc(argp->opcnt, sizeof(*argp->ops));
2467 if (!argp->ops) {
2468 argp->ops = argp->iops;
2473 if (argp->minorversion > NFSD_SUPPORTED_MINOR_VERSION)
2474 argp->opcnt = 0;
2476 for (i = 0; i < argp->opcnt; i++) {
2477 op = &argp->ops[i];
2481 if (xdr_stream_decode_u32(argp->xdr, &op->opnum) < 0)
2483 if (nfsd4_opnum_in_range(argp, op)) {
2485 op->status = nfsd4_dec_ops[op->opnum](argp, &op->u);
2487 trace_nfsd_compound_decode_err(argp->rqstp,
2488 argp->opcnt, i,
2504 readbytes += nfsd4_max_reply(argp->rqstp, op);
2506 max_reply += nfsd4_max_reply(argp->rqstp, op);
2517 argp->opcnt = i+1;
2522 if (argp->minorversion)
2524 svc_reserve(argp->rqstp, max_reply + readbytes);
2525 argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE;
2527 argp->splice_ok = nfsd_read_splice_ok(argp->rqstp);
2529 argp->splice_ok = false;
4384 struct nfsd4_compoundargs *argp = resp->rqstp->rq_argp;
4388 bool splice_ok = argp->splice_ok;
5211 struct nfsd4_compoundargs *argp = resp->rqstp->rq_argp;
5214 bool splice_ok = argp->splice_ok;