diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-20 02:28:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:41 -0400 |
commit | 131a21c2177c267ab259fcd06947c6f593a7de8e (patch) | |
tree | 7841d3c58e3dfc103fefb895e43bac0f5afbd751 /fs/nfsd/nfsxdr.c | |
parent | ad451d389f46f699832da3e9ad95f610cb8c0fd2 (diff) |
[PATCH] xdr annotations: NFSv2 server
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>
Diffstat (limited to 'fs/nfsd/nfsxdr.c')
-rw-r--r-- | fs/nfsd/nfsxdr.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 1135c0d14557..56ebb1443e0e 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -37,8 +37,8 @@ static u32 nfs_ftypes[] = { | |||
37 | /* | 37 | /* |
38 | * XDR functions for basic NFS types | 38 | * XDR functions for basic NFS types |
39 | */ | 39 | */ |
40 | static u32 * | 40 | static __be32 * |
41 | decode_fh(u32 *p, struct svc_fh *fhp) | 41 | decode_fh(__be32 *p, struct svc_fh *fhp) |
42 | { | 42 | { |
43 | fh_init(fhp, NFS_FHSIZE); | 43 | fh_init(fhp, NFS_FHSIZE); |
44 | memcpy(&fhp->fh_handle.fh_base, p, NFS_FHSIZE); | 44 | memcpy(&fhp->fh_handle.fh_base, p, NFS_FHSIZE); |
@@ -50,13 +50,13 @@ decode_fh(u32 *p, struct svc_fh *fhp) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | /* Helper function for NFSv2 ACL code */ | 52 | /* Helper function for NFSv2 ACL code */ |
53 | u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp) | 53 | __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp) |
54 | { | 54 | { |
55 | return decode_fh(p, fhp); | 55 | return decode_fh(p, fhp); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline u32 * | 58 | static inline __be32 * |
59 | encode_fh(u32 *p, struct svc_fh *fhp) | 59 | encode_fh(__be32 *p, struct svc_fh *fhp) |
60 | { | 60 | { |
61 | memcpy(p, &fhp->fh_handle.fh_base, NFS_FHSIZE); | 61 | memcpy(p, &fhp->fh_handle.fh_base, NFS_FHSIZE); |
62 | return p + (NFS_FHSIZE>> 2); | 62 | return p + (NFS_FHSIZE>> 2); |
@@ -66,8 +66,8 @@ encode_fh(u32 *p, struct svc_fh *fhp) | |||
66 | * Decode a file name and make sure that the path contains | 66 | * Decode a file name and make sure that the path contains |
67 | * no slashes or null bytes. | 67 | * no slashes or null bytes. |
68 | */ | 68 | */ |
69 | static inline u32 * | 69 | static inline __be32 * |
70 | decode_filename(u32 *p, char **namp, int *lenp) | 70 | decode_filename(__be32 *p, char **namp, int *lenp) |
71 | { | 71 | { |
72 | char *name; | 72 | char *name; |
73 | int i; | 73 | int i; |
@@ -82,8 +82,8 @@ decode_filename(u32 *p, char **namp, int *lenp) | |||
82 | return p; | 82 | return p; |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline u32 * | 85 | static inline __be32 * |
86 | decode_pathname(u32 *p, char **namp, int *lenp) | 86 | decode_pathname(__be32 *p, char **namp, int *lenp) |
87 | { | 87 | { |
88 | char *name; | 88 | char *name; |
89 | int i; | 89 | int i; |
@@ -98,8 +98,8 @@ decode_pathname(u32 *p, char **namp, int *lenp) | |||
98 | return p; | 98 | return p; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline u32 * | 101 | static inline __be32 * |
102 | decode_sattr(u32 *p, struct iattr *iap) | 102 | decode_sattr(__be32 *p, struct iattr *iap) |
103 | { | 103 | { |
104 | u32 tmp, tmp1; | 104 | u32 tmp, tmp1; |
105 | 105 | ||
@@ -151,8 +151,8 @@ decode_sattr(u32 *p, struct iattr *iap) | |||
151 | return p; | 151 | return p; |
152 | } | 152 | } |
153 | 153 | ||
154 | static u32 * | 154 | static __be32 * |
155 | encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp, | 155 | encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, |
156 | struct kstat *stat) | 156 | struct kstat *stat) |
157 | { | 157 | { |
158 | struct dentry *dentry = fhp->fh_dentry; | 158 | struct dentry *dentry = fhp->fh_dentry; |
@@ -195,7 +195,7 @@ encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp, | |||
195 | } | 195 | } |
196 | 196 | ||
197 | /* Helper function for NFSv2 ACL code */ | 197 | /* Helper function for NFSv2 ACL code */ |
198 | u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp) | 198 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) |
199 | { | 199 | { |
200 | struct kstat stat; | 200 | struct kstat stat; |
201 | vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, &stat); | 201 | vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, &stat); |
@@ -206,13 +206,13 @@ u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp) | |||
206 | * XDR decode functions | 206 | * XDR decode functions |
207 | */ | 207 | */ |
208 | int | 208 | int |
209 | nfssvc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 209 | nfssvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
210 | { | 210 | { |
211 | return xdr_argsize_check(rqstp, p); | 211 | return xdr_argsize_check(rqstp, p); |
212 | } | 212 | } |
213 | 213 | ||
214 | int | 214 | int |
215 | nfssvc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args) | 215 | nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args) |
216 | { | 216 | { |
217 | if (!(p = decode_fh(p, &args->fh))) | 217 | if (!(p = decode_fh(p, &args->fh))) |
218 | return 0; | 218 | return 0; |
@@ -220,7 +220,7 @@ nfssvc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args) | |||
220 | } | 220 | } |
221 | 221 | ||
222 | int | 222 | int |
223 | nfssvc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p, | 223 | nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p, |
224 | struct nfsd_sattrargs *args) | 224 | struct nfsd_sattrargs *args) |
225 | { | 225 | { |
226 | if (!(p = decode_fh(p, &args->fh)) | 226 | if (!(p = decode_fh(p, &args->fh)) |
@@ -231,7 +231,7 @@ nfssvc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p, | |||
231 | } | 231 | } |
232 | 232 | ||
233 | int | 233 | int |
234 | nfssvc_decode_diropargs(struct svc_rqst *rqstp, u32 *p, | 234 | nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p, |
235 | struct nfsd_diropargs *args) | 235 | struct nfsd_diropargs *args) |
236 | { | 236 | { |
237 | if (!(p = decode_fh(p, &args->fh)) | 237 | if (!(p = decode_fh(p, &args->fh)) |
@@ -242,7 +242,7 @@ nfssvc_decode_diropargs(struct svc_rqst *rqstp, u32 *p, | |||
242 | } | 242 | } |
243 | 243 | ||
244 | int | 244 | int |
245 | nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p, | 245 | nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p, |
246 | struct nfsd_readargs *args) | 246 | struct nfsd_readargs *args) |
247 | { | 247 | { |
248 | unsigned int len; | 248 | unsigned int len; |
@@ -273,7 +273,7 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p, | |||
273 | } | 273 | } |
274 | 274 | ||
275 | int | 275 | int |
276 | nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p, | 276 | nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, |
277 | struct nfsd_writeargs *args) | 277 | struct nfsd_writeargs *args) |
278 | { | 278 | { |
279 | unsigned int len; | 279 | unsigned int len; |
@@ -303,7 +303,7 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p, | |||
303 | } | 303 | } |
304 | 304 | ||
305 | int | 305 | int |
306 | nfssvc_decode_createargs(struct svc_rqst *rqstp, u32 *p, | 306 | nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, |
307 | struct nfsd_createargs *args) | 307 | struct nfsd_createargs *args) |
308 | { | 308 | { |
309 | if (!(p = decode_fh(p, &args->fh)) | 309 | if (!(p = decode_fh(p, &args->fh)) |
@@ -315,7 +315,7 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, u32 *p, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | int | 317 | int |
318 | nfssvc_decode_renameargs(struct svc_rqst *rqstp, u32 *p, | 318 | nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, |
319 | struct nfsd_renameargs *args) | 319 | struct nfsd_renameargs *args) |
320 | { | 320 | { |
321 | if (!(p = decode_fh(p, &args->ffh)) | 321 | if (!(p = decode_fh(p, &args->ffh)) |
@@ -328,7 +328,7 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, u32 *p, | |||
328 | } | 328 | } |
329 | 329 | ||
330 | int | 330 | int |
331 | nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p, struct nfsd_readlinkargs *args) | 331 | nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readlinkargs *args) |
332 | { | 332 | { |
333 | if (!(p = decode_fh(p, &args->fh))) | 333 | if (!(p = decode_fh(p, &args->fh))) |
334 | return 0; | 334 | return 0; |
@@ -338,7 +338,7 @@ nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p, struct nfsd_readlinka | |||
338 | } | 338 | } |
339 | 339 | ||
340 | int | 340 | int |
341 | nfssvc_decode_linkargs(struct svc_rqst *rqstp, u32 *p, | 341 | nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, |
342 | struct nfsd_linkargs *args) | 342 | struct nfsd_linkargs *args) |
343 | { | 343 | { |
344 | if (!(p = decode_fh(p, &args->ffh)) | 344 | if (!(p = decode_fh(p, &args->ffh)) |
@@ -350,7 +350,7 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, u32 *p, | |||
350 | } | 350 | } |
351 | 351 | ||
352 | int | 352 | int |
353 | nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p, | 353 | nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, |
354 | struct nfsd_symlinkargs *args) | 354 | struct nfsd_symlinkargs *args) |
355 | { | 355 | { |
356 | if (!(p = decode_fh(p, &args->ffh)) | 356 | if (!(p = decode_fh(p, &args->ffh)) |
@@ -363,7 +363,7 @@ nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p, | |||
363 | } | 363 | } |
364 | 364 | ||
365 | int | 365 | int |
366 | nfssvc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p, | 366 | nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, |
367 | struct nfsd_readdirargs *args) | 367 | struct nfsd_readdirargs *args) |
368 | { | 368 | { |
369 | if (!(p = decode_fh(p, &args->fh))) | 369 | if (!(p = decode_fh(p, &args->fh))) |
@@ -382,13 +382,13 @@ nfssvc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p, | |||
382 | * XDR encode functions | 382 | * XDR encode functions |
383 | */ | 383 | */ |
384 | int | 384 | int |
385 | nfssvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 385 | nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
386 | { | 386 | { |
387 | return xdr_ressize_check(rqstp, p); | 387 | return xdr_ressize_check(rqstp, p); |
388 | } | 388 | } |
389 | 389 | ||
390 | int | 390 | int |
391 | nfssvc_encode_attrstat(struct svc_rqst *rqstp, u32 *p, | 391 | nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, |
392 | struct nfsd_attrstat *resp) | 392 | struct nfsd_attrstat *resp) |
393 | { | 393 | { |
394 | p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); | 394 | p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); |
@@ -396,7 +396,7 @@ nfssvc_encode_attrstat(struct svc_rqst *rqstp, u32 *p, | |||
396 | } | 396 | } |
397 | 397 | ||
398 | int | 398 | int |
399 | nfssvc_encode_diropres(struct svc_rqst *rqstp, u32 *p, | 399 | nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, |
400 | struct nfsd_diropres *resp) | 400 | struct nfsd_diropres *resp) |
401 | { | 401 | { |
402 | p = encode_fh(p, &resp->fh); | 402 | p = encode_fh(p, &resp->fh); |
@@ -405,7 +405,7 @@ nfssvc_encode_diropres(struct svc_rqst *rqstp, u32 *p, | |||
405 | } | 405 | } |
406 | 406 | ||
407 | int | 407 | int |
408 | nfssvc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p, | 408 | nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, |
409 | struct nfsd_readlinkres *resp) | 409 | struct nfsd_readlinkres *resp) |
410 | { | 410 | { |
411 | *p++ = htonl(resp->len); | 411 | *p++ = htonl(resp->len); |
@@ -421,7 +421,7 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p, | |||
421 | } | 421 | } |
422 | 422 | ||
423 | int | 423 | int |
424 | nfssvc_encode_readres(struct svc_rqst *rqstp, u32 *p, | 424 | nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, |
425 | struct nfsd_readres *resp) | 425 | struct nfsd_readres *resp) |
426 | { | 426 | { |
427 | p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); | 427 | p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); |
@@ -440,7 +440,7 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, u32 *p, | |||
440 | } | 440 | } |
441 | 441 | ||
442 | int | 442 | int |
443 | nfssvc_encode_readdirres(struct svc_rqst *rqstp, u32 *p, | 443 | nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, |
444 | struct nfsd_readdirres *resp) | 444 | struct nfsd_readdirres *resp) |
445 | { | 445 | { |
446 | xdr_ressize_check(rqstp, p); | 446 | xdr_ressize_check(rqstp, p); |
@@ -453,7 +453,7 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, u32 *p, | |||
453 | } | 453 | } |
454 | 454 | ||
455 | int | 455 | int |
456 | nfssvc_encode_statfsres(struct svc_rqst *rqstp, u32 *p, | 456 | nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p, |
457 | struct nfsd_statfsres *resp) | 457 | struct nfsd_statfsres *resp) |
458 | { | 458 | { |
459 | struct kstatfs *stat = &resp->stats; | 459 | struct kstatfs *stat = &resp->stats; |
@@ -471,7 +471,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name, | |||
471 | int namlen, loff_t offset, ino_t ino, unsigned int d_type) | 471 | int namlen, loff_t offset, ino_t ino, unsigned int d_type) |
472 | { | 472 | { |
473 | struct nfsd_readdirres *cd = container_of(ccd, struct nfsd_readdirres, common); | 473 | struct nfsd_readdirres *cd = container_of(ccd, struct nfsd_readdirres, common); |
474 | u32 *p = cd->buffer; | 474 | __be32 *p = cd->buffer; |
475 | int buflen, slen; | 475 | int buflen, slen; |
476 | 476 | ||
477 | /* | 477 | /* |
@@ -497,7 +497,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name, | |||
497 | *p++ = htonl((u32) ino); /* file id */ | 497 | *p++ = htonl((u32) ino); /* file id */ |
498 | p = xdr_encode_array(p, name, namlen);/* name length & name */ | 498 | p = xdr_encode_array(p, name, namlen);/* name length & name */ |
499 | cd->offset = p; /* remember pointer */ | 499 | cd->offset = p; /* remember pointer */ |
500 | *p++ = ~(u32) 0; /* offset of next entry */ | 500 | *p++ = htonl(~0U); /* offset of next entry */ |
501 | 501 | ||
502 | cd->buflen = buflen; | 502 | cd->buflen = buflen; |
503 | cd->buffer = p; | 503 | cd->buffer = p; |
@@ -509,7 +509,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name, | |||
509 | * XDR release functions | 509 | * XDR release functions |
510 | */ | 510 | */ |
511 | int | 511 | int |
512 | nfssvc_release_fhandle(struct svc_rqst *rqstp, u32 *p, | 512 | nfssvc_release_fhandle(struct svc_rqst *rqstp, __be32 *p, |
513 | struct nfsd_fhandle *resp) | 513 | struct nfsd_fhandle *resp) |
514 | { | 514 | { |
515 | fh_put(&resp->fh); | 515 | fh_put(&resp->fh); |