diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-20 02:28:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:40 -0400 |
commit | 52921e02a4f4163a7b1f4b5dde71e1debc71de4a (patch) | |
tree | 0202a8a4c8c78aed1826540fb33faf64a88837ce /fs/lockd/xdr4.c | |
parent | 7111c66e4e70588c9602035a4996c9cdc2087d2d (diff) |
[PATCH] lockd endianness annotations
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
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/lockd/xdr4.c')
-rw-r--r-- | fs/lockd/xdr4.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c index 36eb175ec335..f4c0b2b9f75a 100644 --- a/fs/lockd/xdr4.c +++ b/fs/lockd/xdr4.c | |||
@@ -44,8 +44,8 @@ loff_t_to_s64(loff_t offset) | |||
44 | /* | 44 | /* |
45 | * XDR functions for basic NLM types | 45 | * XDR functions for basic NLM types |
46 | */ | 46 | */ |
47 | static u32 * | 47 | static __be32 * |
48 | nlm4_decode_cookie(u32 *p, struct nlm_cookie *c) | 48 | nlm4_decode_cookie(__be32 *p, struct nlm_cookie *c) |
49 | { | 49 | { |
50 | unsigned int len; | 50 | unsigned int len; |
51 | 51 | ||
@@ -71,8 +71,8 @@ nlm4_decode_cookie(u32 *p, struct nlm_cookie *c) | |||
71 | return p; | 71 | return p; |
72 | } | 72 | } |
73 | 73 | ||
74 | static u32 * | 74 | static __be32 * |
75 | nlm4_encode_cookie(u32 *p, struct nlm_cookie *c) | 75 | nlm4_encode_cookie(__be32 *p, struct nlm_cookie *c) |
76 | { | 76 | { |
77 | *p++ = htonl(c->len); | 77 | *p++ = htonl(c->len); |
78 | memcpy(p, c->data, c->len); | 78 | memcpy(p, c->data, c->len); |
@@ -80,8 +80,8 @@ nlm4_encode_cookie(u32 *p, struct nlm_cookie *c) | |||
80 | return p; | 80 | return p; |
81 | } | 81 | } |
82 | 82 | ||
83 | static u32 * | 83 | static __be32 * |
84 | nlm4_decode_fh(u32 *p, struct nfs_fh *f) | 84 | nlm4_decode_fh(__be32 *p, struct nfs_fh *f) |
85 | { | 85 | { |
86 | memset(f->data, 0, sizeof(f->data)); | 86 | memset(f->data, 0, sizeof(f->data)); |
87 | f->size = ntohl(*p++); | 87 | f->size = ntohl(*p++); |
@@ -95,8 +95,8 @@ nlm4_decode_fh(u32 *p, struct nfs_fh *f) | |||
95 | return p + XDR_QUADLEN(f->size); | 95 | return p + XDR_QUADLEN(f->size); |
96 | } | 96 | } |
97 | 97 | ||
98 | static u32 * | 98 | static __be32 * |
99 | nlm4_encode_fh(u32 *p, struct nfs_fh *f) | 99 | nlm4_encode_fh(__be32 *p, struct nfs_fh *f) |
100 | { | 100 | { |
101 | *p++ = htonl(f->size); | 101 | *p++ = htonl(f->size); |
102 | if (f->size) p[XDR_QUADLEN(f->size)-1] = 0; /* don't leak anything */ | 102 | if (f->size) p[XDR_QUADLEN(f->size)-1] = 0; /* don't leak anything */ |
@@ -107,20 +107,20 @@ nlm4_encode_fh(u32 *p, struct nfs_fh *f) | |||
107 | /* | 107 | /* |
108 | * Encode and decode owner handle | 108 | * Encode and decode owner handle |
109 | */ | 109 | */ |
110 | static u32 * | 110 | static __be32 * |
111 | nlm4_decode_oh(u32 *p, struct xdr_netobj *oh) | 111 | nlm4_decode_oh(__be32 *p, struct xdr_netobj *oh) |
112 | { | 112 | { |
113 | return xdr_decode_netobj(p, oh); | 113 | return xdr_decode_netobj(p, oh); |
114 | } | 114 | } |
115 | 115 | ||
116 | static u32 * | 116 | static __be32 * |
117 | nlm4_encode_oh(u32 *p, struct xdr_netobj *oh) | 117 | nlm4_encode_oh(__be32 *p, struct xdr_netobj *oh) |
118 | { | 118 | { |
119 | return xdr_encode_netobj(p, oh); | 119 | return xdr_encode_netobj(p, oh); |
120 | } | 120 | } |
121 | 121 | ||
122 | static u32 * | 122 | static __be32 * |
123 | nlm4_decode_lock(u32 *p, struct nlm_lock *lock) | 123 | nlm4_decode_lock(__be32 *p, struct nlm_lock *lock) |
124 | { | 124 | { |
125 | struct file_lock *fl = &lock->fl; | 125 | struct file_lock *fl = &lock->fl; |
126 | __s64 len, start, end; | 126 | __s64 len, start, end; |
@@ -153,8 +153,8 @@ nlm4_decode_lock(u32 *p, struct nlm_lock *lock) | |||
153 | /* | 153 | /* |
154 | * Encode a lock as part of an NLM call | 154 | * Encode a lock as part of an NLM call |
155 | */ | 155 | */ |
156 | static u32 * | 156 | static __be32 * |
157 | nlm4_encode_lock(u32 *p, struct nlm_lock *lock) | 157 | nlm4_encode_lock(__be32 *p, struct nlm_lock *lock) |
158 | { | 158 | { |
159 | struct file_lock *fl = &lock->fl; | 159 | struct file_lock *fl = &lock->fl; |
160 | __s64 start, len; | 160 | __s64 start, len; |
@@ -185,8 +185,8 @@ nlm4_encode_lock(u32 *p, struct nlm_lock *lock) | |||
185 | /* | 185 | /* |
186 | * Encode result of a TEST/TEST_MSG call | 186 | * Encode result of a TEST/TEST_MSG call |
187 | */ | 187 | */ |
188 | static u32 * | 188 | static __be32 * |
189 | nlm4_encode_testres(u32 *p, struct nlm_res *resp) | 189 | nlm4_encode_testres(__be32 *p, struct nlm_res *resp) |
190 | { | 190 | { |
191 | s64 start, len; | 191 | s64 start, len; |
192 | 192 | ||
@@ -227,7 +227,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp) | |||
227 | * First, the server side XDR functions | 227 | * First, the server side XDR functions |
228 | */ | 228 | */ |
229 | int | 229 | int |
230 | nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 230 | nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
231 | { | 231 | { |
232 | u32 exclusive; | 232 | u32 exclusive; |
233 | 233 | ||
@@ -244,7 +244,7 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | int | 246 | int |
247 | nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 247 | nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
248 | { | 248 | { |
249 | if (!(p = nlm4_encode_testres(p, resp))) | 249 | if (!(p = nlm4_encode_testres(p, resp))) |
250 | return 0; | 250 | return 0; |
@@ -252,7 +252,7 @@ nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | int | 254 | int |
255 | nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 255 | nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
256 | { | 256 | { |
257 | u32 exclusive; | 257 | u32 exclusive; |
258 | 258 | ||
@@ -272,7 +272,7 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
272 | } | 272 | } |
273 | 273 | ||
274 | int | 274 | int |
275 | nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 275 | nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
276 | { | 276 | { |
277 | u32 exclusive; | 277 | u32 exclusive; |
278 | 278 | ||
@@ -288,7 +288,7 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
288 | } | 288 | } |
289 | 289 | ||
290 | int | 290 | int |
291 | nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 291 | nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
292 | { | 292 | { |
293 | if (!(p = nlm4_decode_cookie(p, &argp->cookie)) | 293 | if (!(p = nlm4_decode_cookie(p, &argp->cookie)) |
294 | || !(p = nlm4_decode_lock(p, &argp->lock))) | 294 | || !(p = nlm4_decode_lock(p, &argp->lock))) |
@@ -298,7 +298,7 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
298 | } | 298 | } |
299 | 299 | ||
300 | int | 300 | int |
301 | nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 301 | nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
302 | { | 302 | { |
303 | struct nlm_lock *lock = &argp->lock; | 303 | struct nlm_lock *lock = &argp->lock; |
304 | 304 | ||
@@ -319,7 +319,7 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
319 | } | 319 | } |
320 | 320 | ||
321 | int | 321 | int |
322 | nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 322 | nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
323 | { | 323 | { |
324 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) | 324 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) |
325 | return 0; | 325 | return 0; |
@@ -329,7 +329,7 @@ nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
329 | } | 329 | } |
330 | 330 | ||
331 | int | 331 | int |
332 | nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 332 | nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
333 | { | 333 | { |
334 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) | 334 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) |
335 | return 0; | 335 | return 0; |
@@ -338,7 +338,7 @@ nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | int | 340 | int |
341 | nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) | 341 | nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp) |
342 | { | 342 | { |
343 | struct nlm_lock *lock = &argp->lock; | 343 | struct nlm_lock *lock = &argp->lock; |
344 | 344 | ||
@@ -350,7 +350,7 @@ nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) | |||
350 | } | 350 | } |
351 | 351 | ||
352 | int | 352 | int |
353 | nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) | 353 | nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp) |
354 | { | 354 | { |
355 | if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) | 355 | if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) |
356 | return 0; | 356 | return 0; |
@@ -363,7 +363,7 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | int | 365 | int |
366 | nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 366 | nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
367 | { | 367 | { |
368 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) | 368 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) |
369 | return 0; | 369 | return 0; |
@@ -372,13 +372,13 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
372 | } | 372 | } |
373 | 373 | ||
374 | int | 374 | int |
375 | nlm4svc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 375 | nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
376 | { | 376 | { |
377 | return xdr_argsize_check(rqstp, p); | 377 | return xdr_argsize_check(rqstp, p); |
378 | } | 378 | } |
379 | 379 | ||
380 | int | 380 | int |
381 | nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 381 | nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
382 | { | 382 | { |
383 | return xdr_ressize_check(rqstp, p); | 383 | return xdr_ressize_check(rqstp, p); |
384 | } | 384 | } |
@@ -388,14 +388,14 @@ nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | |||
388 | */ | 388 | */ |
389 | #ifdef NLMCLNT_SUPPORT_SHARES | 389 | #ifdef NLMCLNT_SUPPORT_SHARES |
390 | static int | 390 | static int |
391 | nlm4clt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr) | 391 | nlm4clt_decode_void(struct rpc_rqst *req, __be32 *p, void *ptr) |
392 | { | 392 | { |
393 | return 0; | 393 | return 0; |
394 | } | 394 | } |
395 | #endif | 395 | #endif |
396 | 396 | ||
397 | static int | 397 | static int |
398 | nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 398 | nlm4clt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
399 | { | 399 | { |
400 | struct nlm_lock *lock = &argp->lock; | 400 | struct nlm_lock *lock = &argp->lock; |
401 | 401 | ||
@@ -409,7 +409,7 @@ nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
409 | } | 409 | } |
410 | 410 | ||
411 | static int | 411 | static int |
412 | nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 412 | nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
413 | { | 413 | { |
414 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) | 414 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) |
415 | return -EIO; | 415 | return -EIO; |
@@ -444,7 +444,7 @@ nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
444 | 444 | ||
445 | 445 | ||
446 | static int | 446 | static int |
447 | nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 447 | nlm4clt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
448 | { | 448 | { |
449 | struct nlm_lock *lock = &argp->lock; | 449 | struct nlm_lock *lock = &argp->lock; |
450 | 450 | ||
@@ -461,7 +461,7 @@ nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
461 | } | 461 | } |
462 | 462 | ||
463 | static int | 463 | static int |
464 | nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 464 | nlm4clt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
465 | { | 465 | { |
466 | struct nlm_lock *lock = &argp->lock; | 466 | struct nlm_lock *lock = &argp->lock; |
467 | 467 | ||
@@ -476,7 +476,7 @@ nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
476 | } | 476 | } |
477 | 477 | ||
478 | static int | 478 | static int |
479 | nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 479 | nlm4clt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
480 | { | 480 | { |
481 | struct nlm_lock *lock = &argp->lock; | 481 | struct nlm_lock *lock = &argp->lock; |
482 | 482 | ||
@@ -489,7 +489,7 @@ nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
489 | } | 489 | } |
490 | 490 | ||
491 | static int | 491 | static int |
492 | nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 492 | nlm4clt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
493 | { | 493 | { |
494 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) | 494 | if (!(p = nlm4_encode_cookie(p, &resp->cookie))) |
495 | return -EIO; | 495 | return -EIO; |
@@ -499,7 +499,7 @@ nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
499 | } | 499 | } |
500 | 500 | ||
501 | static int | 501 | static int |
502 | nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 502 | nlm4clt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
503 | { | 503 | { |
504 | if (!(p = nlm4_encode_testres(p, resp))) | 504 | if (!(p = nlm4_encode_testres(p, resp))) |
505 | return -EIO; | 505 | return -EIO; |
@@ -508,7 +508,7 @@ nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
508 | } | 508 | } |
509 | 509 | ||
510 | static int | 510 | static int |
511 | nlm4clt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 511 | nlm4clt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
512 | { | 512 | { |
513 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) | 513 | if (!(p = nlm4_decode_cookie(p, &resp->cookie))) |
514 | return -EIO; | 514 | return -EIO; |