Lines Matching refs:xdr

58 svcxdr_decode_nfstime3(struct xdr_stream *xdr, struct timespec64 *timep)
62 p = xdr_inline_decode(xdr, XDR_UNIT * 2);
73 * @xdr: XDR stream positioned at an undecoded NFSv3 FH
81 svcxdr_decode_nfs_fh3(struct xdr_stream *xdr, struct svc_fh *fhp)
86 if (xdr_stream_decode_u32(xdr, &size) < 0)
90 p = xdr_inline_decode(xdr, size);
102 * @xdr: XDR stream
110 svcxdr_encode_nfsstat3(struct xdr_stream *xdr, __be32 status)
114 p = xdr_reserve_space(xdr, sizeof(status));
123 svcxdr_encode_nfs_fh3(struct xdr_stream *xdr, const struct svc_fh *fhp)
128 p = xdr_reserve_space(xdr, XDR_UNIT + size);
140 svcxdr_encode_post_op_fh3(struct xdr_stream *xdr, const struct svc_fh *fhp)
142 if (xdr_stream_encode_item_present(xdr) < 0)
144 if (!svcxdr_encode_nfs_fh3(xdr, fhp))
151 svcxdr_encode_cookieverf3(struct xdr_stream *xdr, const __be32 *verf)
155 p = xdr_reserve_space(xdr, NFS3_COOKIEVERFSIZE);
164 svcxdr_encode_writeverf3(struct xdr_stream *xdr, const __be32 *verf)
168 p = xdr_reserve_space(xdr, NFS3_WRITEVERFSIZE);
177 svcxdr_decode_filename3(struct xdr_stream *xdr, char **name, unsigned int *len)
183 if (xdr_stream_decode_u32(xdr, &size) < 0)
187 p = xdr_inline_decode(xdr, size);
202 svcxdr_decode_diropargs3(struct xdr_stream *xdr, struct svc_fh *fhp,
205 return svcxdr_decode_nfs_fh3(xdr, fhp) &&
206 svcxdr_decode_filename3(xdr, name, len);
210 svcxdr_decode_sattr3(struct svc_rqst *rqstp, struct xdr_stream *xdr,
217 if (xdr_stream_decode_bool(xdr, &set_it) < 0)
222 if (xdr_stream_decode_u32(xdr, &mode) < 0)
227 if (xdr_stream_decode_bool(xdr, &set_it) < 0)
232 if (xdr_stream_decode_u32(xdr, &uid) < 0)
238 if (xdr_stream_decode_bool(xdr, &set_it) < 0)
243 if (xdr_stream_decode_u32(xdr, &gid) < 0)
249 if (xdr_stream_decode_bool(xdr, &set_it) < 0)
254 if (xdr_stream_decode_u64(xdr, &newsize) < 0)
259 if (xdr_stream_decode_u32(xdr, &set_it) < 0)
268 if (!svcxdr_decode_nfstime3(xdr, &iap->ia_atime))
275 if (xdr_stream_decode_u32(xdr, &set_it) < 0)
284 if (!svcxdr_decode_nfstime3(xdr, &iap->ia_mtime))
296 svcxdr_decode_sattrguard3(struct xdr_stream *xdr, struct nfsd3_sattrargs *args)
300 if (xdr_stream_decode_bool(xdr, &check) < 0)
303 if (!svcxdr_decode_nfstime3(xdr, &args->guardtime))
313 svcxdr_decode_specdata3(struct xdr_stream *xdr, struct nfsd3_mknodargs *args)
317 p = xdr_inline_decode(xdr, XDR_UNIT * 2);
327 svcxdr_decode_devicedata3(struct svc_rqst *rqstp, struct xdr_stream *xdr,
330 return svcxdr_decode_sattr3(rqstp, xdr, &args->attrs) &&
331 svcxdr_decode_specdata3(xdr, args);
335 svcxdr_encode_fattr3(struct svc_rqst *rqstp, struct xdr_stream *xdr,
342 p = xdr_reserve_space(xdr, XDR_UNIT * 21);
387 svcxdr_encode_wcc_attr(struct xdr_stream *xdr, const struct svc_fh *fhp)
391 p = xdr_reserve_space(xdr, XDR_UNIT * 6);
402 svcxdr_encode_pre_op_attr(struct xdr_stream *xdr, const struct svc_fh *fhp)
405 if (xdr_stream_encode_item_absent(xdr) < 0)
410 if (xdr_stream_encode_item_present(xdr) < 0)
412 return svcxdr_encode_wcc_attr(xdr, fhp);
418 * @xdr: XDR stream
426 svcxdr_encode_post_op_attr(struct svc_rqst *rqstp, struct xdr_stream *xdr,
442 if (xdr_stream_encode_item_present(xdr) < 0)
445 if (!svcxdr_encode_fattr3(rqstp, xdr, fhp, &stat))
451 return xdr_stream_encode_item_absent(xdr) > 0;
458 svcxdr_encode_wcc_data(struct svc_rqst *rqstp, struct xdr_stream *xdr,
467 if (!svcxdr_encode_pre_op_attr(xdr, fhp))
471 if (xdr_stream_encode_item_present(xdr) < 0)
473 if (!svcxdr_encode_fattr3(rqstp, xdr, fhp, &fhp->fh_post_attr))
479 if (xdr_stream_encode_item_absent(xdr) < 0)
481 if (!svcxdr_encode_post_op_attr(rqstp, xdr, fhp))
492 nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
496 return svcxdr_decode_nfs_fh3(xdr, &args->fh);
500 nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
504 return svcxdr_decode_nfs_fh3(xdr, &args->fh) &&
505 svcxdr_decode_sattr3(rqstp, xdr, &args->attrs) &&
506 svcxdr_decode_sattrguard3(xdr, args);
510 nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
514 return svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len);
518 nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
522 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
524 if (xdr_stream_decode_u32(xdr, &args->access) < 0)
531 nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
535 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
537 if (xdr_stream_decode_u64(xdr, &args->offset) < 0)
539 if (xdr_stream_decode_u32(xdr, &args->count) < 0)
546 nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
551 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
553 if (xdr_stream_decode_u64(xdr, &args->offset) < 0)
555 if (xdr_stream_decode_u32(xdr, &args->count) < 0)
557 if (xdr_stream_decode_u32(xdr, &args->stable) < 0)
561 if (xdr_stream_decode_u32(xdr, &args->len) < 0)
572 return xdr_stream_subsegment(xdr, &args->payload, args->count);
576 nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
580 if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len))
582 if (xdr_stream_decode_u32(xdr, &args->createmode) < 0)
587 return svcxdr_decode_sattr3(rqstp, xdr, &args->attrs);
589 args->verf = xdr_inline_decode(xdr, NFS3_CREATEVERFSIZE);
600 nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
604 return svcxdr_decode_diropargs3(xdr, &args->fh,
606 svcxdr_decode_sattr3(rqstp, xdr, &args->attrs);
610 nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
615 if (!svcxdr_decode_diropargs3(xdr, &args->ffh, &args->fname, &args->flen))
617 if (!svcxdr_decode_sattr3(rqstp, xdr, &args->attrs))
619 if (xdr_stream_decode_u32(xdr, &args->tlen) < 0)
623 args->first.iov_len = head->iov_len - xdr_stream_pos(xdr);
624 args->first.iov_base = xdr_inline_decode(xdr, args->tlen);
629 nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
633 if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len))
635 if (xdr_stream_decode_u32(xdr, &args->ftype) < 0)
640 return svcxdr_decode_devicedata3(rqstp, xdr, args);
643 return svcxdr_decode_sattr3(rqstp, xdr, &args->attrs);
657 nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
661 return svcxdr_decode_diropargs3(xdr, &args->ffh,
663 svcxdr_decode_diropargs3(xdr, &args->tfh,
668 nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
672 return svcxdr_decode_nfs_fh3(xdr, &args->ffh) &&
673 svcxdr_decode_diropargs3(xdr, &args->tfh,
678 nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
682 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
684 if (xdr_stream_decode_u64(xdr, &args->cookie) < 0)
686 args->verf = xdr_inline_decode(xdr, NFS3_COOKIEVERFSIZE);
689 if (xdr_stream_decode_u32(xdr, &args->count) < 0)
696 nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
701 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
703 if (xdr_stream_decode_u64(xdr, &args->cookie) < 0)
705 args->verf = xdr_inline_decode(xdr, NFS3_COOKIEVERFSIZE);
709 if (xdr_stream_decode_u32(xdr, &dircount) < 0)
711 if (xdr_stream_decode_u32(xdr, &args->count) < 0)
718 nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
722 if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
724 if (xdr_stream_decode_u64(xdr, &args->offset) < 0)
726 if (xdr_stream_decode_u32(xdr, &args->count) < 0)
738 nfs3svc_encode_getattrres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
742 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
747 if (!svcxdr_encode_fattr3(rqstp, xdr, &resp->fh, &resp->stat))
757 nfs3svc_encode_wccstat(struct svc_rqst *rqstp, struct xdr_stream *xdr)
761 return svcxdr_encode_nfsstat3(xdr, resp->status) &&
762 svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh);
767 nfs3svc_encode_lookupres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
771 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
775 if (!svcxdr_encode_nfs_fh3(xdr, &resp->fh))
777 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
779 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->dirfh))
783 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->dirfh))
792 nfs3svc_encode_accessres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
796 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
800 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
802 if (xdr_stream_encode_u32(xdr, resp->access) < 0)
806 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
815 nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
820 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
824 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
826 if (xdr_stream_encode_u32(xdr, resp->len) < 0)
828 svcxdr_encode_opaque_pages(rqstp, xdr, resp->pages, 0,
834 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
843 nfs3svc_encode_readres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
848 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
852 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
854 if (xdr_stream_encode_u32(xdr, resp->count) < 0)
856 if (xdr_stream_encode_bool(xdr, resp->eof) < 0)
858 if (xdr_stream_encode_u32(xdr, resp->count) < 0)
860 svcxdr_encode_opaque_pages(rqstp, xdr, resp->pages,
867 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
876 nfs3svc_encode_writeres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
880 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
884 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))
886 if (xdr_stream_encode_u32(xdr, resp->count) < 0)
888 if (xdr_stream_encode_u32(xdr, resp->committed) < 0)
890 if (!svcxdr_encode_writeverf3(xdr, resp->verf))
894 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))
903 nfs3svc_encode_createres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
907 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
911 if (!svcxdr_encode_post_op_fh3(xdr, &resp->fh))
913 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
915 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->dirfh))
919 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->dirfh))
928 nfs3svc_encode_renameres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
932 return svcxdr_encode_nfsstat3(xdr, resp->status) &&
933 svcxdr_encode_wcc_data(rqstp, xdr, &resp->ffh) &&
934 svcxdr_encode_wcc_data(rqstp, xdr, &resp->tfh);
939 nfs3svc_encode_linkres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
943 return svcxdr_encode_nfsstat3(xdr, resp->status) &&
944 svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh) &&
945 svcxdr_encode_wcc_data(rqstp, xdr, &resp->tfh);
950 nfs3svc_encode_readdirres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
955 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
959 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
961 if (!svcxdr_encode_cookieverf3(xdr, resp->verf))
963 svcxdr_encode_opaque_pages(rqstp, xdr, dirlist->pages, 0,
966 if (xdr_stream_encode_item_absent(xdr) < 0)
968 if (xdr_stream_encode_bool(xdr, resp->common.err == nfserr_eof) < 0)
972 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &resp->fh))
1041 struct xdr_stream *xdr = &resp->xdr;
1043 if (xdr_stream_encode_item_present(xdr) < 0)
1046 if (xdr_stream_encode_u64(xdr, ino) < 0)
1049 if (xdr_stream_encode_opaque(xdr, name, min(namlen, NFS3_MAXNAMLEN)) < 0)
1053 if (xdr_stream_encode_u64(xdr, OFFSET_MAX) < 0)
1073 * - resp->xdr
1092 xdr_commit_encode(&resp->xdr);
1107 struct xdr_stream *xdr = &resp->xdr;
1116 if (!svcxdr_encode_post_op_attr(resp->rqstp, xdr, fhp))
1118 if (!svcxdr_encode_post_op_fh3(xdr, fhp))
1127 if (xdr_stream_encode_item_absent(xdr) < 0)
1129 if (xdr_stream_encode_item_absent(xdr) < 0)
1148 * - resp->xdr
1169 xdr_commit_encode(&resp->xdr);
1181 svcxdr_encode_fsstat3resok(struct xdr_stream *xdr,
1188 p = xdr_reserve_space(xdr, XDR_UNIT * 13);
1204 nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
1208 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
1212 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1214 if (!svcxdr_encode_fsstat3resok(xdr, resp))
1218 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1226 svcxdr_encode_fsinfo3resok(struct xdr_stream *xdr,
1231 p = xdr_reserve_space(xdr, XDR_UNIT * 12);
1250 nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, struct xdr_stream *xdr)
1254 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
1258 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1260 if (!svcxdr_encode_fsinfo3resok(xdr, resp))
1264 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1272 svcxdr_encode_pathconf3resok(struct xdr_stream *xdr,
1277 p = xdr_reserve_space(xdr, XDR_UNIT * 6);
1292 nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
1296 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
1300 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1302 if (!svcxdr_encode_pathconf3resok(xdr, resp))
1306 if (!svcxdr_encode_post_op_attr(rqstp, xdr, &nfs3svc_null_fh))
1315 nfs3svc_encode_commitres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
1319 if (!svcxdr_encode_nfsstat3(xdr, resp->status))
1323 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))
1325 if (!svcxdr_encode_writeverf3(xdr, resp->verf))
1329 if (!svcxdr_encode_wcc_data(rqstp, xdr, &resp->fh))