aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/xdr4.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-20 02:28:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:40 -0400
commit52921e02a4f4163a7b1f4b5dde71e1debc71de4a (patch)
tree0202a8a4c8c78aed1826540fb33faf64a88837ce /fs/lockd/xdr4.c
parent7111c66e4e70588c9602035a4996c9cdc2087d2d (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.c80
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 */
47static u32 * 47static __be32 *
48nlm4_decode_cookie(u32 *p, struct nlm_cookie *c) 48nlm4_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
74static u32 * 74static __be32 *
75nlm4_encode_cookie(u32 *p, struct nlm_cookie *c) 75nlm4_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
83static u32 * 83static __be32 *
84nlm4_decode_fh(u32 *p, struct nfs_fh *f) 84nlm4_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
98static u32 * 98static __be32 *
99nlm4_encode_fh(u32 *p, struct nfs_fh *f) 99nlm4_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 */
110static u32 * 110static __be32 *
111nlm4_decode_oh(u32 *p, struct xdr_netobj *oh) 111nlm4_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
116static u32 * 116static __be32 *
117nlm4_encode_oh(u32 *p, struct xdr_netobj *oh) 117nlm4_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
122static u32 * 122static __be32 *
123nlm4_decode_lock(u32 *p, struct nlm_lock *lock) 123nlm4_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 */
156static u32 * 156static __be32 *
157nlm4_encode_lock(u32 *p, struct nlm_lock *lock) 157nlm4_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 */
188static u32 * 188static __be32 *
189nlm4_encode_testres(u32 *p, struct nlm_res *resp) 189nlm4_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 */
229int 229int
230nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 230nlm4svc_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
246int 246int
247nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 247nlm4svc_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
254int 254int
255nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 255nlm4svc_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
274int 274int
275nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 275nlm4svc_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
290int 290int
291nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 291nlm4svc_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
300int 300int
301nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 301nlm4svc_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
321int 321int
322nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 322nlm4svc_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
331int 331int
332nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 332nlm4svc_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
340int 340int
341nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) 341nlm4svc_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
352int 352int
353nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) 353nlm4svc_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
365int 365int
366nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 366nlm4svc_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
374int 374int
375nlm4svc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 375nlm4svc_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
380int 380int
381nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 381nlm4svc_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
390static int 390static int
391nlm4clt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr) 391nlm4clt_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
397static int 397static int
398nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 398nlm4clt_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
411static int 411static int
412nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 412nlm4clt_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
446static int 446static int
447nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 447nlm4clt_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
463static int 463static int
464nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 464nlm4clt_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
478static int 478static int
479nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 479nlm4clt_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
491static int 491static int
492nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 492nlm4clt_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
501static int 501static int
502nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 502nlm4clt_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
510static int 510static int
511nlm4clt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 511nlm4clt_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;