Commit c4d987ba841dff4b2fc768e52d1d95af83f9f157

Authored by Al Viro
Committed by Linus Torvalds
1 parent b37ad28bca

[PATCH] nfsd: NFSv{2,3} trivial endianness annotations for error values

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 4 changed files with 51 additions and 45 deletions Side-by-side Diff

... ... @@ -35,7 +35,7 @@
35 35 {
36 36 svc_fh *fh;
37 37 struct posix_acl *acl;
38   - int nfserr = 0;
  38 + __be32 nfserr = 0;
39 39  
40 40 dprintk("nfsd: GETACL(2acl) %s\n", SVCFH_fmt(&argp->fh));
41 41  
... ... @@ -102,7 +102,7 @@
102 102 struct nfsd_attrstat *resp)
103 103 {
104 104 svc_fh *fh;
105   - int nfserr = 0;
  105 + __be32 nfserr = 0;
106 106  
107 107 dprintk("nfsd: SETACL(2acl) %s\n", SVCFH_fmt(&argp->fh));
108 108  
... ... @@ -143,7 +143,7 @@
143 143 static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
144 144 struct nfsd3_accessres *resp)
145 145 {
146   - int nfserr;
  146 + __be32 nfserr;
147 147  
148 148 dprintk("nfsd: ACCESS(2acl) %s 0x%x\n",
149 149 SVCFH_fmt(&argp->fh),
... ... @@ -33,7 +33,7 @@
33 33 {
34 34 svc_fh *fh;
35 35 struct posix_acl *acl;
36   - int nfserr = 0;
  36 + __be32 nfserr = 0;
37 37  
38 38 fh = fh_copy(&resp->fh, &argp->fh);
39 39 if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP)))
... ... @@ -98,7 +98,7 @@
98 98 struct nfsd3_attrstat *resp)
99 99 {
100 100 svc_fh *fh;
101   - int nfserr = 0;
  101 + __be32 nfserr = 0;
102 102  
103 103 fh = fh_copy(&resp->fh, &argp->fh);
104 104 nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR);
... ... @@ -56,7 +56,8 @@
56 56 nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
57 57 struct nfsd3_attrstat *resp)
58 58 {
59   - int err, nfserr;
  59 + int err;
  60 + __be32 nfserr;
60 61  
61 62 dprintk("nfsd: GETATTR(3) %s\n",
62 63 SVCFH_fmt(&argp->fh));
... ... @@ -80,7 +81,7 @@
80 81 nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp,
81 82 struct nfsd3_attrstat *resp)
82 83 {
83   - int nfserr;
  84 + __be32 nfserr;
84 85  
85 86 dprintk("nfsd: SETATTR(3) %s\n",
86 87 SVCFH_fmt(&argp->fh));
... ... @@ -98,7 +99,7 @@
98 99 nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
99 100 struct nfsd3_diropres *resp)
100 101 {
101   - int nfserr;
  102 + __be32 nfserr;
102 103  
103 104 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
104 105 SVCFH_fmt(&argp->fh),
... ... @@ -122,7 +123,7 @@
122 123 nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
123 124 struct nfsd3_accessres *resp)
124 125 {
125   - int nfserr;
  126 + __be32 nfserr;
126 127  
127 128 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
128 129 SVCFH_fmt(&argp->fh),
... ... @@ -141,7 +142,7 @@
141 142 nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp,
142 143 struct nfsd3_readlinkres *resp)
143 144 {
144   - int nfserr;
  145 + __be32 nfserr;
145 146  
146 147 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
147 148  
... ... @@ -159,7 +160,7 @@
159 160 nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
160 161 struct nfsd3_readres *resp)
161 162 {
162   - int nfserr;
  163 + __be32 nfserr;
163 164 u32 max_blocksize = svc_max_payload(rqstp);
164 165  
165 166 dprintk("nfsd: READ(3) %s %lu bytes at %lu\n",
... ... @@ -199,7 +200,7 @@
199 200 nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
200 201 struct nfsd3_writeres *resp)
201 202 {
202   - int nfserr;
  203 + __be32 nfserr;
203 204  
204 205 dprintk("nfsd: WRITE(3) %s %d bytes at %ld%s\n",
205 206 SVCFH_fmt(&argp->fh),
... ... @@ -229,7 +230,7 @@
229 230 {
230 231 svc_fh *dirfhp, *newfhp = NULL;
231 232 struct iattr *attr;
232   - u32 nfserr;
  233 + __be32 nfserr;
233 234  
234 235 dprintk("nfsd: CREATE(3) %s %.*s\n",
235 236 SVCFH_fmt(&argp->fh),
... ... @@ -269,7 +270,7 @@
269 270 nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
270 271 struct nfsd3_diropres *resp)
271 272 {
272   - int nfserr;
  273 + __be32 nfserr;
273 274  
274 275 dprintk("nfsd: MKDIR(3) %s %.*s\n",
275 276 SVCFH_fmt(&argp->fh),
... ... @@ -289,7 +290,7 @@
289 290 nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
290 291 struct nfsd3_diropres *resp)
291 292 {
292   - int nfserr;
  293 + __be32 nfserr;
293 294  
294 295 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
295 296 SVCFH_fmt(&argp->ffh),
... ... @@ -311,7 +312,8 @@
311 312 nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
312 313 struct nfsd3_diropres *resp)
313 314 {
314   - int nfserr, type;
  315 + __be32 nfserr;
  316 + int type;
315 317 dev_t rdev = 0;
316 318  
317 319 dprintk("nfsd: MKNOD(3) %s %.*s\n",
... ... @@ -347,7 +349,7 @@
347 349 nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
348 350 struct nfsd3_attrstat *resp)
349 351 {
350   - int nfserr;
  352 + __be32 nfserr;
351 353  
352 354 dprintk("nfsd: REMOVE(3) %s %.*s\n",
353 355 SVCFH_fmt(&argp->fh),
... ... @@ -367,7 +369,7 @@
367 369 nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
368 370 struct nfsd3_attrstat *resp)
369 371 {
370   - int nfserr;
  372 + __be32 nfserr;
371 373  
372 374 dprintk("nfsd: RMDIR(3) %s %.*s\n",
373 375 SVCFH_fmt(&argp->fh),
... ... @@ -383,7 +385,7 @@
383 385 nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
384 386 struct nfsd3_renameres *resp)
385 387 {
386   - int nfserr;
  388 + __be32 nfserr;
387 389  
388 390 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
389 391 SVCFH_fmt(&argp->ffh),
... ... @@ -405,7 +407,7 @@
405 407 nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
406 408 struct nfsd3_linkres *resp)
407 409 {
408   - int nfserr;
  410 + __be32 nfserr;
409 411  
410 412 dprintk("nfsd: LINK(3) %s ->\n",
411 413 SVCFH_fmt(&argp->ffh));
... ... @@ -428,7 +430,8 @@
428 430 nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
429 431 struct nfsd3_readdirres *resp)
430 432 {
431   - int nfserr, count;
  433 + __be32 nfserr;
  434 + int count;
432 435  
433 436 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
434 437 SVCFH_fmt(&argp->fh),
... ... @@ -463,7 +466,8 @@
463 466 nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
464 467 struct nfsd3_readdirres *resp)
465 468 {
466   - int nfserr, count = 0;
  469 + __be32 nfserr;
  470 + int count = 0;
467 471 loff_t offset;
468 472 int i;
469 473 caddr_t page_addr = NULL;
... ... @@ -521,7 +525,7 @@
521 525 nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
522 526 struct nfsd3_fsstatres *resp)
523 527 {
524   - int nfserr;
  528 + __be32 nfserr;
525 529  
526 530 dprintk("nfsd: FSSTAT(3) %s\n",
527 531 SVCFH_fmt(&argp->fh));
... ... @@ -538,7 +542,7 @@
538 542 nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
539 543 struct nfsd3_fsinfores *resp)
540 544 {
541   - int nfserr;
  545 + __be32 nfserr;
542 546 u32 max_blocksize = svc_max_payload(rqstp);
543 547  
544 548 dprintk("nfsd: FSINFO(3) %s\n",
... ... @@ -580,7 +584,7 @@
580 584 nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
581 585 struct nfsd3_pathconfres *resp)
582 586 {
583   - int nfserr;
  587 + __be32 nfserr;
584 588  
585 589 dprintk("nfsd: PATHCONF(3) %s\n",
586 590 SVCFH_fmt(&argp->fh));
... ... @@ -623,7 +627,7 @@
623 627 nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp,
624 628 struct nfsd3_commitres *resp)
625 629 {
626   - int nfserr;
  630 + __be32 nfserr;
627 631  
628 632 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
629 633 SVCFH_fmt(&argp->fh),
... ... @@ -36,16 +36,16 @@
36 36 return nfs_ok;
37 37 }
38 38  
39   -static int
40   -nfsd_return_attrs(int err, struct nfsd_attrstat *resp)
  39 +static __be32
  40 +nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
41 41 {
42 42 if (err) return err;
43 43 return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
44 44 resp->fh.fh_dentry,
45 45 &resp->stat));
46 46 }
47   -static int
48   -nfsd_return_dirop(int err, struct nfsd_diropres *resp)
  47 +static __be32
  48 +nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
49 49 {
50 50 if (err) return err;
51 51 return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
... ... @@ -60,7 +60,7 @@
60 60 nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
61 61 struct nfsd_attrstat *resp)
62 62 {
63   - int nfserr;
  63 + __be32 nfserr;
64 64 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
65 65  
66 66 fh_copy(&resp->fh, &argp->fh);
... ... @@ -76,7 +76,7 @@
76 76 nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp,
77 77 struct nfsd_attrstat *resp)
78 78 {
79   - int nfserr;
  79 + __be32 nfserr;
80 80 dprintk("nfsd: SETATTR %s, valid=%x, size=%ld\n",
81 81 SVCFH_fmt(&argp->fh),
82 82 argp->attrs.ia_valid, (long) argp->attrs.ia_size);
... ... @@ -96,7 +96,7 @@
96 96 nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
97 97 struct nfsd_diropres *resp)
98 98 {
99   - int nfserr;
  99 + __be32 nfserr;
100 100  
101 101 dprintk("nfsd: LOOKUP %s %.*s\n",
102 102 SVCFH_fmt(&argp->fh), argp->len, argp->name);
... ... @@ -116,7 +116,7 @@
116 116 nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp,
117 117 struct nfsd_readlinkres *resp)
118 118 {
119   - int nfserr;
  119 + __be32 nfserr;
120 120  
121 121 dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
122 122  
... ... @@ -136,7 +136,7 @@
136 136 nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
137 137 struct nfsd_readres *resp)
138 138 {
139   - int nfserr;
  139 + __be32 nfserr;
140 140  
141 141 dprintk("nfsd: READ %s %d bytes at %d\n",
142 142 SVCFH_fmt(&argp->fh),
... ... @@ -176,7 +176,7 @@
176 176 nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
177 177 struct nfsd_attrstat *resp)
178 178 {
179   - int nfserr;
  179 + __be32 nfserr;
180 180 int stable = 1;
181 181  
182 182 dprintk("nfsd: WRITE %s %d bytes at %d\n",
... ... @@ -206,7 +206,8 @@
206 206 struct iattr *attr = &argp->attrs;
207 207 struct inode *inode;
208 208 struct dentry *dchild;
209   - int nfserr, type, mode;
  209 + int type, mode;
  210 + __be32 nfserr;
210 211 dev_t rdev = 0, wanted = new_decode_dev(attr->ia_size);
211 212  
212 213 dprintk("nfsd: CREATE %s %.*s\n",
... ... @@ -352,7 +353,7 @@
352 353 nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
353 354 void *resp)
354 355 {
355   - int nfserr;
  356 + __be32 nfserr;
356 357  
357 358 dprintk("nfsd: REMOVE %s %.*s\n", SVCFH_fmt(&argp->fh),
358 359 argp->len, argp->name);
... ... @@ -367,7 +368,7 @@
367 368 nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp,
368 369 void *resp)
369 370 {
370   - int nfserr;
  371 + __be32 nfserr;
371 372  
372 373 dprintk("nfsd: RENAME %s %.*s -> \n",
373 374 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname);
... ... @@ -385,7 +386,7 @@
385 386 nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp,
386 387 void *resp)
387 388 {
388   - int nfserr;
  389 + __be32 nfserr;
389 390  
390 391 dprintk("nfsd: LINK %s ->\n",
391 392 SVCFH_fmt(&argp->ffh));
... ... @@ -406,7 +407,7 @@
406 407 void *resp)
407 408 {
408 409 struct svc_fh newfh;
409   - int nfserr;
  410 + __be32 nfserr;
410 411  
411 412 dprintk("nfsd: SYMLINK %s %.*s -> %.*s\n",
412 413 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname,
... ... @@ -434,7 +435,7 @@
434 435 nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
435 436 struct nfsd_diropres *resp)
436 437 {
437   - int nfserr;
  438 + __be32 nfserr;
438 439  
439 440 dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
440 441  
... ... @@ -458,7 +459,7 @@
458 459 nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
459 460 void *resp)
460 461 {
461   - int nfserr;
  462 + __be32 nfserr;
462 463  
463 464 dprintk("nfsd: RMDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
464 465  
... ... @@ -474,7 +475,8 @@
474 475 nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
475 476 struct nfsd_readdirres *resp)
476 477 {
477   - int nfserr, count;
  478 + int count;
  479 + __be32 nfserr;
478 480 loff_t offset;
479 481  
480 482 dprintk("nfsd: READDIR %s %d bytes at %d\n",
... ... @@ -513,7 +515,7 @@
513 515 nfsd_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
514 516 struct nfsd_statfsres *resp)
515 517 {
516   - int nfserr;
  518 + __be32 nfserr;
517 519  
518 520 dprintk("nfsd: STATFS %s\n", SVCFH_fmt(&argp->fh));
519 521