Lines Matching refs:p
98 __be32 *p; \
111 x = (char *)p; \
112 p += XDR_QUADLEN(nbytes); \
115 if (!(x = (p==argp->tmp || p == argp->tmpp) ? \
116 savemem(argp, p, nbytes) : \
117 (char *)p)) { \
122 p += XDR_QUADLEN(nbytes); \
125 memcpy((x), p, nbytes); \
126 p += XDR_QUADLEN(nbytes); \
131 if (nbytes <= (u32)((char *)argp->end - (char *)argp->p)) { \
132 p = argp->p; \
133 argp->p += XDR_QUADLEN(nbytes); \
134 } else if (!(p = read_buf(argp, nbytes))) { \
143 argp->p = page_address(argp->pagelist[0]); in next_decode_page()
146 argp->end = argp->p + XDR_QUADLEN(argp->pagelen); in next_decode_page()
149 argp->end = argp->p + (PAGE_SIZE>>2); in next_decode_page()
159 unsigned int avail = (char *)argp->end - (char *)argp->p; in read_buf()
160 __be32 *p; in read_buf() local
168 argp->p = vec->iov_base; in read_buf()
175 p = argp->p; in read_buf()
176 argp->p += XDR_QUADLEN(nbytes); in read_buf()
177 return p; in read_buf()
186 p = argp->tmp; in read_buf()
189 p = argp->tmpp = kmalloc(nbytes, GFP_KERNEL); in read_buf()
190 if (!p) in read_buf()
199 memcpy(p, argp->p, avail); in read_buf()
201 memcpy(((char*)p)+avail, argp->p, (nbytes - avail)); in read_buf()
202 argp->p += XDR_QUADLEN(nbytes - avail); in read_buf()
203 return p; in read_buf()
242 char *p = svcxdr_tmpalloc(argp, len + 1); in svcxdr_dupstr() local
244 if (!p) in svcxdr_dupstr()
246 memcpy(p, buf, len); in svcxdr_dupstr()
247 p[len] = '\0'; in svcxdr_dupstr()
248 return p; in svcxdr_dupstr()
261 static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes) in savemem() argument
268 memcpy(ret, p, nbytes); in savemem()
283 p = xdr_decode_hyper(p, &sec); in nfsd4_decode_time()
285 tv->tv_nsec = be32_to_cpup(p++); in nfsd4_decode_time()
303 bmlen = be32_to_cpup(p++); in nfsd4_decode_bitmap()
309 bmval[0] = be32_to_cpup(p++); in nfsd4_decode_bitmap()
311 bmval[1] = be32_to_cpup(p++); in nfsd4_decode_bitmap()
313 bmval[2] = be32_to_cpup(p++); in nfsd4_decode_bitmap()
341 expected_len = be32_to_cpup(p++); in nfsd4_decode_fattr()
346 p = xdr_decode_hyper(p, &iattr->ia_size); in nfsd4_decode_fattr()
354 nace = be32_to_cpup(p++); in nfsd4_decode_fattr()
366 ace->type = be32_to_cpup(p++); in nfsd4_decode_fattr()
367 ace->flag = be32_to_cpup(p++); in nfsd4_decode_fattr()
368 ace->access_mask = be32_to_cpup(p++); in nfsd4_decode_fattr()
369 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
391 iattr->ia_mode = be32_to_cpup(p++); in nfsd4_decode_fattr()
398 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
409 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
420 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
439 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
461 dummy32 = be32_to_cpup(p++); /* lfs: we don't use it */ in nfsd4_decode_fattr()
464 dummy32 = be32_to_cpup(p++); /* pi: we don't use it either */ in nfsd4_decode_fattr()
467 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
484 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
486 dummy32 = be32_to_cpup(p++); in nfsd4_decode_fattr()
502 sid->si_generation = be32_to_cpup(p++); in nfsd4_decode_stateid()
514 access->ac_req_access = be32_to_cpup(p++); in nfsd4_decode_access()
529 nr_secflavs = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
537 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
547 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
550 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
556 uid = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
557 gid = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
561 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
581 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
583 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
585 p += XDR_QUADLEN(dummy); in nfsd4_decode_cb_sec()
588 dummy = be32_to_cpup(p++); in nfsd4_decode_cb_sec()
604 bc->bc_cb_program = be32_to_cpup(p++); in nfsd4_decode_backchannel_ctl()
616 bcts->dir = be32_to_cpup(p++); in nfsd4_decode_bind_conn_to_session()
628 close->cl_seqid = be32_to_cpup(p++); in nfsd4_decode_close()
641 p = xdr_decode_hyper(p, &commit->co_offset); in nfsd4_decode_commit()
642 commit->co_count = be32_to_cpup(p++); in nfsd4_decode_commit()
653 create->cr_type = be32_to_cpup(p++); in nfsd4_decode_create()
657 create->cr_datalen = be32_to_cpup(p++); in nfsd4_decode_create()
659 create->cr_data = svcxdr_dupstr(argp, p, create->cr_datalen); in nfsd4_decode_create()
666 create->cr_specdata1 = be32_to_cpup(p++); in nfsd4_decode_create()
667 create->cr_specdata2 = be32_to_cpup(p++); in nfsd4_decode_create()
677 create->cr_namelen = be32_to_cpup(p++); in nfsd4_decode_create()
710 link->li_namelen = be32_to_cpup(p++); in nfsd4_decode_link()
728 lock->lk_type = be32_to_cpup(p++); in nfsd4_decode_lock()
731 lock->lk_reclaim = be32_to_cpup(p++); in nfsd4_decode_lock()
732 p = xdr_decode_hyper(p, &lock->lk_offset); in nfsd4_decode_lock()
733 p = xdr_decode_hyper(p, &lock->lk_length); in nfsd4_decode_lock()
734 lock->lk_is_new = be32_to_cpup(p++); in nfsd4_decode_lock()
738 lock->lk_new_open_seqid = be32_to_cpup(p++); in nfsd4_decode_lock()
743 lock->lk_new_lock_seqid = be32_to_cpup(p++); in nfsd4_decode_lock()
745 lock->lk_new_owner.len = be32_to_cpup(p++); in nfsd4_decode_lock()
753 lock->lk_old_lock_seqid = be32_to_cpup(p++); in nfsd4_decode_lock()
765 lockt->lt_type = be32_to_cpup(p++); in nfsd4_decode_lockt()
768 p = xdr_decode_hyper(p, &lockt->lt_offset); in nfsd4_decode_lockt()
769 p = xdr_decode_hyper(p, &lockt->lt_length); in nfsd4_decode_lockt()
771 lockt->lt_owner.len = be32_to_cpup(p++); in nfsd4_decode_lockt()
784 locku->lu_type = be32_to_cpup(p++); in nfsd4_decode_locku()
787 locku->lu_seqid = be32_to_cpup(p++); in nfsd4_decode_locku()
792 p = xdr_decode_hyper(p, &locku->lu_offset); in nfsd4_decode_locku()
793 p = xdr_decode_hyper(p, &locku->lu_length); in nfsd4_decode_locku()
804 lookup->lo_len = be32_to_cpup(p++); in nfsd4_decode_lookup()
815 __be32 *p; in nfsd4_decode_share_access() local
819 w = be32_to_cpup(p++); in nfsd4_decode_share_access()
868 __be32 *p; in nfsd4_decode_share_deny() local
871 *x = be32_to_cpup(p++); in nfsd4_decode_share_deny()
882 __be32 *p; in nfsd4_decode_opaque() local
885 o->len = be32_to_cpup(p++); in nfsd4_decode_opaque()
910 open->op_seqid = be32_to_cpup(p++); in nfsd4_decode_open()
925 open->op_create = be32_to_cpup(p++); in nfsd4_decode_open()
931 open->op_createmode = be32_to_cpup(p++); in nfsd4_decode_open()
966 open->op_claim_type = be32_to_cpup(p++); in nfsd4_decode_open()
971 open->op_fname.len = be32_to_cpup(p++); in nfsd4_decode_open()
979 open->op_delegate_type = be32_to_cpup(p++); in nfsd4_decode_open()
986 open->op_fname.len = be32_to_cpup(p++); in nfsd4_decode_open()
1024 open_conf->oc_seqid = be32_to_cpup(p++); in nfsd4_decode_open_confirm()
1038 open_down->od_seqid = be32_to_cpup(p++); in nfsd4_decode_open_downgrade()
1055 putfh->pf_fhlen = be32_to_cpup(p++); in nfsd4_decode_putfh()
1065 nfsd4_decode_putpubfh(struct nfsd4_compoundargs *argp, void *p) in nfsd4_decode_putpubfh() argument
1081 p = xdr_decode_hyper(p, &read->rd_offset); in nfsd4_decode_read()
1082 read->rd_length = be32_to_cpup(p++); in nfsd4_decode_read()
1093 p = xdr_decode_hyper(p, &readdir->rd_cookie); in nfsd4_decode_readdir()
1095 readdir->rd_dircount = be32_to_cpup(p++); in nfsd4_decode_readdir()
1096 readdir->rd_maxcount = be32_to_cpup(p++); in nfsd4_decode_readdir()
1109 remove->rm_namelen = be32_to_cpup(p++); in nfsd4_decode_remove()
1124 rename->rn_snamelen = be32_to_cpup(p++); in nfsd4_decode_rename()
1128 rename->rn_tnamelen = be32_to_cpup(p++); in nfsd4_decode_rename()
1160 secinfo->si_namelen = be32_to_cpup(p++); in nfsd4_decode_secinfo()
1176 sin->sin_style = be32_to_cpup(p++); in nfsd4_decode_secinfo_no_name()
1207 setclientid->se_callback_prog = be32_to_cpup(p++); in nfsd4_decode_setclientid()
1208 setclientid->se_callback_netid_len = be32_to_cpup(p++); in nfsd4_decode_setclientid()
1212 setclientid->se_callback_addr_len = be32_to_cpup(p++); in nfsd4_decode_setclientid()
1217 setclientid->se_callback_ident = be32_to_cpup(p++); in nfsd4_decode_setclientid()
1250 verify->ve_attrlen = be32_to_cpup(p++); in nfsd4_decode_verify()
1268 p = xdr_decode_hyper(p, &write->wr_offset); in nfsd4_decode_write()
1269 write->wr_stable_how = be32_to_cpup(p++); in nfsd4_decode_write()
1272 write->wr_buflen = be32_to_cpup(p++); in nfsd4_decode_write()
1278 avail = (char*)argp->end - (char*)argp->p; in nfsd4_decode_write()
1284 write->wr_head.iov_base = p; in nfsd4_decode_write()
1301 argp->p += XDR_QUADLEN(len); in nfsd4_decode_write()
1316 rlockowner->rl_owner.len = be32_to_cpup(p++); in nfsd4_decode_release_lockowner()
1340 exid->flags = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1344 exid->spa_how = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1362 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1364 p += dummy; in nfsd4_decode_exchange_id()
1367 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1369 p += dummy; in nfsd4_decode_exchange_id()
1373 tmp = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1376 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1378 p += XDR_QUADLEN(dummy); in nfsd4_decode_exchange_id()
1383 tmp = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1386 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1388 p += XDR_QUADLEN(dummy); in nfsd4_decode_exchange_id()
1393 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1394 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1402 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1410 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1412 p += XDR_QUADLEN(dummy); in nfsd4_decode_exchange_id()
1416 dummy = be32_to_cpup(p++); in nfsd4_decode_exchange_id()
1418 p += XDR_QUADLEN(dummy); in nfsd4_decode_exchange_id()
1422 p += 3; in nfsd4_decode_exchange_id()
1436 sess->seqid = be32_to_cpup(p++); in nfsd4_decode_create_session()
1437 sess->flags = be32_to_cpup(p++); in nfsd4_decode_create_session()
1441 dummy = be32_to_cpup(p++); /* headerpadsz is always 0 */ in nfsd4_decode_create_session()
1442 sess->fore_channel.maxreq_sz = be32_to_cpup(p++); in nfsd4_decode_create_session()
1443 sess->fore_channel.maxresp_sz = be32_to_cpup(p++); in nfsd4_decode_create_session()
1444 sess->fore_channel.maxresp_cached = be32_to_cpup(p++); in nfsd4_decode_create_session()
1445 sess->fore_channel.maxops = be32_to_cpup(p++); in nfsd4_decode_create_session()
1446 sess->fore_channel.maxreqs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1447 sess->fore_channel.nr_rdma_attrs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1450 sess->fore_channel.rdma_attrs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1458 dummy = be32_to_cpup(p++); /* headerpadsz is always 0 */ in nfsd4_decode_create_session()
1459 sess->back_channel.maxreq_sz = be32_to_cpup(p++); in nfsd4_decode_create_session()
1460 sess->back_channel.maxresp_sz = be32_to_cpup(p++); in nfsd4_decode_create_session()
1461 sess->back_channel.maxresp_cached = be32_to_cpup(p++); in nfsd4_decode_create_session()
1462 sess->back_channel.maxops = be32_to_cpup(p++); in nfsd4_decode_create_session()
1463 sess->back_channel.maxreqs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1464 sess->back_channel.nr_rdma_attrs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1467 sess->back_channel.rdma_attrs = be32_to_cpup(p++); in nfsd4_decode_create_session()
1474 sess->callback_prog = be32_to_cpup(p++); in nfsd4_decode_create_session()
1497 free_stateid->fr_stateid.si_generation = be32_to_cpup(p++); in nfsd4_decode_free_stateid()
1511 seq->seqid = be32_to_cpup(p++); in nfsd4_decode_sequence()
1512 seq->slotid = be32_to_cpup(p++); in nfsd4_decode_sequence()
1513 seq->maxslots = be32_to_cpup(p++); in nfsd4_decode_sequence()
1514 seq->cachethis = be32_to_cpup(p++); in nfsd4_decode_sequence()
1523 __be32 *p, status; in nfsd4_decode_test_stateid() local
1527 test_stateid->ts_num_ids = ntohl(*p++); in nfsd4_decode_test_stateid()
1570 rc->rca_one_fs = be32_to_cpup(p++); in nfsd4_decode_reclaim_complete()
1585 gdev->gd_layout_type = be32_to_cpup(p++); in nfsd4_decode_getdeviceinfo()
1586 gdev->gd_maxcount = be32_to_cpup(p++); in nfsd4_decode_getdeviceinfo()
1587 num = be32_to_cpup(p++); in nfsd4_decode_getdeviceinfo()
1592 gdev->gd_notify_types = be32_to_cpup(p++); in nfsd4_decode_getdeviceinfo()
1594 if (be32_to_cpup(p++)) { in nfsd4_decode_getdeviceinfo()
1610 lgp->lg_signal = be32_to_cpup(p++); in nfsd4_decode_layoutget()
1611 lgp->lg_layout_type = be32_to_cpup(p++); in nfsd4_decode_layoutget()
1612 lgp->lg_seg.iomode = be32_to_cpup(p++); in nfsd4_decode_layoutget()
1613 p = xdr_decode_hyper(p, &lgp->lg_seg.offset); in nfsd4_decode_layoutget()
1614 p = xdr_decode_hyper(p, &lgp->lg_seg.length); in nfsd4_decode_layoutget()
1615 p = xdr_decode_hyper(p, &lgp->lg_minlength); in nfsd4_decode_layoutget()
1622 lgp->lg_maxcount = be32_to_cpup(p++); in nfsd4_decode_layoutget()
1635 p = xdr_decode_hyper(p, &lcp->lc_seg.offset); in nfsd4_decode_layoutcommit()
1636 p = xdr_decode_hyper(p, &lcp->lc_seg.length); in nfsd4_decode_layoutcommit()
1637 lcp->lc_reclaim = be32_to_cpup(p++); in nfsd4_decode_layoutcommit()
1644 lcp->lc_newoffset = be32_to_cpup(p++); in nfsd4_decode_layoutcommit()
1647 p = xdr_decode_hyper(p, &lcp->lc_last_wr); in nfsd4_decode_layoutcommit()
1651 timechange = be32_to_cpup(p++); in nfsd4_decode_layoutcommit()
1660 lcp->lc_layout_type = be32_to_cpup(p++); in nfsd4_decode_layoutcommit()
1666 lcp->lc_up_len = be32_to_cpup(p++); in nfsd4_decode_layoutcommit()
1682 lrp->lr_reclaim = be32_to_cpup(p++); in nfsd4_decode_layoutreturn()
1683 lrp->lr_layout_type = be32_to_cpup(p++); in nfsd4_decode_layoutreturn()
1684 lrp->lr_seg.iomode = be32_to_cpup(p++); in nfsd4_decode_layoutreturn()
1685 lrp->lr_return_type = be32_to_cpup(p++); in nfsd4_decode_layoutreturn()
1688 p = xdr_decode_hyper(p, &lrp->lr_seg.offset); in nfsd4_decode_layoutreturn()
1689 p = xdr_decode_hyper(p, &lrp->lr_seg.length); in nfsd4_decode_layoutreturn()
1696 lrp->lrf_body_len = be32_to_cpup(p++); in nfsd4_decode_layoutreturn()
1721 p = xdr_decode_hyper(p, &fallocate->falloc_offset); in nfsd4_decode_fallocate()
1722 xdr_decode_hyper(p, &fallocate->falloc_length); in nfsd4_decode_fallocate()
1740 p = xdr_decode_hyper(p, &clone->cl_src_pos); in nfsd4_decode_clone()
1741 p = xdr_decode_hyper(p, &clone->cl_dst_pos); in nfsd4_decode_clone()
1742 p = xdr_decode_hyper(p, &clone->cl_count); in nfsd4_decode_clone()
1760 p = xdr_decode_hyper(p, ©->cp_src_pos); in nfsd4_decode_copy()
1761 p = xdr_decode_hyper(p, ©->cp_dst_pos); in nfsd4_decode_copy()
1762 p = xdr_decode_hyper(p, ©->cp_count); in nfsd4_decode_copy()
1763 copy->cp_consecutive = be32_to_cpup(p++); in nfsd4_decode_copy()
1764 copy->cp_synchronous = be32_to_cpup(p++); in nfsd4_decode_copy()
1765 tmp = be32_to_cpup(p); /* Source server list not supported */ in nfsd4_decode_copy()
1780 p = xdr_decode_hyper(p, &seek->seek_offset); in nfsd4_decode_seek()
1781 seek->seek_whence = be32_to_cpup(p); in nfsd4_decode_seek()
1787 nfsd4_decode_noop(struct nfsd4_compoundargs *argp, void *p) in nfsd4_decode_noop() argument
1793 nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p) in nfsd4_decode_notsupp() argument
1911 argp->taglen = be32_to_cpup(p++); in nfsd4_decode_compound()
1915 argp->minorversion = be32_to_cpup(p++); in nfsd4_decode_compound()
1916 argp->opcnt = be32_to_cpup(p++); in nfsd4_decode_compound()
1941 op->opnum = be32_to_cpup(p++); in nfsd4_decode_compound()
1987 static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode, in encode_change() argument
1991 *p++ = cpu_to_be32(convert_to_wallclock(exp->cd->flush_time)); in encode_change()
1992 *p++ = 0; in encode_change()
1994 p = xdr_encode_hyper(p, nfsd4_change_attribute(inode)); in encode_change()
1996 *p++ = cpu_to_be32(stat->ctime.tv_sec); in encode_change()
1997 *p++ = cpu_to_be32(stat->ctime.tv_nsec); in encode_change()
1999 return p; in encode_change()
2002 static __be32 *encode_cinfo(__be32 *p, struct nfsd4_change_info *c) in encode_cinfo() argument
2004 *p++ = cpu_to_be32(c->atomic); in encode_cinfo()
2006 p = xdr_encode_hyper(p, c->before_change); in encode_cinfo()
2007 p = xdr_encode_hyper(p, c->after_change); in encode_cinfo()
2009 *p++ = cpu_to_be32(c->before_ctime_sec); in encode_cinfo()
2010 *p++ = cpu_to_be32(c->before_ctime_nsec); in encode_cinfo()
2011 *p++ = cpu_to_be32(c->after_ctime_sec); in encode_cinfo()
2012 *p++ = cpu_to_be32(c->after_ctime_nsec); in encode_cinfo()
2014 return p; in encode_cinfo()
2024 __be32 *p; in nfsd4_encode_components_esc() local
2033 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_components_esc()
2034 if (!p) in nfsd4_encode_components_esc()
2036 p++; /* We will fill this in with @count later */ in nfsd4_encode_components_esc()
2059 p = xdr_reserve_space(xdr, strlen + 4); in nfsd4_encode_components_esc()
2060 if (!p) in nfsd4_encode_components_esc()
2062 p = xdr_encode_opaque(p, str, strlen); in nfsd4_encode_components_esc()
2112 __be32 *p; in nfsd4_encode_path() local
2144 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_path()
2145 if (!p) in nfsd4_encode_path()
2147 *p++ = cpu_to_be32(ncomponents); in nfsd4_encode_path()
2155 p = xdr_reserve_space(xdr, len + 4); in nfsd4_encode_path()
2156 if (!p) { in nfsd4_encode_path()
2160 p = xdr_encode_opaque(p, dentry->d_name.name, len); in nfsd4_encode_path()
2199 __be32 *p; in nfsd4_encode_fs_locations() local
2205 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fs_locations()
2206 if (!p) in nfsd4_encode_fs_locations()
2208 *p++ = cpu_to_be32(fslocs->locations_count); in nfsd4_encode_fs_locations()
2246 __be32 *p; in nfsd4_encode_layout_types() local
2249 p = xdr_reserve_space(xdr, 4 + 4 * i); in nfsd4_encode_layout_types()
2250 if (!p) in nfsd4_encode_layout_types()
2253 *p++ = cpu_to_be32(i); in nfsd4_encode_layout_types()
2257 *p++ = cpu_to_be32(i); in nfsd4_encode_layout_types()
2272 __be32 *p; in nfsd4_encode_security_label() local
2274 p = xdr_reserve_space(xdr, len + 4 + 4 + 4); in nfsd4_encode_security_label()
2275 if (!p) in nfsd4_encode_security_label()
2282 *p++ = cpu_to_be32(0); /* lfs */ in nfsd4_encode_security_label()
2283 *p++ = cpu_to_be32(0); /* pi */ in nfsd4_encode_security_label()
2284 p = xdr_encode_opaque(p, context, len); in nfsd4_encode_security_label()
2330 __be32 *p; in nfsd4_encode_bitmap() local
2333 p = xdr_reserve_space(xdr, 16); in nfsd4_encode_bitmap()
2334 if (!p) in nfsd4_encode_bitmap()
2336 *p++ = cpu_to_be32(3); in nfsd4_encode_bitmap()
2337 *p++ = cpu_to_be32(bmval0); in nfsd4_encode_bitmap()
2338 *p++ = cpu_to_be32(bmval1); in nfsd4_encode_bitmap()
2339 *p++ = cpu_to_be32(bmval2); in nfsd4_encode_bitmap()
2341 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_bitmap()
2342 if (!p) in nfsd4_encode_bitmap()
2344 *p++ = cpu_to_be32(2); in nfsd4_encode_bitmap()
2345 *p++ = cpu_to_be32(bmval0); in nfsd4_encode_bitmap()
2346 *p++ = cpu_to_be32(bmval1); in nfsd4_encode_bitmap()
2348 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_bitmap()
2349 if (!p) in nfsd4_encode_bitmap()
2351 *p++ = cpu_to_be32(1); in nfsd4_encode_bitmap()
2352 *p++ = cpu_to_be32(bmval0); in nfsd4_encode_bitmap()
2376 __be32 *p; in nfsd4_encode_fattr() local
2462 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2463 if (!p) in nfsd4_encode_fattr()
2465 p++; /* to be backfilled later */ in nfsd4_encode_fattr()
2477 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_fattr()
2478 if (!p) in nfsd4_encode_fattr()
2480 *p++ = cpu_to_be32(2); in nfsd4_encode_fattr()
2481 *p++ = cpu_to_be32(supp[0]); in nfsd4_encode_fattr()
2482 *p++ = cpu_to_be32(supp[1]); in nfsd4_encode_fattr()
2484 p = xdr_reserve_space(xdr, 16); in nfsd4_encode_fattr()
2485 if (!p) in nfsd4_encode_fattr()
2487 *p++ = cpu_to_be32(3); in nfsd4_encode_fattr()
2488 *p++ = cpu_to_be32(supp[0]); in nfsd4_encode_fattr()
2489 *p++ = cpu_to_be32(supp[1]); in nfsd4_encode_fattr()
2490 *p++ = cpu_to_be32(supp[2]); in nfsd4_encode_fattr()
2494 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2495 if (!p) in nfsd4_encode_fattr()
2502 *p++ = cpu_to_be32(dummy); in nfsd4_encode_fattr()
2505 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2506 if (!p) in nfsd4_encode_fattr()
2509 *p++ = cpu_to_be32(NFS4_FH_PERSISTENT); in nfsd4_encode_fattr()
2511 *p++ = cpu_to_be32(NFS4_FH_PERSISTENT| in nfsd4_encode_fattr()
2515 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2516 if (!p) in nfsd4_encode_fattr()
2518 p = encode_change(p, &stat, d_inode(dentry), exp); in nfsd4_encode_fattr()
2521 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2522 if (!p) in nfsd4_encode_fattr()
2524 p = xdr_encode_hyper(p, stat.size); in nfsd4_encode_fattr()
2527 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2528 if (!p) in nfsd4_encode_fattr()
2530 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2533 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2534 if (!p) in nfsd4_encode_fattr()
2536 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2539 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2540 if (!p) in nfsd4_encode_fattr()
2542 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2545 p = xdr_reserve_space(xdr, 16); in nfsd4_encode_fattr()
2546 if (!p) in nfsd4_encode_fattr()
2549 p = xdr_encode_hyper(p, NFS4_REFERRAL_FSID_MAJOR); in nfsd4_encode_fattr()
2550 p = xdr_encode_hyper(p, NFS4_REFERRAL_FSID_MINOR); in nfsd4_encode_fattr()
2553 p = xdr_encode_hyper(p, (u64)exp->ex_fsid); in nfsd4_encode_fattr()
2554 p = xdr_encode_hyper(p, (u64)0); in nfsd4_encode_fattr()
2557 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2558 *p++ = cpu_to_be32(MAJOR(stat.dev)); in nfsd4_encode_fattr()
2559 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2560 *p++ = cpu_to_be32(MINOR(stat.dev)); in nfsd4_encode_fattr()
2563 p = xdr_encode_opaque_fixed(p, exp->ex_uuid, in nfsd4_encode_fattr()
2569 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2570 if (!p) in nfsd4_encode_fattr()
2572 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2575 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2576 if (!p) in nfsd4_encode_fattr()
2578 *p++ = cpu_to_be32(nn->nfsd4_lease); in nfsd4_encode_fattr()
2581 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2582 if (!p) in nfsd4_encode_fattr()
2584 *p++ = cpu_to_be32(rdattr_err); in nfsd4_encode_fattr()
2590 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2591 if (!p) in nfsd4_encode_fattr()
2594 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2597 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2598 if (!p) in nfsd4_encode_fattr()
2600 *p++ = cpu_to_be32(acl->naces); in nfsd4_encode_fattr()
2603 p = xdr_reserve_space(xdr, 4*3); in nfsd4_encode_fattr()
2604 if (!p) in nfsd4_encode_fattr()
2606 *p++ = cpu_to_be32(ace->type); in nfsd4_encode_fattr()
2607 *p++ = cpu_to_be32(ace->flag); in nfsd4_encode_fattr()
2608 *p++ = cpu_to_be32(ace->access_mask & in nfsd4_encode_fattr()
2617 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2618 if (!p) in nfsd4_encode_fattr()
2620 *p++ = cpu_to_be32(IS_POSIXACL(dentry->d_inode) ? in nfsd4_encode_fattr()
2624 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2625 if (!p) in nfsd4_encode_fattr()
2627 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2630 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2631 if (!p) in nfsd4_encode_fattr()
2633 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2636 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2637 if (!p) in nfsd4_encode_fattr()
2639 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2642 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2643 if (!p) in nfsd4_encode_fattr()
2645 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2648 p = xdr_reserve_space(xdr, fhp->fh_handle.fh_size + 4); in nfsd4_encode_fattr()
2649 if (!p) in nfsd4_encode_fattr()
2651 p = xdr_encode_opaque(p, &fhp->fh_handle.fh_base, in nfsd4_encode_fattr()
2655 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2656 if (!p) in nfsd4_encode_fattr()
2658 p = xdr_encode_hyper(p, stat.ino); in nfsd4_encode_fattr()
2661 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2662 if (!p) in nfsd4_encode_fattr()
2664 p = xdr_encode_hyper(p, (u64) statfs.f_ffree); in nfsd4_encode_fattr()
2667 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2668 if (!p) in nfsd4_encode_fattr()
2670 p = xdr_encode_hyper(p, (u64) statfs.f_ffree); in nfsd4_encode_fattr()
2673 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2674 if (!p) in nfsd4_encode_fattr()
2676 p = xdr_encode_hyper(p, (u64) statfs.f_files); in nfsd4_encode_fattr()
2684 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2685 if (!p) in nfsd4_encode_fattr()
2687 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2690 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2691 if (!p) in nfsd4_encode_fattr()
2693 p = xdr_encode_hyper(p, exp->ex_path.mnt->mnt_sb->s_maxbytes); in nfsd4_encode_fattr()
2696 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2697 if (!p) in nfsd4_encode_fattr()
2699 *p++ = cpu_to_be32(255); in nfsd4_encode_fattr()
2702 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2703 if (!p) in nfsd4_encode_fattr()
2705 *p++ = cpu_to_be32(statfs.f_namelen); in nfsd4_encode_fattr()
2708 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2709 if (!p) in nfsd4_encode_fattr()
2711 p = xdr_encode_hyper(p, (u64) svc_max_payload(rqstp)); in nfsd4_encode_fattr()
2714 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2715 if (!p) in nfsd4_encode_fattr()
2717 p = xdr_encode_hyper(p, (u64) svc_max_payload(rqstp)); in nfsd4_encode_fattr()
2720 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2721 if (!p) in nfsd4_encode_fattr()
2723 *p++ = cpu_to_be32(stat.mode & S_IALLUGO); in nfsd4_encode_fattr()
2726 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2727 if (!p) in nfsd4_encode_fattr()
2729 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2732 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2733 if (!p) in nfsd4_encode_fattr()
2735 *p++ = cpu_to_be32(stat.nlink); in nfsd4_encode_fattr()
2748 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2749 if (!p) in nfsd4_encode_fattr()
2751 *p++ = cpu_to_be32((u32) MAJOR(stat.rdev)); in nfsd4_encode_fattr()
2752 *p++ = cpu_to_be32((u32) MINOR(stat.rdev)); in nfsd4_encode_fattr()
2755 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2756 if (!p) in nfsd4_encode_fattr()
2759 p = xdr_encode_hyper(p, dummy64); in nfsd4_encode_fattr()
2762 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2763 if (!p) in nfsd4_encode_fattr()
2766 p = xdr_encode_hyper(p, dummy64); in nfsd4_encode_fattr()
2769 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2770 if (!p) in nfsd4_encode_fattr()
2773 p = xdr_encode_hyper(p, dummy64); in nfsd4_encode_fattr()
2776 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2777 if (!p) in nfsd4_encode_fattr()
2780 p = xdr_encode_hyper(p, dummy64); in nfsd4_encode_fattr()
2783 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_fattr()
2784 if (!p) in nfsd4_encode_fattr()
2786 p = xdr_encode_hyper(p, (s64)stat.atime.tv_sec); in nfsd4_encode_fattr()
2787 *p++ = cpu_to_be32(stat.atime.tv_nsec); in nfsd4_encode_fattr()
2790 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_fattr()
2791 if (!p) in nfsd4_encode_fattr()
2793 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2794 *p++ = cpu_to_be32(1); in nfsd4_encode_fattr()
2795 *p++ = cpu_to_be32(0); in nfsd4_encode_fattr()
2798 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_fattr()
2799 if (!p) in nfsd4_encode_fattr()
2801 p = xdr_encode_hyper(p, (s64)stat.ctime.tv_sec); in nfsd4_encode_fattr()
2802 *p++ = cpu_to_be32(stat.ctime.tv_nsec); in nfsd4_encode_fattr()
2805 p = xdr_reserve_space(xdr, 12); in nfsd4_encode_fattr()
2806 if (!p) in nfsd4_encode_fattr()
2808 p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec); in nfsd4_encode_fattr()
2809 *p++ = cpu_to_be32(stat.mtime.tv_nsec); in nfsd4_encode_fattr()
2815 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_fattr()
2816 if (!p) in nfsd4_encode_fattr()
2829 p = xdr_encode_hyper(p, ino); in nfsd4_encode_fattr()
2845 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_fattr()
2846 if (!p) in nfsd4_encode_fattr()
2848 *p++ = cpu_to_be32(stat.blksize); in nfsd4_encode_fattr()
2897 struct xdr_buf *buf, __be32 *p, int bytes) in svcxdr_init_encode_from_buffer() argument
2901 buf->head[0].iov_base = p; in svcxdr_init_encode_from_buffer()
2906 xdr->p = p; in svcxdr_init_encode_from_buffer()
2907 xdr->end = (void *)p + bytes; in svcxdr_init_encode_from_buffer()
2911 __be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words, in nfsd4_encode_fattr_to_buf() argument
2920 svcxdr_init_encode_from_buffer(&xdr, &dummy, *p, words << 2); in nfsd4_encode_fattr_to_buf()
2923 *p = xdr.p; in nfsd4_encode_fattr_to_buf()
3001 __be32 *p; in nfsd4_encode_rdattr_error() local
3003 p = xdr_reserve_space(xdr, 20); in nfsd4_encode_rdattr_error()
3004 if (!p) in nfsd4_encode_rdattr_error()
3006 *p++ = htonl(2); in nfsd4_encode_rdattr_error()
3007 *p++ = htonl(FATTR4_WORD0_RDATTR_ERROR); /* bmval0 */ in nfsd4_encode_rdattr_error()
3008 *p++ = htonl(0); /* bmval1 */ in nfsd4_encode_rdattr_error()
3010 *p++ = htonl(4); /* attribute length */ in nfsd4_encode_rdattr_error()
3011 *p++ = nfserr; /* no htonl */ in nfsd4_encode_rdattr_error()
3012 return p; in nfsd4_encode_rdattr_error()
3028 __be32 *p; in nfsd4_encode_dirent() local
3042 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_dirent()
3043 if (!p) in nfsd4_encode_dirent()
3045 *p++ = xdr_one; /* mark entry present */ in nfsd4_encode_dirent()
3047 p = xdr_reserve_space(xdr, 3*4 + namlen); in nfsd4_encode_dirent()
3048 if (!p) in nfsd4_encode_dirent()
3050 p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */ in nfsd4_encode_dirent()
3051 p = xdr_encode_array(p, name, namlen); /* name length & name */ in nfsd4_encode_dirent()
3073 p = nfsd4_encode_rdattr_error(xdr, nfserr); in nfsd4_encode_dirent()
3074 if (p == NULL) { in nfsd4_encode_dirent()
3108 __be32 *p; in nfsd4_encode_stateid() local
3110 p = xdr_reserve_space(xdr, sizeof(stateid_t)); in nfsd4_encode_stateid()
3111 if (!p) in nfsd4_encode_stateid()
3113 *p++ = cpu_to_be32(sid->si_generation); in nfsd4_encode_stateid()
3114 p = xdr_encode_opaque_fixed(p, &sid->si_opaque, in nfsd4_encode_stateid()
3123 __be32 *p; in nfsd4_encode_access() local
3125 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_access()
3126 if (!p) in nfsd4_encode_access()
3128 *p++ = cpu_to_be32(access->ac_supported); in nfsd4_encode_access()
3129 *p++ = cpu_to_be32(access->ac_resp_access); in nfsd4_encode_access()
3136 __be32 *p; in nfsd4_encode_bind_conn_to_session() local
3138 p = xdr_reserve_space(xdr, NFS4_MAX_SESSIONID_LEN + 8); in nfsd4_encode_bind_conn_to_session()
3139 if (!p) in nfsd4_encode_bind_conn_to_session()
3141 p = xdr_encode_opaque_fixed(p, bcts->sessionid.data, in nfsd4_encode_bind_conn_to_session()
3143 *p++ = cpu_to_be32(bcts->dir); in nfsd4_encode_bind_conn_to_session()
3145 *p++ = cpu_to_be32(0); in nfsd4_encode_bind_conn_to_session()
3162 __be32 *p; in nfsd4_encode_commit() local
3164 p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE); in nfsd4_encode_commit()
3165 if (!p) in nfsd4_encode_commit()
3167 p = xdr_encode_opaque_fixed(p, commit->co_verf.data, in nfsd4_encode_commit()
3176 __be32 *p; in nfsd4_encode_create() local
3178 p = xdr_reserve_space(xdr, 20); in nfsd4_encode_create()
3179 if (!p) in nfsd4_encode_create()
3181 encode_cinfo(p, &create->cr_cinfo); in nfsd4_encode_create()
3203 __be32 *p; in nfsd4_encode_getfh() local
3206 p = xdr_reserve_space(xdr, len + 4); in nfsd4_encode_getfh()
3207 if (!p) in nfsd4_encode_getfh()
3209 p = xdr_encode_opaque(p, &fhp->fh_handle.fh_base, len); in nfsd4_encode_getfh()
3221 __be32 *p; in nfsd4_encode_lock_denied() local
3224 p = xdr_reserve_space(xdr, 32 + XDR_LEN(conf->len)); in nfsd4_encode_lock_denied()
3225 if (!p) { in nfsd4_encode_lock_denied()
3238 p = xdr_encode_hyper(p, ld->ld_start); in nfsd4_encode_lock_denied()
3239 p = xdr_encode_hyper(p, ld->ld_length); in nfsd4_encode_lock_denied()
3240 *p++ = cpu_to_be32(ld->ld_type); in nfsd4_encode_lock_denied()
3242 p = xdr_encode_opaque_fixed(p, &ld->ld_clientid, 8); in nfsd4_encode_lock_denied()
3243 p = xdr_encode_opaque(p, conf->data, conf->len); in nfsd4_encode_lock_denied()
3246 p = xdr_encode_hyper(p, (u64)0); /* clientid */ in nfsd4_encode_lock_denied()
3247 *p++ = cpu_to_be32(0); /* length of owner name */ in nfsd4_encode_lock_denied()
3288 __be32 *p; in nfsd4_encode_link() local
3290 p = xdr_reserve_space(xdr, 20); in nfsd4_encode_link()
3291 if (!p) in nfsd4_encode_link()
3293 p = encode_cinfo(p, &link->li_cinfo); in nfsd4_encode_link()
3302 __be32 *p; in nfsd4_encode_open() local
3307 p = xdr_reserve_space(xdr, 24); in nfsd4_encode_open()
3308 if (!p) in nfsd4_encode_open()
3310 p = encode_cinfo(p, &open->op_cinfo); in nfsd4_encode_open()
3311 *p++ = cpu_to_be32(open->op_rflags); in nfsd4_encode_open()
3318 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_open()
3319 if (!p) in nfsd4_encode_open()
3322 *p++ = cpu_to_be32(open->op_delegate_type); in nfsd4_encode_open()
3330 p = xdr_reserve_space(xdr, 20); in nfsd4_encode_open()
3331 if (!p) in nfsd4_encode_open()
3333 *p++ = cpu_to_be32(open->op_recall); in nfsd4_encode_open()
3338 *p++ = cpu_to_be32(NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE); in nfsd4_encode_open()
3339 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3340 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3341 *p++ = cpu_to_be32(0); /* XXX: is NULL principal ok? */ in nfsd4_encode_open()
3347 p = xdr_reserve_space(xdr, 32); in nfsd4_encode_open()
3348 if (!p) in nfsd4_encode_open()
3350 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3355 *p++ = cpu_to_be32(NFS4_LIMIT_SIZE); in nfsd4_encode_open()
3356 *p++ = cpu_to_be32(~(u32)0); in nfsd4_encode_open()
3357 *p++ = cpu_to_be32(~(u32)0); in nfsd4_encode_open()
3362 *p++ = cpu_to_be32(NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE); in nfsd4_encode_open()
3363 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3364 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3365 *p++ = cpu_to_be32(0); /* XXX: is NULL principal ok? */ in nfsd4_encode_open()
3371 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_open()
3372 if (!p) in nfsd4_encode_open()
3374 *p++ = cpu_to_be32(open->op_why_no_deleg); in nfsd4_encode_open()
3376 *p++ = cpu_to_be32(0); in nfsd4_encode_open()
3379 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_open()
3380 if (!p) in nfsd4_encode_open()
3382 *p++ = cpu_to_be32(open->op_why_no_deleg); in nfsd4_encode_open()
3419 __be32 *p = xdr->p - 2; in nfsd4_encode_splice_read() local
3422 if (xdr->end - xdr->p < 1) in nfsd4_encode_splice_read()
3441 *(p++) = htonl(eof); in nfsd4_encode_splice_read()
3442 *(p++) = htonl(maxcount); in nfsd4_encode_splice_read()
3450 buf->tail[0].iov_base = xdr->p; in nfsd4_encode_splice_read()
3456 *(xdr->p++) = 0; in nfsd4_encode_splice_read()
3463 space_left = min_t(int, (void *)xdr->end - (void *)xdr->p, in nfsd4_encode_splice_read()
3483 __be32 *p; in nfsd4_encode_readv() local
3490 thislen = min_t(long, len, ((void *)xdr->end - (void *)xdr->p)); in nfsd4_encode_readv()
3491 p = xdr_reserve_space(xdr, (thislen+3)&~3); in nfsd4_encode_readv()
3492 WARN_ON_ONCE(!p); in nfsd4_encode_readv()
3493 resp->rqstp->rq_vec[v].iov_base = p; in nfsd4_encode_readv()
3500 p = xdr_reserve_space(xdr, (thislen+3)&~3); in nfsd4_encode_readv()
3501 WARN_ON_ONCE(!p); in nfsd4_encode_readv()
3502 resp->rqstp->rq_vec[v].iov_base = p; in nfsd4_encode_readv()
3540 __be32 *p; in nfsd4_encode_read() local
3542 p = xdr_reserve_space(xdr, 8); /* eof flag and byte count */ in nfsd4_encode_read()
3543 if (!p) { in nfsd4_encode_read()
3585 __be32 *p; in nfsd4_encode_readlink() local
3587 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_readlink()
3588 if (!p) in nfsd4_encode_readlink()
3592 p = xdr_reserve_space(xdr, maxcount); in nfsd4_encode_readlink()
3593 if (!p) in nfsd4_encode_readlink()
3602 (char *)p, &maxcount); in nfsd4_encode_readlink()
3628 __be32 *p; in nfsd4_encode_readdir() local
3630 p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE); in nfsd4_encode_readdir()
3631 if (!p) in nfsd4_encode_readdir()
3635 *p++ = cpu_to_be32(0); in nfsd4_encode_readdir()
3636 *p++ = cpu_to_be32(0); in nfsd4_encode_readdir()
3637 resp->xdr.buf->head[0].iov_len = ((char *)resp->xdr.p) in nfsd4_encode_readdir()
3696 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_readdir()
3697 if (!p) { in nfsd4_encode_readdir()
3701 *p++ = 0; /* no more entries */ in nfsd4_encode_readdir()
3702 *p++ = htonl(readdir->common.err == nfserr_eof); in nfsd4_encode_readdir()
3714 __be32 *p; in nfsd4_encode_remove() local
3716 p = xdr_reserve_space(xdr, 20); in nfsd4_encode_remove()
3717 if (!p) in nfsd4_encode_remove()
3719 p = encode_cinfo(p, &remove->rm_cinfo); in nfsd4_encode_remove()
3727 __be32 *p; in nfsd4_encode_rename() local
3729 p = xdr_reserve_space(xdr, 40); in nfsd4_encode_rename()
3730 if (!p) in nfsd4_encode_rename()
3732 p = encode_cinfo(p, &rename->rn_sinfo); in nfsd4_encode_rename()
3733 p = encode_cinfo(p, &rename->rn_tinfo); in nfsd4_encode_rename()
3743 __be32 *p, *flavorsp; in nfsd4_do_encode_secinfo() local
3767 p = xdr_reserve_space(xdr, 4); in nfsd4_do_encode_secinfo()
3768 if (!p) in nfsd4_do_encode_secinfo()
3770 flavorsp = p++; /* to be backfilled later */ in nfsd4_do_encode_secinfo()
3778 p = xdr_reserve_space(xdr, 4 + 4 + in nfsd4_do_encode_secinfo()
3780 if (!p) in nfsd4_do_encode_secinfo()
3782 *p++ = cpu_to_be32(RPC_AUTH_GSS); in nfsd4_do_encode_secinfo()
3783 p = xdr_encode_opaque(p, info.oid.data, info.oid.len); in nfsd4_do_encode_secinfo()
3784 *p++ = cpu_to_be32(info.qop); in nfsd4_do_encode_secinfo()
3785 *p++ = cpu_to_be32(info.service); in nfsd4_do_encode_secinfo()
3788 p = xdr_reserve_space(xdr, 4); in nfsd4_do_encode_secinfo()
3789 if (!p) in nfsd4_do_encode_secinfo()
3791 *p++ = cpu_to_be32(pf); in nfsd4_do_encode_secinfo()
3831 __be32 *p; in nfsd4_encode_setattr() local
3833 p = xdr_reserve_space(xdr, 16); in nfsd4_encode_setattr()
3834 if (!p) in nfsd4_encode_setattr()
3837 *p++ = cpu_to_be32(3); in nfsd4_encode_setattr()
3838 *p++ = cpu_to_be32(0); in nfsd4_encode_setattr()
3839 *p++ = cpu_to_be32(0); in nfsd4_encode_setattr()
3840 *p++ = cpu_to_be32(0); in nfsd4_encode_setattr()
3843 *p++ = cpu_to_be32(3); in nfsd4_encode_setattr()
3844 *p++ = cpu_to_be32(setattr->sa_bmval[0]); in nfsd4_encode_setattr()
3845 *p++ = cpu_to_be32(setattr->sa_bmval[1]); in nfsd4_encode_setattr()
3846 *p++ = cpu_to_be32(setattr->sa_bmval[2]); in nfsd4_encode_setattr()
3855 __be32 *p; in nfsd4_encode_setclientid() local
3858 p = xdr_reserve_space(xdr, 8 + NFS4_VERIFIER_SIZE); in nfsd4_encode_setclientid()
3859 if (!p) in nfsd4_encode_setclientid()
3861 p = xdr_encode_opaque_fixed(p, &scd->se_clientid, 8); in nfsd4_encode_setclientid()
3862 p = xdr_encode_opaque_fixed(p, &scd->se_confirm, in nfsd4_encode_setclientid()
3866 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_setclientid()
3867 if (!p) in nfsd4_encode_setclientid()
3869 *p++ = cpu_to_be32(0); in nfsd4_encode_setclientid()
3870 *p++ = cpu_to_be32(0); in nfsd4_encode_setclientid()
3879 __be32 *p; in nfsd4_encode_write() local
3881 p = xdr_reserve_space(xdr, 16); in nfsd4_encode_write()
3882 if (!p) in nfsd4_encode_write()
3884 *p++ = cpu_to_be32(write->wr_bytes_written); in nfsd4_encode_write()
3885 *p++ = cpu_to_be32(write->wr_how_written); in nfsd4_encode_write()
3886 p = xdr_encode_opaque_fixed(p, write->wr_verifier.data, in nfsd4_encode_write()
3896 __be32 *p; in nfsd4_encode_exchange_id() local
3908 p = xdr_reserve_space(xdr, in nfsd4_encode_exchange_id()
3913 if (!p) in nfsd4_encode_exchange_id()
3916 p = xdr_encode_opaque_fixed(p, &exid->clientid, 8); in nfsd4_encode_exchange_id()
3917 *p++ = cpu_to_be32(exid->seqid); in nfsd4_encode_exchange_id()
3918 *p++ = cpu_to_be32(exid->flags); in nfsd4_encode_exchange_id()
3920 *p++ = cpu_to_be32(exid->spa_how); in nfsd4_encode_exchange_id()
3945 p = xdr_reserve_space(xdr, in nfsd4_encode_exchange_id()
3952 if (!p) in nfsd4_encode_exchange_id()
3956 p = xdr_encode_hyper(p, minor_id); /* Minor id */ in nfsd4_encode_exchange_id()
3958 p = xdr_encode_opaque(p, major_id, major_id_sz); in nfsd4_encode_exchange_id()
3961 p = xdr_encode_opaque(p, server_scope, server_scope_sz); in nfsd4_encode_exchange_id()
3964 *p++ = cpu_to_be32(0); /* zero length nfs_impl_id4 array */ in nfsd4_encode_exchange_id()
3973 __be32 *p; in nfsd4_encode_create_session() local
3975 p = xdr_reserve_space(xdr, 24); in nfsd4_encode_create_session()
3976 if (!p) in nfsd4_encode_create_session()
3978 p = xdr_encode_opaque_fixed(p, sess->sessionid.data, in nfsd4_encode_create_session()
3980 *p++ = cpu_to_be32(sess->seqid); in nfsd4_encode_create_session()
3981 *p++ = cpu_to_be32(sess->flags); in nfsd4_encode_create_session()
3983 p = xdr_reserve_space(xdr, 28); in nfsd4_encode_create_session()
3984 if (!p) in nfsd4_encode_create_session()
3986 *p++ = cpu_to_be32(0); /* headerpadsz */ in nfsd4_encode_create_session()
3987 *p++ = cpu_to_be32(sess->fore_channel.maxreq_sz); in nfsd4_encode_create_session()
3988 *p++ = cpu_to_be32(sess->fore_channel.maxresp_sz); in nfsd4_encode_create_session()
3989 *p++ = cpu_to_be32(sess->fore_channel.maxresp_cached); in nfsd4_encode_create_session()
3990 *p++ = cpu_to_be32(sess->fore_channel.maxops); in nfsd4_encode_create_session()
3991 *p++ = cpu_to_be32(sess->fore_channel.maxreqs); in nfsd4_encode_create_session()
3992 *p++ = cpu_to_be32(sess->fore_channel.nr_rdma_attrs); in nfsd4_encode_create_session()
3995 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_create_session()
3996 if (!p) in nfsd4_encode_create_session()
3998 *p++ = cpu_to_be32(sess->fore_channel.rdma_attrs); in nfsd4_encode_create_session()
4001 p = xdr_reserve_space(xdr, 28); in nfsd4_encode_create_session()
4002 if (!p) in nfsd4_encode_create_session()
4004 *p++ = cpu_to_be32(0); /* headerpadsz */ in nfsd4_encode_create_session()
4005 *p++ = cpu_to_be32(sess->back_channel.maxreq_sz); in nfsd4_encode_create_session()
4006 *p++ = cpu_to_be32(sess->back_channel.maxresp_sz); in nfsd4_encode_create_session()
4007 *p++ = cpu_to_be32(sess->back_channel.maxresp_cached); in nfsd4_encode_create_session()
4008 *p++ = cpu_to_be32(sess->back_channel.maxops); in nfsd4_encode_create_session()
4009 *p++ = cpu_to_be32(sess->back_channel.maxreqs); in nfsd4_encode_create_session()
4010 *p++ = cpu_to_be32(sess->back_channel.nr_rdma_attrs); in nfsd4_encode_create_session()
4013 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_create_session()
4014 if (!p) in nfsd4_encode_create_session()
4016 *p++ = cpu_to_be32(sess->back_channel.rdma_attrs); in nfsd4_encode_create_session()
4026 __be32 *p; in nfsd4_encode_sequence() local
4028 p = xdr_reserve_space(xdr, NFS4_MAX_SESSIONID_LEN + 20); in nfsd4_encode_sequence()
4029 if (!p) in nfsd4_encode_sequence()
4031 p = xdr_encode_opaque_fixed(p, seq->sessionid.data, in nfsd4_encode_sequence()
4033 *p++ = cpu_to_be32(seq->seqid); in nfsd4_encode_sequence()
4034 *p++ = cpu_to_be32(seq->slotid); in nfsd4_encode_sequence()
4036 *p++ = cpu_to_be32(seq->maxslots - 1); /* sr_highest_slotid */ in nfsd4_encode_sequence()
4037 *p++ = cpu_to_be32(seq->maxslots - 1); /* sr_target_highest_slotid */ in nfsd4_encode_sequence()
4038 *p++ = cpu_to_be32(seq->status_flags); in nfsd4_encode_sequence()
4050 __be32 *p; in nfsd4_encode_test_stateid() local
4052 p = xdr_reserve_space(xdr, 4 + (4 * test_stateid->ts_num_ids)); in nfsd4_encode_test_stateid()
4053 if (!p) in nfsd4_encode_test_stateid()
4055 *p++ = htonl(test_stateid->ts_num_ids); in nfsd4_encode_test_stateid()
4058 *p++ = stateid->ts_id_status; in nfsd4_encode_test_stateid()
4072 __be32 *p; in nfsd4_encode_getdeviceinfo() local
4074 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_getdeviceinfo()
4075 if (!p) in nfsd4_encode_getdeviceinfo()
4078 *p++ = cpu_to_be32(gdev->gd_layout_type); in nfsd4_encode_getdeviceinfo()
4097 p = xdr_reserve_space(xdr, 4 + 4); in nfsd4_encode_getdeviceinfo()
4098 if (!p) in nfsd4_encode_getdeviceinfo()
4100 *p++ = cpu_to_be32(1); /* bitmap length */ in nfsd4_encode_getdeviceinfo()
4101 *p++ = cpu_to_be32(gdev->gd_notify_types); in nfsd4_encode_getdeviceinfo()
4103 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_getdeviceinfo()
4104 if (!p) in nfsd4_encode_getdeviceinfo()
4106 *p++ = 0; in nfsd4_encode_getdeviceinfo()
4114 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_getdeviceinfo()
4115 if (!p) in nfsd4_encode_getdeviceinfo()
4117 *p++ = cpu_to_be32(needed_len); in nfsd4_encode_getdeviceinfo()
4127 __be32 *p; in nfsd4_encode_layoutget() local
4129 p = xdr_reserve_space(xdr, 36 + sizeof(stateid_opaque_t)); in nfsd4_encode_layoutget()
4130 if (!p) in nfsd4_encode_layoutget()
4133 *p++ = cpu_to_be32(1); /* we always set return-on-close */ in nfsd4_encode_layoutget()
4134 *p++ = cpu_to_be32(lgp->lg_sid.si_generation); in nfsd4_encode_layoutget()
4135 p = xdr_encode_opaque_fixed(p, &lgp->lg_sid.si_opaque, in nfsd4_encode_layoutget()
4138 *p++ = cpu_to_be32(1); /* we always return a single layout */ in nfsd4_encode_layoutget()
4139 p = xdr_encode_hyper(p, lgp->lg_seg.offset); in nfsd4_encode_layoutget()
4140 p = xdr_encode_hyper(p, lgp->lg_seg.length); in nfsd4_encode_layoutget()
4141 *p++ = cpu_to_be32(lgp->lg_seg.iomode); in nfsd4_encode_layoutget()
4142 *p++ = cpu_to_be32(lgp->lg_layout_type); in nfsd4_encode_layoutget()
4153 __be32 *p; in nfsd4_encode_layoutcommit() local
4155 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_layoutcommit()
4156 if (!p) in nfsd4_encode_layoutcommit()
4158 *p++ = cpu_to_be32(lcp->lc_size_chg); in nfsd4_encode_layoutcommit()
4160 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_layoutcommit()
4161 if (!p) in nfsd4_encode_layoutcommit()
4163 p = xdr_encode_hyper(p, lcp->lc_newsize); in nfsd4_encode_layoutcommit()
4174 __be32 *p; in nfsd4_encode_layoutreturn() local
4176 p = xdr_reserve_space(xdr, 4); in nfsd4_encode_layoutreturn()
4177 if (!p) in nfsd4_encode_layoutreturn()
4179 *p++ = cpu_to_be32(lrp->lrs_present); in nfsd4_encode_layoutreturn()
4189 __be32 *p; in nfsd42_encode_write_res() local
4191 p = xdr_reserve_space(&resp->xdr, 4 + 8 + 4 + NFS4_VERIFIER_SIZE); in nfsd42_encode_write_res()
4192 if (!p) in nfsd42_encode_write_res()
4195 *p++ = cpu_to_be32(0); in nfsd42_encode_write_res()
4196 p = xdr_encode_hyper(p, write->wr_bytes_written); in nfsd42_encode_write_res()
4197 *p++ = cpu_to_be32(write->wr_stable_how); in nfsd42_encode_write_res()
4198 p = xdr_encode_opaque_fixed(p, write->wr_verifier.data, in nfsd42_encode_write_res()
4207 __be32 *p; in nfsd4_encode_copy() local
4213 p = xdr_reserve_space(&resp->xdr, 4 + 4); in nfsd4_encode_copy()
4214 *p++ = cpu_to_be32(copy->cp_consecutive); in nfsd4_encode_copy()
4215 *p++ = cpu_to_be32(copy->cp_synchronous); in nfsd4_encode_copy()
4223 __be32 *p; in nfsd4_encode_seek() local
4225 p = xdr_reserve_space(&resp->xdr, 4 + 8); in nfsd4_encode_seek()
4226 *p++ = cpu_to_be32(seek->seek_eof); in nfsd4_encode_seek()
4227 p = xdr_encode_hyper(p, seek->seek_pos); in nfsd4_encode_seek()
4233 nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p) in nfsd4_encode_noop() argument
4367 __be32 *p; in nfsd4_encode_operation() local
4369 p = xdr_reserve_space(xdr, 8); in nfsd4_encode_operation()
4370 if (!p) { in nfsd4_encode_operation()
4374 *p++ = cpu_to_be32(op->opnum); in nfsd4_encode_operation()
4440 __be32 *p; in nfsd4_encode_replay() local
4445 p = xdr_reserve_space(xdr, 8 + rp->rp_buflen); in nfsd4_encode_replay()
4446 if (!p) { in nfsd4_encode_replay()
4450 *p++ = cpu_to_be32(op->opnum); in nfsd4_encode_replay()
4451 *p++ = rp->rp_status; /* already xdr'ed */ in nfsd4_encode_replay()
4453 p = xdr_encode_opaque_fixed(p, rp->rp_buf, rp->rp_buflen); in nfsd4_encode_replay()
4457 nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p) in nfs4svc_encode_voidres() argument
4459 return xdr_ressize_check(rqstp, p); in nfs4svc_encode_voidres()
4480 nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p) in nfs4svc_decode_compoundargs() argument
4490 args->p = p; in nfs4svc_decode_compoundargs()
4504 nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p) in nfs4svc_encode_compoundres() argument
4517 p = resp->tagp; in nfs4svc_encode_compoundres()
4518 *p++ = htonl(resp->taglen); in nfs4svc_encode_compoundres()
4519 memcpy(p, resp->tag, resp->taglen); in nfs4svc_encode_compoundres()
4520 p += XDR_QUADLEN(resp->taglen); in nfs4svc_encode_compoundres()
4521 *p++ = htonl(resp->opcnt); in nfs4svc_encode_compoundres()