Lines Matching refs:p
37 decode_fh(__be32 *p, struct svc_fh *fhp) in decode_fh() argument
40 memcpy(&fhp->fh_handle.fh_base, p, NFS_FHSIZE); in decode_fh()
45 return p + (NFS_FHSIZE >> 2); in decode_fh()
49 __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp) in nfs2svc_decode_fh() argument
51 return decode_fh(p, fhp); in nfs2svc_decode_fh()
55 encode_fh(__be32 *p, struct svc_fh *fhp) in encode_fh() argument
57 memcpy(p, &fhp->fh_handle.fh_base, NFS_FHSIZE); in encode_fh()
58 return p + (NFS_FHSIZE>> 2); in encode_fh()
66 decode_filename(__be32 *p, char **namp, unsigned int *lenp) in decode_filename() argument
71 if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXNAMLEN)) != NULL) { in decode_filename()
78 return p; in decode_filename()
82 decode_pathname(__be32 *p, char **namp, unsigned int *lenp) in decode_pathname() argument
87 if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXPATHLEN)) != NULL) { in decode_pathname()
94 return p; in decode_pathname()
98 decode_sattr(__be32 *p, struct iattr *iap) in decode_sattr() argument
108 if ((tmp = ntohl(*p++)) != (u32)-1 && tmp != 0xffff) { in decode_sattr()
112 if ((tmp = ntohl(*p++)) != (u32)-1) { in decode_sattr()
116 if ((tmp = ntohl(*p++)) != (u32)-1) { in decode_sattr()
120 if ((tmp = ntohl(*p++)) != (u32)-1) { in decode_sattr()
124 tmp = ntohl(*p++); tmp1 = ntohl(*p++); in decode_sattr()
130 tmp = ntohl(*p++); tmp1 = ntohl(*p++); in decode_sattr()
147 return p; in decode_sattr()
151 encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, in encode_fattr() argument
161 *p++ = htonl(nfs_ftypes[type >> 12]); in encode_fattr()
162 *p++ = htonl((u32) stat->mode); in encode_fattr()
163 *p++ = htonl((u32) stat->nlink); in encode_fattr()
164 *p++ = htonl((u32) nfsd_ruid(rqstp, stat->uid)); in encode_fattr()
165 *p++ = htonl((u32) nfsd_rgid(rqstp, stat->gid)); in encode_fattr()
168 *p++ = htonl(NFS_MAXPATHLEN); in encode_fattr()
170 *p++ = htonl((u32) stat->size); in encode_fattr()
172 *p++ = htonl((u32) stat->blksize); in encode_fattr()
174 *p++ = htonl(new_encode_dev(stat->rdev)); in encode_fattr()
176 *p++ = htonl(0xffffffff); in encode_fattr()
177 *p++ = htonl((u32) stat->blocks); in encode_fattr()
181 *p++ = htonl(new_encode_dev(stat->dev)); in encode_fattr()
184 *p++ = htonl((u32) fhp->fh_export->ex_fsid); in encode_fattr()
191 *p++ = htonl(f); in encode_fattr()
194 *p++ = htonl((u32) stat->ino); in encode_fattr()
195 *p++ = htonl((u32) stat->atime.tv_sec); in encode_fattr()
196 *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0); in encode_fattr()
198 *p++ = htonl((u32) time.tv_sec); in encode_fattr()
199 *p++ = htonl(time.tv_nsec ? time.tv_nsec / 1000 : 0); in encode_fattr()
200 *p++ = htonl((u32) stat->ctime.tv_sec); in encode_fattr()
201 *p++ = htonl(stat->ctime.tv_nsec ? stat->ctime.tv_nsec / 1000 : 0); in encode_fattr()
203 return p; in encode_fattr()
207 __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) in nfs2svc_encode_fattr() argument
211 return encode_fattr(rqstp, p, fhp, &stat); in nfs2svc_encode_fattr()
218 nfssvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) in nfssvc_decode_void() argument
220 return xdr_argsize_check(rqstp, p); in nfssvc_decode_void()
224 nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args) in nfssvc_decode_fhandle() argument
226 if (!(p = decode_fh(p, &args->fh))) in nfssvc_decode_fhandle()
228 return xdr_argsize_check(rqstp, p); in nfssvc_decode_fhandle()
232 nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_sattrargs() argument
235 p = decode_fh(p, &args->fh); in nfssvc_decode_sattrargs()
236 if (!p) in nfssvc_decode_sattrargs()
238 p = decode_sattr(p, &args->attrs); in nfssvc_decode_sattrargs()
240 return xdr_argsize_check(rqstp, p); in nfssvc_decode_sattrargs()
244 nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_diropargs() argument
247 if (!(p = decode_fh(p, &args->fh)) in nfssvc_decode_diropargs()
248 || !(p = decode_filename(p, &args->name, &args->len))) in nfssvc_decode_diropargs()
251 return xdr_argsize_check(rqstp, p); in nfssvc_decode_diropargs()
255 nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_readargs() argument
260 if (!(p = decode_fh(p, &args->fh))) in nfssvc_decode_readargs()
263 args->offset = ntohl(*p++); in nfssvc_decode_readargs()
264 len = args->count = ntohl(*p++); in nfssvc_decode_readargs()
265 p++; /* totalcount - unused */ in nfssvc_decode_readargs()
282 return xdr_argsize_check(rqstp, p); in nfssvc_decode_readargs()
286 nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_writeargs() argument
292 if (!(p = decode_fh(p, &args->fh))) in nfssvc_decode_writeargs()
295 p++; /* beginoffset */ in nfssvc_decode_writeargs()
296 args->offset = ntohl(*p++); /* offset */ in nfssvc_decode_writeargs()
297 p++; /* totalcount */ in nfssvc_decode_writeargs()
298 len = args->len = ntohl(*p++); in nfssvc_decode_writeargs()
309 hdr = (void*)p - rqstp->rq_arg.head[0].iov_base; in nfssvc_decode_writeargs()
324 rqstp->rq_vec[0].iov_base = (void*)p; in nfssvc_decode_writeargs()
339 nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_createargs() argument
342 if ( !(p = decode_fh(p, &args->fh)) in nfssvc_decode_createargs()
343 || !(p = decode_filename(p, &args->name, &args->len))) in nfssvc_decode_createargs()
345 p = decode_sattr(p, &args->attrs); in nfssvc_decode_createargs()
347 return xdr_argsize_check(rqstp, p); in nfssvc_decode_createargs()
351 nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_renameargs() argument
354 if (!(p = decode_fh(p, &args->ffh)) in nfssvc_decode_renameargs()
355 || !(p = decode_filename(p, &args->fname, &args->flen)) in nfssvc_decode_renameargs()
356 || !(p = decode_fh(p, &args->tfh)) in nfssvc_decode_renameargs()
357 || !(p = decode_filename(p, &args->tname, &args->tlen))) in nfssvc_decode_renameargs()
360 return xdr_argsize_check(rqstp, p); in nfssvc_decode_renameargs()
364 nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readlinkargs *args) in nfssvc_decode_readlinkargs() argument
366 if (!(p = decode_fh(p, &args->fh))) in nfssvc_decode_readlinkargs()
370 return xdr_argsize_check(rqstp, p); in nfssvc_decode_readlinkargs()
374 nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_linkargs() argument
377 if (!(p = decode_fh(p, &args->ffh)) in nfssvc_decode_linkargs()
378 || !(p = decode_fh(p, &args->tfh)) in nfssvc_decode_linkargs()
379 || !(p = decode_filename(p, &args->tname, &args->tlen))) in nfssvc_decode_linkargs()
382 return xdr_argsize_check(rqstp, p); in nfssvc_decode_linkargs()
386 nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_symlinkargs() argument
389 if ( !(p = decode_fh(p, &args->ffh)) in nfssvc_decode_symlinkargs()
390 || !(p = decode_filename(p, &args->fname, &args->flen)) in nfssvc_decode_symlinkargs()
391 || !(p = decode_pathname(p, &args->tname, &args->tlen))) in nfssvc_decode_symlinkargs()
393 p = decode_sattr(p, &args->attrs); in nfssvc_decode_symlinkargs()
395 return xdr_argsize_check(rqstp, p); in nfssvc_decode_symlinkargs()
399 nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, in nfssvc_decode_readdirargs() argument
402 if (!(p = decode_fh(p, &args->fh))) in nfssvc_decode_readdirargs()
404 args->cookie = ntohl(*p++); in nfssvc_decode_readdirargs()
405 args->count = ntohl(*p++); in nfssvc_decode_readdirargs()
411 return xdr_argsize_check(rqstp, p); in nfssvc_decode_readdirargs()
418 nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) in nfssvc_encode_void() argument
420 return xdr_ressize_check(rqstp, p); in nfssvc_encode_void()
424 nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_attrstat() argument
427 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); in nfssvc_encode_attrstat()
428 return xdr_ressize_check(rqstp, p); in nfssvc_encode_attrstat()
432 nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_diropres() argument
435 p = encode_fh(p, &resp->fh); in nfssvc_encode_diropres()
436 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); in nfssvc_encode_diropres()
437 return xdr_ressize_check(rqstp, p); in nfssvc_encode_diropres()
441 nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_readlinkres() argument
444 *p++ = htonl(resp->len); in nfssvc_encode_readlinkres()
445 xdr_ressize_check(rqstp, p); in nfssvc_encode_readlinkres()
449 rqstp->rq_res.tail[0].iov_base = p; in nfssvc_encode_readlinkres()
450 *p = 0; in nfssvc_encode_readlinkres()
457 nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_readres() argument
460 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); in nfssvc_encode_readres()
461 *p++ = htonl(resp->count); in nfssvc_encode_readres()
462 xdr_ressize_check(rqstp, p); in nfssvc_encode_readres()
468 rqstp->rq_res.tail[0].iov_base = p; in nfssvc_encode_readres()
469 *p = 0; in nfssvc_encode_readres()
476 nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_readdirres() argument
479 xdr_ressize_check(rqstp, p); in nfssvc_encode_readdirres()
480 p = resp->buffer; in nfssvc_encode_readdirres()
481 *p++ = 0; /* no more entries */ in nfssvc_encode_readdirres()
482 *p++ = htonl((resp->common.err == nfserr_eof)); in nfssvc_encode_readdirres()
483 rqstp->rq_res.page_len = (((unsigned long)p-1) & ~PAGE_MASK)+1; in nfssvc_encode_readdirres()
489 nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p, in nfssvc_encode_statfsres() argument
494 *p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */ in nfssvc_encode_statfsres()
495 *p++ = htonl(stat->f_bsize); in nfssvc_encode_statfsres()
496 *p++ = htonl(stat->f_blocks); in nfssvc_encode_statfsres()
497 *p++ = htonl(stat->f_bfree); in nfssvc_encode_statfsres()
498 *p++ = htonl(stat->f_bavail); in nfssvc_encode_statfsres()
499 return xdr_ressize_check(rqstp, p); in nfssvc_encode_statfsres()
508 __be32 *p = cd->buffer; in nfssvc_encode_entry() local
534 *p++ = xdr_one; /* mark entry present */ in nfssvc_encode_entry()
535 *p++ = htonl((u32) ino); /* file id */ in nfssvc_encode_entry()
536 p = xdr_encode_array(p, name, namlen);/* name length & name */ in nfssvc_encode_entry()
537 cd->offset = p; /* remember pointer */ in nfssvc_encode_entry()
538 *p++ = htonl(~0U); /* offset of next entry */ in nfssvc_encode_entry()
541 cd->buffer = p; in nfssvc_encode_entry()
550 nfssvc_release_fhandle(struct svc_rqst *rqstp, __be32 *p, in nfssvc_release_fhandle() argument