• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/nfs/

Lines Matching refs:xdr

470 	p = xdr_reserve_space(xdr, nbytes);			\
475 static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
479 p = xdr_reserve_space(xdr, 4 + len);
484 static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
498 static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf)
502 p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE);
507 static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server)
633 static int encode_access(struct xdr_stream *xdr, u32 access)
644 static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
656 static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args)
668 static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create)
680 xdr_write_pages(xdr, create->u.symlink.pages, 0, create->u.symlink.len);
697 return encode_attrs(xdr, create->attrs, create->server);
700 static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
711 static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1)
723 static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask)
725 return encode_getattr_two(xdr,
730 static int encode_fsinfo(struct xdr_stream *xdr, const u32* bitmask)
732 return encode_getattr_two(xdr, bitmask[0] & nfs4_fsinfo_bitmap[0],
736 static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask)
738 return encode_getattr_two(xdr,
743 static int encode_getfh(struct xdr_stream *xdr)
753 static int encode_link(struct xdr_stream *xdr, const struct qstr *name)
783 static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
812 static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args)
828 static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args)
843 static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
856 static void encode_share_access(struct xdr_stream *xdr, int open_flags)
877 static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg)
887 encode_share_access(xdr, arg->open_flags);
894 static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg)
902 encode_attrs(xdr, arg->u.attrs, arg->server);
906 encode_nfs4_verifier(xdr, &arg->u.verifier);
910 static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *arg)
922 encode_createmode(xdr, arg);
926 static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation_type)
946 static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr *name)
952 encode_string(xdr, name->len, name->name);
955 static inline void encode_claim_previous(struct xdr_stream *xdr, int type)
961 encode_delegation_type(xdr, type);
964 static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struct qstr *name, const nfs4_stateid *stateid)
971 encode_string(xdr, name->len, name->name);
974 static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg)
976 encode_openhdr(xdr, arg);
977 encode_opentype(xdr, arg);
980 encode_claim_null(xdr, arg->name);
983 encode_claim_previous(xdr, arg->u.delegation_type);
986 encode_claim_delegate_cur(xdr, arg->name, &arg->u.delegation);
994 static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg)
1006 static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
1014 encode_share_access(xdr, arg->open_flags);
1019 encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
1032 static int encode_putrootfh(struct xdr_stream *xdr)
1042 static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx)
1055 static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
1062 encode_stateid(xdr, args->context);
1071 static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req)
1117 static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req)
1137 static int encode_remove(struct xdr_stream *xdr, const struct qstr *name)
1149 static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname)
1165 static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid)
1177 encode_restorefh(struct xdr_stream *xdr)
1188 encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
1202 xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len);
1207 encode_savefh(struct xdr_stream *xdr)
1217 static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server)
1226 if ((status = encode_attrs(xdr, arg->iap, server)))
1232 static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid)
1240 encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name);
1243 encode_string(xdr, setclientid->sc_netid_len, setclientid->sc_netid);
1244 encode_string(xdr, setclientid->sc_uaddr_len, setclientid->sc_uaddr);
1251 static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state)
1263 static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args)
1270 encode_stateid(xdr, args->context);
1277 xdr_write_pages(xdr, args->pages, args->pgbase, args->count);
1282 static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid)
1302 struct xdr_stream xdr;
1308 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1309 encode_compound_hdr(&xdr, &hdr);
1310 if ((status = encode_putfh(&xdr, args->fh)) == 0)
1311 status = encode_access(&xdr, args->access);
1320 struct xdr_stream xdr;
1326 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1327 encode_compound_hdr(&xdr, &hdr);
1328 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0)
1330 if ((status = encode_lookup(&xdr, args->name)) != 0)
1332 if ((status = encode_getfh(&xdr)) != 0)
1334 status = encode_getfattr(&xdr, args->bitmask);
1344 struct xdr_stream xdr;
1350 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1351 encode_compound_hdr(&xdr, &hdr);
1352 if ((status = encode_putrootfh(&xdr)) != 0)
1354 if ((status = encode_getfh(&xdr)) == 0)
1355 status = encode_getfattr(&xdr, args->bitmask);
1365 struct xdr_stream xdr;
1371 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1372 encode_compound_hdr(&xdr, &hdr);
1373 if ((status = encode_putfh(&xdr, args->fh)) != 0)
1375 if ((status = encode_remove(&xdr, args->name)) != 0)
1377 status = encode_getfattr(&xdr, args->bitmask);
1387 struct xdr_stream xdr;
1393 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1394 encode_compound_hdr(&xdr, &hdr);
1395 if ((status = encode_putfh(&xdr, args->old_dir)) != 0)
1397 if ((status = encode_savefh(&xdr)) != 0)
1399 if ((status = encode_putfh(&xdr, args->new_dir)) != 0)
1401 if ((status = encode_rename(&xdr, args->old_name, args->new_name)) != 0)
1403 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0)
1405 if ((status = encode_restorefh(&xdr)) != 0)
1407 status = encode_getfattr(&xdr, args->bitmask);
1417 struct xdr_stream xdr;
1423 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1424 encode_compound_hdr(&xdr, &hdr);
1425 if ((status = encode_putfh(&xdr, args->fh)) != 0)
1427 if ((status = encode_savefh(&xdr)) != 0)
1429 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0)
1431 if ((status = encode_link(&xdr, args->name)) != 0)
1433 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0)
1435 if ((status = encode_restorefh(&xdr)) != 0)
1437 status = encode_getfattr(&xdr, args->bitmask);
1447 struct xdr_stream xdr;
1453 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1454 encode_compound_hdr(&xdr, &hdr);
1455 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0)
1457 if ((status = encode_savefh(&xdr)) != 0)
1459 if ((status = encode_create(&xdr, args)) != 0)
1461 if ((status = encode_getfh(&xdr)) != 0)
1463 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0)
1465 if ((status = encode_restorefh(&xdr)) != 0)
1467 status = encode_getfattr(&xdr, args->bitmask);
1485 struct xdr_stream xdr;
1491 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1492 encode_compound_hdr(&xdr, &hdr);
1493 if ((status = encode_putfh(&xdr, args->fh)) == 0)
1494 status = encode_getfattr(&xdr, args->bitmask);
1503 struct xdr_stream xdr;
1509 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1510 encode_compound_hdr(&xdr, &hdr);
1511 status = encode_putfh(&xdr, args->fh);
1514 status = encode_close(&xdr, args);
1517 status = encode_getfattr(&xdr, args->bitmask);
1527 struct xdr_stream xdr;
1533 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1534 encode_compound_hdr(&xdr, &hdr);
1535 status = encode_putfh(&xdr, args->fh);
1538 status = encode_savefh(&xdr);
1541 status = encode_open(&xdr, args);
1544 status = encode_getfh(&xdr);
1547 status = encode_getfattr(&xdr, args->bitmask);
1550 status = encode_restorefh(&xdr);
1553 status = encode_getfattr(&xdr, args->bitmask);
1563 struct xdr_stream xdr;
1569 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1570 encode_compound_hdr(&xdr, &hdr);
1571 status = encode_putfh(&xdr, args->fh);
1574 status = encode_open_confirm(&xdr, args);
1584 struct xdr_stream xdr;
1590 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1591 encode_compound_hdr(&xdr, &hdr);
1592 status = encode_putfh(&xdr, args->fh);
1595 status = encode_open(&xdr, args);
1598 status = encode_getfattr(&xdr, args->bitmask);
1608 struct xdr_stream xdr;
1614 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1615 encode_compound_hdr(&xdr, &hdr);
1616 status = encode_putfh(&xdr, args->fh);
1619 status = encode_open_downgrade(&xdr, args);
1622 status = encode_getfattr(&xdr, args->bitmask);
1632 struct xdr_stream xdr;
1638 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1639 encode_compound_hdr(&xdr, &hdr);
1640 status = encode_putfh(&xdr, args->fh);
1643 status = encode_lock(&xdr, args);
1653 struct xdr_stream xdr;
1659 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1660 encode_compound_hdr(&xdr, &hdr);
1661 status = encode_putfh(&xdr, args->fh);
1664 status = encode_lockt(&xdr, args);
1674 struct xdr_stream xdr;
1680 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1681 encode_compound_hdr(&xdr, &hdr);
1682 status = encode_putfh(&xdr, args->fh);
1685 status = encode_locku(&xdr, args);
1695 struct xdr_stream xdr;
1701 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1702 encode_compound_hdr(&xdr, &hdr);
1703 status = encode_putfh(&xdr, args->fh);
1706 status = encode_readlink(&xdr, args, req);
1716 struct xdr_stream xdr;
1722 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1723 encode_compound_hdr(&xdr, &hdr);
1724 status = encode_putfh(&xdr, args->fh);
1727 status = encode_readdir(&xdr, args, req);
1738 struct xdr_stream xdr;
1744 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1745 encode_compound_hdr(&xdr, &hdr);
1746 status = encode_putfh(&xdr, args->fh);
1749 status = encode_read(&xdr, args);
1770 struct xdr_stream xdr;
1776 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1777 encode_compound_hdr(&xdr, &hdr);
1778 status = encode_putfh(&xdr, args->fh);
1781 status = encode_setattr(&xdr, args, args->server);
1784 status = encode_getfattr(&xdr, args->bitmask);
1796 struct xdr_stream xdr;
1803 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1804 encode_compound_hdr(&xdr, &hdr);
1805 status = encode_putfh(&xdr, args->fh);
1808 status = encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0);
1822 struct xdr_stream xdr;
1828 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1829 encode_compound_hdr(&xdr, &hdr);
1830 status = encode_putfh(&xdr, args->fh);
1833 status = encode_write(&xdr, args);
1836 status = encode_getfattr(&xdr, args->bitmask);
1846 struct xdr_stream xdr;
1852 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1853 encode_compound_hdr(&xdr, &hdr);
1854 status = encode_putfh(&xdr, args->fh);
1857 status = encode_commit(&xdr, args);
1860 status = encode_getfattr(&xdr, args->bitmask);
1870 struct xdr_stream xdr;
1876 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1877 encode_compound_hdr(&xdr, &hdr);
1878 status = encode_putfh(&xdr, args->fh);
1880 status = encode_fsinfo(&xdr, args->bitmask);
1889 struct xdr_stream xdr;
1895 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1896 encode_compound_hdr(&xdr, &hdr);
1897 status = encode_putfh(&xdr, args->fh);
1899 status = encode_getattr_one(&xdr,
1909 struct xdr_stream xdr;
1915 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1916 encode_compound_hdr(&xdr, &hdr);
1917 status = encode_putfh(&xdr, args->fh);
1919 status = encode_getattr_two(&xdr,
1930 struct xdr_stream xdr;
1936 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1937 encode_compound_hdr(&xdr, &hdr);
1938 status = encode_putfh(&xdr, fhandle);
1940 status = encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS|
1952 struct xdr_stream xdr;
1957 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1958 encode_compound_hdr(&xdr, &hdr);
1959 return encode_renew(&xdr, clp);
1967 struct xdr_stream xdr;
1972 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1973 encode_compound_hdr(&xdr, &hdr);
1974 return encode_setclientid(&xdr, sc);
1982 struct xdr_stream xdr;
1989 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1990 encode_compound_hdr(&xdr, &hdr);
1991 status = encode_setclientid_confirm(&xdr, clp);
1993 status = encode_putrootfh(&xdr);
1995 status = encode_fsinfo(&xdr, lease_bitmap);
2004 struct xdr_stream xdr;
2010 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2011 encode_compound_hdr(&xdr, &hdr);
2012 status = encode_putfh(&xdr, args->fhandle);
2015 status = encode_delegreturn(&xdr, args->stateid);
2018 status = encode_getfattr(&xdr, args->bitmask);
2028 struct xdr_stream xdr;
2036 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2037 encode_compound_hdr(&xdr, &hdr);
2038 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0)
2040 if ((status = encode_lookup(&xdr, args->name)) != 0)
2042 if ((status = encode_fs_locations(&xdr, args->bitmask)) != 0)
2081 p = xdr_inline_decode(xdr, nbytes); \
2085 printk(KERN_INFO "%s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \
2086 __FUNCTION__, xdr->p, nbytes, xdr->end); \
2091 static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string)
2102 static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
2117 static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
2139 static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp)
2146 return decode_opaque_inline(xdr, &strlen, &str);
2149 static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
2167 static inline int decode_attr_length(struct xdr_stream *xdr, uint32_t *attrlen, __be32 **savep)
2173 *savep = xdr->p;
2177 static int decode_attr_supported(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *bitmask)
2180 decode_attr_bitmap(xdr, bitmask);
2188 static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *type)
2208 static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *change)
2225 static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *size)
2241 static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2257 static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2273 static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_fsid *fsid)
2293 static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2309 static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2325 static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
2341 static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
2357 static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2374 static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2391 static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2408 static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path)
2424 status = decode_opaque_inline(xdr, &component->len, &component->data);
2453 static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res)
2465 status = decode_pathname(xdr, &res->fs_path);
2486 status = decode_opaque_inline(xdr, &server->len, &server->data);
2498 status = decode_opaque_inline(xdr, &len, &data);
2504 status = decode_pathname(xdr, &loc->rootpath);
2518 static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2535 static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxlink)
2552 static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxname)
2569 static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2590 static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
2611 static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *mode)
2628 static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *nlink)
2644 static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *uid)
2669 static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *gid)
2694 static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rdev)
2717 static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2734 static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2751 static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2768 static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used)
2785 static int decode_attr_time(struct xdr_stream *xdr, struct timespec *time)
2799 static int decode_attr_time_access(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time)
2808 status = decode_attr_time(xdr, time);
2815 static int decode_attr_time_metadata(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time)
2824 status = decode_attr_time(xdr, time);
2831 static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time)
2840 status = decode_attr_time(xdr, time);
2847 static int verify_attr_len(struct xdr_stream *xdr, __be32 *savep, uint32_t attrlen)
2850 unsigned int nwords = xdr->p - savep;
2863 static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
2874 static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access)
2880 status = decode_op_hdr(xdr, OP_ACCESS);
2891 static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
2896 status = decode_op_hdr(xdr, OP_CLOSE);
2904 static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res)
2909 status = decode_op_hdr(xdr, OP_COMMIT);
2917 static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
2923 status = decode_op_hdr(xdr, OP_CREATE);
2926 if ((status = decode_change_info(xdr, cinfo)))
2934 static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res)
2941 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
2943 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
2945 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
2947 if ((status = decode_attr_supported(xdr, bitmap, res->attr_bitmask)) != 0)
2949 if ((status = decode_attr_link_support(xdr, bitmap, &res->has_links)) != 0)
2951 if ((status = decode_attr_symlink_support(xdr, bitmap, &res->has_symlinks)) != 0)
2953 if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0)
2955 status = verify_attr_len(xdr, savep, attrlen);
2957 dprintk("%s: xdr returned %d!\n", __FUNCTION__, -status);
2961 static int decode_statfs(struct xdr_stream *xdr, struct nfs_fsstat *fsstat)
2968 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
2970 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
2972 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
2975 if ((status = decode_attr_files_avail(xdr, bitmap, &fsstat->afiles)) != 0)
2977 if ((status = decode_attr_files_free(xdr, bitmap, &fsstat->ffiles)) != 0)
2979 if ((status = decode_attr_files_total(xdr, bitmap, &fsstat->tfiles)) != 0)
2981 if ((status = decode_attr_space_avail(xdr, bitmap, &fsstat->abytes)) != 0)
2983 if ((status = decode_attr_space_free(xdr, bitmap, &fsstat->fbytes)) != 0)
2985 if ((status = decode_attr_space_total(xdr, bitmap, &fsstat->tbytes)) != 0)
2988 status = verify_attr_len(xdr, savep, attrlen);
2990 dprintk("%s: xdr returned %d!\n", __FUNCTION__, -status);
2994 static int decode_pathconf(struct xdr_stream *xdr, struct nfs_pathconf *pathconf)
3001 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
3003 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
3005 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
3008 if ((status = decode_attr_maxlink(xdr, bitmap, &pathconf->max_link)) != 0)
3010 if ((status = decode_attr_maxname(xdr, bitmap, &pathconf->max_namelen)) != 0)
3013 status = verify_attr_len(xdr, savep, attrlen);
3015 dprintk("%s: xdr returned %d!\n", __FUNCTION__, -status);
3019 static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, const struct nfs_server *server)
3028 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
3030 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
3036 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
3040 if ((status = decode_attr_type(xdr, bitmap, &type)) != 0)
3045 if ((status = decode_attr_change(xdr, bitmap, &fattr->change_attr)) != 0)
3047 if ((status = decode_attr_size(xdr, bitmap, &fattr->size)) != 0)
3049 if ((status = decode_attr_fsid(xdr, bitmap, &fattr->fsid)) != 0)
3051 if ((status = decode_attr_fileid(xdr, bitmap, &fattr->fileid)) != 0)
3053 if ((status = decode_attr_fs_locations(xdr, bitmap, container_of(fattr,
3057 if ((status = decode_attr_mode(xdr, bitmap, &fattr->mode)) != 0)
3060 if ((status = decode_attr_nlink(xdr, bitmap, &fattr->nlink)) != 0)
3062 if ((status = decode_attr_owner(xdr, bitmap, server->nfs_client, &fattr->uid)) != 0)
3064 if ((status = decode_attr_group(xdr, bitmap, server->nfs_client, &fattr->gid)) != 0)
3066 if ((status = decode_attr_rdev(xdr, bitmap, &fattr->rdev)) != 0)
3068 if ((status = decode_attr_space_used(xdr, bitmap, &fattr->du.nfs3.used)) != 0)
3070 if ((status = decode_attr_time_access(xdr, bitmap, &fattr->atime)) != 0)
3072 if ((status = decode_attr_time_metadata(xdr, bitmap, &fattr->ctime)) != 0)
3074 if ((status = decode_attr_time_modify(xdr, bitmap, &fattr->mtime)) != 0)
3076 if ((status = decode_attr_mounted_on_fileid(xdr, bitmap, &fileid)) != 0)
3080 if ((status = verify_attr_len(xdr, savep, attrlen)) == 0)
3083 dprintk("%s: xdr returned %d\n", __FUNCTION__, -status);
3088 static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
3094 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
3096 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
3098 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
3103 if ((status = decode_attr_lease_time(xdr, bitmap, &fsinfo->lease_time)) != 0)
3105 if ((status = decode_attr_maxfilesize(xdr, bitmap, &fsinfo->maxfilesize)) != 0)
3107 if ((status = decode_attr_maxread(xdr, bitmap, &fsinfo->rtmax)) != 0)
3110 if ((status = decode_attr_maxwrite(xdr, bitmap, &fsinfo->wtmax)) != 0)
3114 status = verify_attr_len(xdr, savep, attrlen);
3116 dprintk("%s: xdr returned %d!\n", __FUNCTION__, -status);
3120 static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh)
3126 status = decode_op_hdr(xdr, OP_GETFH);
3142 static int decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
3146 status = decode_op_hdr(xdr, OP_LINK);
3149 return decode_change_info(xdr, cinfo);
3155 static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl)
3181 static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res)
3186 status = decode_op_hdr(xdr, OP_LOCK);
3191 return decode_lock_denied(xdr, NULL);
3195 static int decode_lockt(struct xdr_stream *xdr, struct nfs_lockt_res *res)
3198 status = decode_op_hdr(xdr, OP_LOCKT);
3200 return decode_lock_denied(xdr, res->denied);
3204 static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res)
3209 status = decode_op_hdr(xdr, OP_LOCKU);
3217 static int decode_lookup(struct xdr_stream *xdr)
3219 return decode_op_hdr(xdr, OP_LOOKUP);
3223 static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize)
3242 static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
3262 if (decode_space_limit(xdr, &res->maxsize) < 0)
3265 return decode_ace(xdr, NULL, res->server->nfs_client);
3268 static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
3274 status = decode_op_hdr(xdr, OP_OPEN);
3280 decode_change_info(xdr, &res->cinfo);
3290 return decode_delegation(xdr, res);
3296 static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res)
3301 status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
3309 static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res)
3314 status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE);
3322 static int decode_putfh(struct xdr_stream *xdr)
3324 return decode_op_hdr(xdr, OP_PUTFH);
3327 static int decode_putrootfh(struct xdr_stream *xdr)
3329 return decode_op_hdr(xdr, OP_PUTROOTFH);
3332 static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res)
3339 status = decode_op_hdr(xdr, OP_READ);
3353 xdr_read_pages(xdr, count);
3359 static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_readdir_res *readdir)
3369 status = decode_op_hdr(xdr, OP_READDIR);
3384 xdr_read_pages(xdr, pglen);
3434 static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
3443 status = decode_op_hdr(xdr, OP_READLINK);
3454 hdrlen = (char *) xdr->p - (char *) iov->iov_base;
3461 xdr_read_pages(xdr, len);
3475 static int decode_remove(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
3479 status = decode_op_hdr(xdr, OP_REMOVE);
3482 status = decode_change_info(xdr, cinfo);
3487 static int decode_rename(struct xdr_stream *xdr, struct nfs4_change_info *old_cinfo,
3492 status = decode_op_hdr(xdr, OP_RENAME);
3495 if ((status = decode_change_info(xdr, old_cinfo)))
3497 status = decode_change_info(xdr, new_cinfo);
3502 static int decode_renew(struct xdr_stream *xdr)
3504 return decode_op_hdr(xdr, OP_RENEW);
3508 decode_restorefh(struct xdr_stream *xdr)
3510 return decode_op_hdr(xdr, OP_RESTOREFH);
3513 static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
3523 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
3525 if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
3527 if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0)
3537 hdrlen = (u8 *)xdr->p - (u8 *)iov->iov_base;
3545 xdr_read_pages(xdr, attrlen);
3555 decode_savefh(struct xdr_stream *xdr)
3557 return decode_op_hdr(xdr, OP_SAVEFH);
3560 static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res)
3567 status = decode_op_hdr(xdr, OP_SETATTR);
3576 static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp)
3614 static int decode_setclientid_confirm(struct xdr_stream *xdr)
3616 return decode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM);
3619 static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res)
3624 status = decode_op_hdr(xdr, OP_WRITE);
3635 static int decode_delegreturn(struct xdr_stream *xdr)
3637 return decode_op_hdr(xdr, OP_DELEGRETURN);
3645 struct xdr_stream xdr;
3649 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3650 status = decode_compound_hdr(&xdr, &hdr);
3653 status = decode_putfh(&xdr);
3656 status = decode_open_downgrade(&xdr, res);
3659 decode_getfattr(&xdr, res->fattr, res->server);
3673 struct xdr_stream xdr;
3677 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3678 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3680 if ((status = decode_putfh(&xdr)) == 0)
3681 status = decode_access(&xdr, res);
3691 struct xdr_stream xdr;
3695 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3696 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3698 if ((status = decode_putfh(&xdr)) != 0)
3700 if ((status = decode_lookup(&xdr)) != 0)
3702 if ((status = decode_getfh(&xdr, res->fh)) != 0)
3704 status = decode_getfattr(&xdr, res->fattr, res->server);
3714 struct xdr_stream xdr;
3718 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3719 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3721 if ((status = decode_putrootfh(&xdr)) != 0)
3723 if ((status = decode_getfh(&xdr, res->fh)) == 0)
3724 status = decode_getfattr(&xdr, res->fattr, res->server);
3734 struct xdr_stream xdr;
3738 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3739 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3741 if ((status = decode_putfh(&xdr)) != 0)
3743 if ((status = decode_remove(&xdr, &res->cinfo)) != 0)
3745 decode_getfattr(&xdr, res->dir_attr, res->server);
3755 struct xdr_stream xdr;
3759 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3760 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3762 if ((status = decode_putfh(&xdr)) != 0)
3764 if ((status = decode_savefh(&xdr)) != 0)
3766 if ((status = decode_putfh(&xdr)) != 0)
3768 if ((status = decode_rename(&xdr, &res->old_cinfo, &res->new_cinfo)) != 0)
3771 if (decode_getfattr(&xdr, res->new_fattr, res->server) != 0)
3773 if ((status = decode_restorefh(&xdr)) != 0)
3775 decode_getfattr(&xdr, res->old_fattr, res->server);
3785 struct xdr_stream xdr;
3789 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3790 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3792 if ((status = decode_putfh(&xdr)) != 0)
3794 if ((status = decode_savefh(&xdr)) != 0)
3796 if ((status = decode_putfh(&xdr)) != 0)
3798 if ((status = decode_link(&xdr, &res->cinfo)) != 0)
3804 if (decode_getfattr(&xdr, res->dir_attr, res->server) != 0)
3806 if ((status = decode_restorefh(&xdr)) != 0)
3808 decode_getfattr(&xdr, res->fattr, res->server);
3818 struct xdr_stream xdr;
3822 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3823 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
3825 if ((status = decode_putfh(&xdr)) != 0)
3827 if ((status = decode_savefh(&xdr)) != 0)
3829 if ((status = decode_create(&xdr,&res->dir_cinfo)) != 0)
3831 if ((status = decode_getfh(&xdr, res->fh)) != 0)
3833 if (decode_getfattr(&xdr, res->fattr, res->server) != 0)
3835 if ((status = decode_restorefh(&xdr)) != 0)
3837 decode_getfattr(&xdr, res->dir_fattr, res->server);
3855 struct xdr_stream xdr;
3859 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3860 status = decode_compound_hdr(&xdr, &hdr);
3863 status = decode_putfh(&xdr);
3866 status = decode_getfattr(&xdr, res->fattr, res->server);
3878 struct xdr_stream xdr;
3884 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
3885 encode_compound_hdr(&xdr, &hdr);
3886 status = encode_putfh(&xdr, args->fh);
3889 status = encode_setacl(&xdr, args);
3899 struct xdr_stream xdr;
3903 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3904 status = decode_compound_hdr(&xdr, &hdr);
3907 status = decode_putfh(&xdr);
3910 status = decode_setattr(&xdr, res);
3921 struct xdr_stream xdr;
3925 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3926 status = decode_compound_hdr(&xdr, &hdr);
3929 status = decode_putfh(&xdr);
3932 status = decode_getacl(&xdr, rqstp, acl_len);
3943 struct xdr_stream xdr;
3947 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3948 status = decode_compound_hdr(&xdr, &hdr);
3951 status = decode_putfh(&xdr);
3954 status = decode_close(&xdr, res);
3963 decode_getfattr(&xdr, res->fattr, res->server);
3973 struct xdr_stream xdr;
3977 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
3978 status = decode_compound_hdr(&xdr, &hdr);
3981 status = decode_putfh(&xdr);
3984 status = decode_savefh(&xdr);
3987 status = decode_open(&xdr, res);
3990 status = decode_getfh(&xdr, &res->fh);
3993 if (decode_getfattr(&xdr, res->f_attr, res->server) != 0)
3995 if ((status = decode_restorefh(&xdr)) != 0)
3997 decode_getfattr(&xdr, res->dir_attr, res->server);
4007 struct xdr_stream xdr;
4011 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4012 status = decode_compound_hdr(&xdr, &hdr);
4015 status = decode_putfh(&xdr);
4018 status = decode_open_confirm(&xdr, res);
4028 struct xdr_stream xdr;
4032 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4033 status = decode_compound_hdr(&xdr, &hdr);
4036 status = decode_putfh(&xdr);
4039 status = decode_open(&xdr, res);
4042 decode_getfattr(&xdr, res->f_attr, res->server);
4052 struct xdr_stream xdr;
4056 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4057 status = decode_compound_hdr(&xdr, &hdr);
4060 status = decode_putfh(&xdr);
4063 status = decode_setattr(&xdr, res);
4066 status = decode_getfattr(&xdr, res->fattr, res->server);
4078 struct xdr_stream xdr;
4082 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4083 status = decode_compound_hdr(&xdr, &hdr);
4086 status = decode_putfh(&xdr);
4089 status = decode_lock(&xdr, res);
4099 struct xdr_stream xdr;
4103 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4104 status = decode_compound_hdr(&xdr, &hdr);
4107 status = decode_putfh(&xdr);
4110 status = decode_lockt(&xdr, res);
4120 struct xdr_stream xdr;
4124 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4125 status = decode_compound_hdr(&xdr, &hdr);
4128 status = decode_putfh(&xdr);
4131 status = decode_locku(&xdr, res);
4141 struct xdr_stream xdr;
4145 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4146 status = decode_compound_hdr(&xdr, &hdr);
4149 status = decode_putfh(&xdr);
4152 status = decode_readlink(&xdr, rqstp);
4162 struct xdr_stream xdr;
4166 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4167 status = decode_compound_hdr(&xdr, &hdr);
4170 status = decode_putfh(&xdr);
4173 status = decode_readdir(&xdr, rqstp, res);
4183 struct xdr_stream xdr;
4187 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4188 status = decode_compound_hdr(&xdr, &hdr);
4191 status = decode_putfh(&xdr);
4194 status = decode_read(&xdr, rqstp, res);
4206 struct xdr_stream xdr;
4210 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4211 status = decode_compound_hdr(&xdr, &hdr);
4214 status = decode_putfh(&xdr);
4217 status = decode_write(&xdr, res);
4220 decode_getfattr(&xdr, res->fattr, res->server);
4232 struct xdr_stream xdr;
4236 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4237 status = decode_compound_hdr(&xdr, &hdr);
4240 status = decode_putfh(&xdr);
4243 status = decode_commit(&xdr, res);
4246 decode_getfattr(&xdr, res->fattr, res->server);
4256 struct xdr_stream xdr;
4260 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4261 status = decode_compound_hdr(&xdr, &hdr);
4263 status = decode_putfh(&xdr);
4265 status = decode_fsinfo(&xdr, fsinfo);
4276 struct xdr_stream xdr;
4280 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4281 status = decode_compound_hdr(&xdr, &hdr);
4283 status = decode_putfh(&xdr);
4285 status = decode_pathconf(&xdr, pathconf);
4294 struct xdr_stream xdr;
4298 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4299 status = decode_compound_hdr(&xdr, &hdr);
4301 status = decode_putfh(&xdr);
4303 status = decode_statfs(&xdr, fsstat);
4312 struct xdr_stream xdr;
4316 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4317 if ((status = decode_compound_hdr(&xdr, &hdr)) != 0)
4319 if ((status = decode_putfh(&xdr)) != 0)
4321 status = decode_server_caps(&xdr, res);
4331 struct xdr_stream xdr;
4335 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4336 status = decode_compound_hdr(&xdr, &hdr);
4338 status = decode_renew(&xdr);
4348 struct xdr_stream xdr;
4352 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4353 status = decode_compound_hdr(&xdr, &hdr);
4355 status = decode_setclientid(&xdr, clp);
4366 struct xdr_stream xdr;
4370 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4371 status = decode_compound_hdr(&xdr, &hdr);
4373 status = decode_setclientid_confirm(&xdr);
4375 status = decode_putrootfh(&xdr);
4377 status = decode_fsinfo(&xdr, fsinfo);
4388 struct xdr_stream xdr;
4392 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
4393 status = decode_compound_hdr(&xdr, &hdr);
4396 status = decode_putfh(&xdr);
4399 status = decode_delegreturn(&xdr);
4400 decode_getfattr(&xdr, res->fattr, res->server);
4410 struct xdr_stream xdr;
4414 xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
4415 status = decode_compound_hdr(&xdr, &hdr);
4418 if ((status = decode_putfh(&xdr)) != 0)
4420 if ((status = decode_lookup(&xdr)) != 0)
4422 xdr_enter_page(&xdr, PAGE_SIZE);
4423 status = decode_getfattr(&xdr, &res->fattr, res->server);