aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c150
1 files changed, 75 insertions, 75 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 3419d99aeb1a..d7b630f1a9ae 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -68,8 +68,8 @@
68#define NFS4_REFERRAL_FSID_MAJOR 0x8000000ULL 68#define NFS4_REFERRAL_FSID_MAJOR 0x8000000ULL
69#define NFS4_REFERRAL_FSID_MINOR 0x8000000ULL 69#define NFS4_REFERRAL_FSID_MINOR 0x8000000ULL
70 70
71static int 71static __be32
72check_filename(char *str, int len, int err) 72check_filename(char *str, int len, __be32 err)
73{ 73{
74 int i; 74 int i;
75 75
@@ -95,7 +95,7 @@ check_filename(char *str, int len, int err)
95 */ 95 */
96#define DECODE_HEAD \ 96#define DECODE_HEAD \
97 __be32 *p; \ 97 __be32 *p; \
98 int status 98 __be32 status
99#define DECODE_TAIL \ 99#define DECODE_TAIL \
100 status = 0; \ 100 status = 0; \
101out: \ 101out: \
@@ -217,7 +217,7 @@ static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
217} 217}
218 218
219 219
220static int 220static __be32
221nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval) 221nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval)
222{ 222{
223 u32 bmlen; 223 u32 bmlen;
@@ -240,7 +240,7 @@ nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval)
240 DECODE_TAIL; 240 DECODE_TAIL;
241} 241}
242 242
243static int 243static __be32
244nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *iattr, 244nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *iattr,
245 struct nfs4_acl **acl) 245 struct nfs4_acl **acl)
246{ 246{
@@ -418,7 +418,7 @@ out_nfserr:
418 goto out; 418 goto out;
419} 419}
420 420
421static int 421static __be32
422nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access) 422nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access)
423{ 423{
424 DECODE_HEAD; 424 DECODE_HEAD;
@@ -429,7 +429,7 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
429 DECODE_TAIL; 429 DECODE_TAIL;
430} 430}
431 431
432static int 432static __be32
433nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close) 433nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
434{ 434{
435 DECODE_HEAD; 435 DECODE_HEAD;
@@ -444,7 +444,7 @@ nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
444} 444}
445 445
446 446
447static int 447static __be32
448nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit) 448nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit)
449{ 449{
450 DECODE_HEAD; 450 DECODE_HEAD;
@@ -456,7 +456,7 @@ nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit
456 DECODE_TAIL; 456 DECODE_TAIL;
457} 457}
458 458
459static int 459static __be32
460nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create) 460nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create)
461{ 461{
462 DECODE_HEAD; 462 DECODE_HEAD;
@@ -496,7 +496,7 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
496 DECODE_TAIL; 496 DECODE_TAIL;
497} 497}
498 498
499static inline int 499static inline __be32
500nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr) 500nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr)
501{ 501{
502 DECODE_HEAD; 502 DECODE_HEAD;
@@ -508,13 +508,13 @@ nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegretu
508 DECODE_TAIL; 508 DECODE_TAIL;
509} 509}
510 510
511static inline int 511static inline __be32
512nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr) 512nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr)
513{ 513{
514 return nfsd4_decode_bitmap(argp, getattr->ga_bmval); 514 return nfsd4_decode_bitmap(argp, getattr->ga_bmval);
515} 515}
516 516
517static int 517static __be32
518nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link) 518nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
519{ 519{
520 DECODE_HEAD; 520 DECODE_HEAD;
@@ -529,7 +529,7 @@ nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
529 DECODE_TAIL; 529 DECODE_TAIL;
530} 530}
531 531
532static int 532static __be32
533nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock) 533nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
534{ 534{
535 DECODE_HEAD; 535 DECODE_HEAD;
@@ -568,7 +568,7 @@ nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
568 DECODE_TAIL; 568 DECODE_TAIL;
569} 569}
570 570
571static int 571static __be32
572nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt) 572nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
573{ 573{
574 DECODE_HEAD; 574 DECODE_HEAD;
@@ -587,7 +587,7 @@ nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
587 DECODE_TAIL; 587 DECODE_TAIL;
588} 588}
589 589
590static int 590static __be32
591nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku) 591nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
592{ 592{
593 DECODE_HEAD; 593 DECODE_HEAD;
@@ -606,7 +606,7 @@ nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
606 DECODE_TAIL; 606 DECODE_TAIL;
607} 607}
608 608
609static int 609static __be32
610nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup) 610nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup)
611{ 611{
612 DECODE_HEAD; 612 DECODE_HEAD;
@@ -621,7 +621,7 @@ nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup
621 DECODE_TAIL; 621 DECODE_TAIL;
622} 622}
623 623
624static int 624static __be32
625nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open) 625nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
626{ 626{
627 DECODE_HEAD; 627 DECODE_HEAD;
@@ -699,7 +699,7 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
699 DECODE_TAIL; 699 DECODE_TAIL;
700} 700}
701 701
702static int 702static __be32
703nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_confirm *open_conf) 703nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_confirm *open_conf)
704{ 704{
705 DECODE_HEAD; 705 DECODE_HEAD;
@@ -713,7 +713,7 @@ nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_con
713 DECODE_TAIL; 713 DECODE_TAIL;
714} 714}
715 715
716static int 716static __be32
717nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_downgrade *open_down) 717nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_downgrade *open_down)
718{ 718{
719 DECODE_HEAD; 719 DECODE_HEAD;
@@ -729,7 +729,7 @@ nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_d
729 DECODE_TAIL; 729 DECODE_TAIL;
730} 730}
731 731
732static int 732static __be32
733nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh) 733nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
734{ 734{
735 DECODE_HEAD; 735 DECODE_HEAD;
@@ -744,7 +744,7 @@ nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
744 DECODE_TAIL; 744 DECODE_TAIL;
745} 745}
746 746
747static int 747static __be32
748nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read) 748nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
749{ 749{
750 DECODE_HEAD; 750 DECODE_HEAD;
@@ -758,7 +758,7 @@ nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
758 DECODE_TAIL; 758 DECODE_TAIL;
759} 759}
760 760
761static int 761static __be32
762nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *readdir) 762nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *readdir)
763{ 763{
764 DECODE_HEAD; 764 DECODE_HEAD;
@@ -774,7 +774,7 @@ nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *read
774 DECODE_TAIL; 774 DECODE_TAIL;
775} 775}
776 776
777static int 777static __be32
778nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove) 778nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove)
779{ 779{
780 DECODE_HEAD; 780 DECODE_HEAD;
@@ -789,7 +789,7 @@ nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove
789 DECODE_TAIL; 789 DECODE_TAIL;
790} 790}
791 791
792static int 792static __be32
793nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename) 793nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename)
794{ 794{
795 DECODE_HEAD; 795 DECODE_HEAD;
@@ -809,7 +809,7 @@ nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename
809 DECODE_TAIL; 809 DECODE_TAIL;
810} 810}
811 811
812static int 812static __be32
813nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid) 813nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
814{ 814{
815 DECODE_HEAD; 815 DECODE_HEAD;
@@ -820,7 +820,7 @@ nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
820 DECODE_TAIL; 820 DECODE_TAIL;
821} 821}
822 822
823static int 823static __be32
824nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr) 824nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr)
825{ 825{
826 DECODE_HEAD; 826 DECODE_HEAD;
@@ -834,7 +834,7 @@ nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *seta
834 DECODE_TAIL; 834 DECODE_TAIL;
835} 835}
836 836
837static int 837static __be32
838nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid) 838nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid)
839{ 839{
840 DECODE_HEAD; 840 DECODE_HEAD;
@@ -859,7 +859,7 @@ nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclient
859 DECODE_TAIL; 859 DECODE_TAIL;
860} 860}
861 861
862static int 862static __be32
863nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid_confirm *scd_c) 863nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid_confirm *scd_c)
864{ 864{
865 DECODE_HEAD; 865 DECODE_HEAD;
@@ -872,7 +872,7 @@ nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_s
872} 872}
873 873
874/* Also used for NVERIFY */ 874/* Also used for NVERIFY */
875static int 875static __be32
876nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify) 876nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify)
877{ 877{
878#if 0 878#if 0
@@ -908,7 +908,7 @@ nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify
908 DECODE_TAIL; 908 DECODE_TAIL;
909} 909}
910 910
911static int 911static __be32
912nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) 912nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
913{ 913{
914 int avail; 914 int avail;
@@ -959,7 +959,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
959 DECODE_TAIL; 959 DECODE_TAIL;
960} 960}
961 961
962static int 962static __be32
963nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_release_lockowner *rlockowner) 963nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_release_lockowner *rlockowner)
964{ 964{
965 DECODE_HEAD; 965 DECODE_HEAD;
@@ -973,7 +973,7 @@ nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_rel
973 DECODE_TAIL; 973 DECODE_TAIL;
974} 974}
975 975
976static int 976static __be32
977nfsd4_decode_compound(struct nfsd4_compoundargs *argp) 977nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
978{ 978{
979 DECODE_HEAD; 979 DECODE_HEAD;
@@ -1234,7 +1234,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1234/* Encode as an array of strings the string given with components 1234/* Encode as an array of strings the string given with components
1235 * seperated @sep. 1235 * seperated @sep.
1236 */ 1236 */
1237static int nfsd4_encode_components(char sep, char *components, 1237static __be32 nfsd4_encode_components(char sep, char *components,
1238 __be32 **pp, int *buflen) 1238 __be32 **pp, int *buflen)
1239{ 1239{
1240 __be32 *p = *pp; 1240 __be32 *p = *pp;
@@ -1271,10 +1271,10 @@ static int nfsd4_encode_components(char sep, char *components,
1271/* 1271/*
1272 * encode a location element of a fs_locations structure 1272 * encode a location element of a fs_locations structure
1273 */ 1273 */
1274static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location, 1274static __be32 nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
1275 __be32 **pp, int *buflen) 1275 __be32 **pp, int *buflen)
1276{ 1276{
1277 int status; 1277 __be32 status;
1278 __be32 *p = *pp; 1278 __be32 *p = *pp;
1279 1279
1280 status = nfsd4_encode_components(':', location->hosts, &p, buflen); 1280 status = nfsd4_encode_components(':', location->hosts, &p, buflen);
@@ -1292,7 +1292,7 @@ static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
1292 * Returned string is safe to use as long as the caller holds a reference 1292 * Returned string is safe to use as long as the caller holds a reference
1293 * to @exp. 1293 * to @exp.
1294 */ 1294 */
1295static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, u32 *stat) 1295static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *stat)
1296{ 1296{
1297 struct svc_fh tmp_fh; 1297 struct svc_fh tmp_fh;
1298 char *path, *rootpath; 1298 char *path, *rootpath;
@@ -1318,11 +1318,11 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, u32 *sta
1318/* 1318/*
1319 * encode a fs_locations structure 1319 * encode a fs_locations structure
1320 */ 1320 */
1321static int nfsd4_encode_fs_locations(struct svc_rqst *rqstp, 1321static __be32 nfsd4_encode_fs_locations(struct svc_rqst *rqstp,
1322 struct svc_export *exp, 1322 struct svc_export *exp,
1323 __be32 **pp, int *buflen) 1323 __be32 **pp, int *buflen)
1324{ 1324{
1325 u32 status; 1325 __be32 status;
1326 int i; 1326 int i;
1327 __be32 *p = *pp; 1327 __be32 *p = *pp;
1328 struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs; 1328 struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs;
@@ -1353,7 +1353,7 @@ static u32 nfs4_ftypes[16] = {
1353 NF4SOCK, NF4BAD, NF4LNK, NF4BAD, 1353 NF4SOCK, NF4BAD, NF4LNK, NF4BAD,
1354}; 1354};
1355 1355
1356static int 1356static __be32
1357nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group, 1357nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1358 __be32 **p, int *buflen) 1358 __be32 **p, int *buflen)
1359{ 1359{
@@ -1375,19 +1375,19 @@ nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1375 return 0; 1375 return 0;
1376} 1376}
1377 1377
1378static inline int 1378static inline __be32
1379nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, __be32 **p, int *buflen) 1379nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, __be32 **p, int *buflen)
1380{ 1380{
1381 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, uid, 0, p, buflen); 1381 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, uid, 0, p, buflen);
1382} 1382}
1383 1383
1384static inline int 1384static inline __be32
1385nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, __be32 **p, int *buflen) 1385nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, __be32 **p, int *buflen)
1386{ 1386{
1387 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, gid, 1, p, buflen); 1387 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, gid, 1, p, buflen);
1388} 1388}
1389 1389
1390static inline int 1390static inline __be32
1391nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group, 1391nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1392 __be32 **p, int *buflen) 1392 __be32 **p, int *buflen)
1393{ 1393{
@@ -1398,7 +1398,7 @@ nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1398 FATTR4_WORD0_RDATTR_ERROR) 1398 FATTR4_WORD0_RDATTR_ERROR)
1399#define WORD1_ABSENT_FS_ATTRS FATTR4_WORD1_MOUNTED_ON_FILEID 1399#define WORD1_ABSENT_FS_ATTRS FATTR4_WORD1_MOUNTED_ON_FILEID
1400 1400
1401static int fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err) 1401static __be32 fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
1402{ 1402{
1403 /* As per referral draft: */ 1403 /* As per referral draft: */
1404 if (*bmval0 & ~WORD0_ABSENT_FS_ATTRS || 1404 if (*bmval0 & ~WORD0_ABSENT_FS_ATTRS ||
@@ -1421,7 +1421,7 @@ static int fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
1421 * @countp is the buffer size in _words_; upon successful return this becomes 1421 * @countp is the buffer size in _words_; upon successful return this becomes
1422 * replaced with the number of words written. 1422 * replaced with the number of words written.
1423 */ 1423 */
1424int 1424__be32
1425nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, 1425nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1426 struct dentry *dentry, __be32 *buffer, int *countp, u32 *bmval, 1426 struct dentry *dentry, __be32 *buffer, int *countp, u32 *bmval,
1427 struct svc_rqst *rqstp) 1427 struct svc_rqst *rqstp)
@@ -1437,7 +1437,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1437 u64 dummy64; 1437 u64 dummy64;
1438 u32 rdattr_err = 0; 1438 u32 rdattr_err = 0;
1439 __be32 *p = buffer; 1439 __be32 *p = buffer;
1440 int status; 1440 __be32 status;
1441 int aclsupport = 0; 1441 int aclsupport = 0;
1442 struct nfs4_acl *acl = NULL; 1442 struct nfs4_acl *acl = NULL;
1443 1443
@@ -1829,13 +1829,13 @@ out_serverfault:
1829 goto out; 1829 goto out;
1830} 1830}
1831 1831
1832static int 1832static __be32
1833nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, 1833nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
1834 const char *name, int namlen, __be32 *p, int *buflen) 1834 const char *name, int namlen, __be32 *p, int *buflen)
1835{ 1835{
1836 struct svc_export *exp = cd->rd_fhp->fh_export; 1836 struct svc_export *exp = cd->rd_fhp->fh_export;
1837 struct dentry *dentry; 1837 struct dentry *dentry;
1838 int nfserr; 1838 __be32 nfserr;
1839 1839
1840 dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); 1840 dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
1841 if (IS_ERR(dentry)) 1841 if (IS_ERR(dentry))
@@ -1865,7 +1865,7 @@ out_put:
1865} 1865}
1866 1866
1867static __be32 * 1867static __be32 *
1868nfsd4_encode_rdattr_error(__be32 *p, int buflen, int nfserr) 1868nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr)
1869{ 1869{
1870 __be32 *attrlenp; 1870 __be32 *attrlenp;
1871 1871
@@ -1888,7 +1888,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
1888 struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common); 1888 struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
1889 int buflen; 1889 int buflen;
1890 __be32 *p = cd->buffer; 1890 __be32 *p = cd->buffer;
1891 int nfserr = nfserr_toosmall; 1891 __be32 nfserr = nfserr_toosmall;
1892 1892
1893 /* In nfsv4, "." and ".." never make it onto the wire.. */ 1893 /* In nfsv4, "." and ".." never make it onto the wire.. */
1894 if (name && isdotent(name, namlen)) { 1894 if (name && isdotent(name, namlen)) {
@@ -1944,7 +1944,7 @@ fail:
1944} 1944}
1945 1945
1946static void 1946static void
1947nfsd4_encode_access(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_access *access) 1947nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_access *access)
1948{ 1948{
1949 ENCODE_HEAD; 1949 ENCODE_HEAD;
1950 1950
@@ -1957,7 +1957,7 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_acc
1957} 1957}
1958 1958
1959static void 1959static void
1960nfsd4_encode_close(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_close *close) 1960nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close)
1961{ 1961{
1962 ENCODE_SEQID_OP_HEAD; 1962 ENCODE_SEQID_OP_HEAD;
1963 1963
@@ -1972,7 +1972,7 @@ nfsd4_encode_close(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_clos
1972 1972
1973 1973
1974static void 1974static void
1975nfsd4_encode_commit(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_commit *commit) 1975nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_commit *commit)
1976{ 1976{
1977 ENCODE_HEAD; 1977 ENCODE_HEAD;
1978 1978
@@ -1984,7 +1984,7 @@ nfsd4_encode_commit(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_com
1984} 1984}
1985 1985
1986static void 1986static void
1987nfsd4_encode_create(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_create *create) 1987nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_create *create)
1988{ 1988{
1989 ENCODE_HEAD; 1989 ENCODE_HEAD;
1990 1990
@@ -1998,8 +1998,8 @@ nfsd4_encode_create(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_cre
1998 } 1998 }
1999} 1999}
2000 2000
2001static int 2001static __be32
2002nfsd4_encode_getattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_getattr *getattr) 2002nfsd4_encode_getattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_getattr *getattr)
2003{ 2003{
2004 struct svc_fh *fhp = getattr->ga_fhp; 2004 struct svc_fh *fhp = getattr->ga_fhp;
2005 int buflen; 2005 int buflen;
@@ -2017,7 +2017,7 @@ nfsd4_encode_getattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_ge
2017} 2017}
2018 2018
2019static void 2019static void
2020nfsd4_encode_getfh(struct nfsd4_compoundres *resp, int nfserr, struct svc_fh *fhp) 2020nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh *fhp)
2021{ 2021{
2022 unsigned int len; 2022 unsigned int len;
2023 ENCODE_HEAD; 2023 ENCODE_HEAD;
@@ -2057,7 +2057,7 @@ nfsd4_encode_lock_denied(struct nfsd4_compoundres *resp, struct nfsd4_lock_denie
2057} 2057}
2058 2058
2059static void 2059static void
2060nfsd4_encode_lock(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock *lock) 2060nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lock *lock)
2061{ 2061{
2062 ENCODE_SEQID_OP_HEAD; 2062 ENCODE_SEQID_OP_HEAD;
2063 2063
@@ -2073,14 +2073,14 @@ nfsd4_encode_lock(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock
2073} 2073}
2074 2074
2075static void 2075static void
2076nfsd4_encode_lockt(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lockt *lockt) 2076nfsd4_encode_lockt(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lockt *lockt)
2077{ 2077{
2078 if (nfserr == nfserr_denied) 2078 if (nfserr == nfserr_denied)
2079 nfsd4_encode_lock_denied(resp, &lockt->lt_denied); 2079 nfsd4_encode_lock_denied(resp, &lockt->lt_denied);
2080} 2080}
2081 2081
2082static void 2082static void
2083nfsd4_encode_locku(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_locku *locku) 2083nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_locku *locku)
2084{ 2084{
2085 ENCODE_SEQID_OP_HEAD; 2085 ENCODE_SEQID_OP_HEAD;
2086 2086
@@ -2096,7 +2096,7 @@ nfsd4_encode_locku(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock
2096 2096
2097 2097
2098static void 2098static void
2099nfsd4_encode_link(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_link *link) 2099nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_link *link)
2100{ 2100{
2101 ENCODE_HEAD; 2101 ENCODE_HEAD;
2102 2102
@@ -2109,7 +2109,7 @@ nfsd4_encode_link(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_link
2109 2109
2110 2110
2111static void 2111static void
2112nfsd4_encode_open(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open *open) 2112nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open *open)
2113{ 2113{
2114 ENCODE_SEQID_OP_HEAD; 2114 ENCODE_SEQID_OP_HEAD;
2115 2115
@@ -2174,7 +2174,7 @@ out:
2174} 2174}
2175 2175
2176static void 2176static void
2177nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_confirm *oc) 2177nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_confirm *oc)
2178{ 2178{
2179 ENCODE_SEQID_OP_HEAD; 2179 ENCODE_SEQID_OP_HEAD;
2180 2180
@@ -2189,7 +2189,7 @@ nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfs
2189} 2189}
2190 2190
2191static void 2191static void
2192nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_downgrade *od) 2192nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_downgrade *od)
2193{ 2193{
2194 ENCODE_SEQID_OP_HEAD; 2194 ENCODE_SEQID_OP_HEAD;
2195 2195
@@ -2203,8 +2203,8 @@ nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, int nfserr, struct n
2203 ENCODE_SEQID_OP_TAIL(od->od_stateowner); 2203 ENCODE_SEQID_OP_TAIL(od->od_stateowner);
2204} 2204}
2205 2205
2206static int 2206static __be32
2207nfsd4_encode_read(struct nfsd4_compoundres *resp, int nfserr, 2207nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
2208 struct nfsd4_read *read) 2208 struct nfsd4_read *read)
2209{ 2209{
2210 u32 eof; 2210 u32 eof;
@@ -2268,8 +2268,8 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, int nfserr,
2268 return 0; 2268 return 0;
2269} 2269}
2270 2270
2271static int 2271static __be32
2272nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_readlink *readlink) 2272nfsd4_encode_readlink(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_readlink *readlink)
2273{ 2273{
2274 int maxcount; 2274 int maxcount;
2275 char *page; 2275 char *page;
@@ -2316,8 +2316,8 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_r
2316 return 0; 2316 return 0;
2317} 2317}
2318 2318
2319static int 2319static __be32
2320nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_readdir *readdir) 2320nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_readdir *readdir)
2321{ 2321{
2322 int maxcount; 2322 int maxcount;
2323 loff_t offset; 2323 loff_t offset;
@@ -2396,7 +2396,7 @@ err_no_verf:
2396} 2396}
2397 2397
2398static void 2398static void
2399nfsd4_encode_remove(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_remove *remove) 2399nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_remove *remove)
2400{ 2400{
2401 ENCODE_HEAD; 2401 ENCODE_HEAD;
2402 2402
@@ -2408,7 +2408,7 @@ nfsd4_encode_remove(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_rem
2408} 2408}
2409 2409
2410static void 2410static void
2411nfsd4_encode_rename(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_rename *rename) 2411nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_rename *rename)
2412{ 2412{
2413 ENCODE_HEAD; 2413 ENCODE_HEAD;
2414 2414
@@ -2425,7 +2425,7 @@ nfsd4_encode_rename(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_ren
2425 * regardless of the error status. 2425 * regardless of the error status.
2426 */ 2426 */
2427static void 2427static void
2428nfsd4_encode_setattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_setattr *setattr) 2428nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setattr *setattr)
2429{ 2429{
2430 ENCODE_HEAD; 2430 ENCODE_HEAD;
2431 2431
@@ -2444,7 +2444,7 @@ nfsd4_encode_setattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_se
2444} 2444}
2445 2445
2446static void 2446static void
2447nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_setclientid *scd) 2447nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setclientid *scd)
2448{ 2448{
2449 ENCODE_HEAD; 2449 ENCODE_HEAD;
2450 2450
@@ -2463,7 +2463,7 @@ nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, int nfserr, struct nfsd
2463} 2463}
2464 2464
2465static void 2465static void
2466nfsd4_encode_write(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_write *write) 2466nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_write *write)
2467{ 2467{
2468 ENCODE_HEAD; 2468 ENCODE_HEAD;
2469 2469
@@ -2641,7 +2641,7 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args)
2641int 2641int
2642nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args) 2642nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args)
2643{ 2643{
2644 int status; 2644 __be32 status;
2645 2645
2646 args->p = p; 2646 args->p = p;
2647 args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len; 2647 args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len;