diff options
Diffstat (limited to 'fs/lockd/xdr.c')
-rw-r--r-- | fs/lockd/xdr.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c index 61c46facf257..b7c949256e5a 100644 --- a/fs/lockd/xdr.c +++ b/fs/lockd/xdr.c | |||
@@ -43,7 +43,7 @@ loff_t_to_s32(loff_t offset) | |||
43 | /* | 43 | /* |
44 | * XDR functions for basic NLM types | 44 | * XDR functions for basic NLM types |
45 | */ | 45 | */ |
46 | static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c) | 46 | static __be32 *nlm_decode_cookie(__be32 *p, struct nlm_cookie *c) |
47 | { | 47 | { |
48 | unsigned int len; | 48 | unsigned int len; |
49 | 49 | ||
@@ -69,8 +69,8 @@ static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c) | |||
69 | return p; | 69 | return p; |
70 | } | 70 | } |
71 | 71 | ||
72 | static inline u32 * | 72 | static inline __be32 * |
73 | nlm_encode_cookie(u32 *p, struct nlm_cookie *c) | 73 | nlm_encode_cookie(__be32 *p, struct nlm_cookie *c) |
74 | { | 74 | { |
75 | *p++ = htonl(c->len); | 75 | *p++ = htonl(c->len); |
76 | memcpy(p, c->data, c->len); | 76 | memcpy(p, c->data, c->len); |
@@ -78,8 +78,8 @@ nlm_encode_cookie(u32 *p, struct nlm_cookie *c) | |||
78 | return p; | 78 | return p; |
79 | } | 79 | } |
80 | 80 | ||
81 | static u32 * | 81 | static __be32 * |
82 | nlm_decode_fh(u32 *p, struct nfs_fh *f) | 82 | nlm_decode_fh(__be32 *p, struct nfs_fh *f) |
83 | { | 83 | { |
84 | unsigned int len; | 84 | unsigned int len; |
85 | 85 | ||
@@ -95,8 +95,8 @@ nlm_decode_fh(u32 *p, struct nfs_fh *f) | |||
95 | return p + XDR_QUADLEN(NFS2_FHSIZE); | 95 | return p + XDR_QUADLEN(NFS2_FHSIZE); |
96 | } | 96 | } |
97 | 97 | ||
98 | static inline u32 * | 98 | static inline __be32 * |
99 | nlm_encode_fh(u32 *p, struct nfs_fh *f) | 99 | nlm_encode_fh(__be32 *p, struct nfs_fh *f) |
100 | { | 100 | { |
101 | *p++ = htonl(NFS2_FHSIZE); | 101 | *p++ = htonl(NFS2_FHSIZE); |
102 | memcpy(p, f->data, NFS2_FHSIZE); | 102 | memcpy(p, f->data, NFS2_FHSIZE); |
@@ -106,20 +106,20 @@ nlm_encode_fh(u32 *p, struct nfs_fh *f) | |||
106 | /* | 106 | /* |
107 | * Encode and decode owner handle | 107 | * Encode and decode owner handle |
108 | */ | 108 | */ |
109 | static inline u32 * | 109 | static inline __be32 * |
110 | nlm_decode_oh(u32 *p, struct xdr_netobj *oh) | 110 | nlm_decode_oh(__be32 *p, struct xdr_netobj *oh) |
111 | { | 111 | { |
112 | return xdr_decode_netobj(p, oh); | 112 | return xdr_decode_netobj(p, oh); |
113 | } | 113 | } |
114 | 114 | ||
115 | static inline u32 * | 115 | static inline __be32 * |
116 | nlm_encode_oh(u32 *p, struct xdr_netobj *oh) | 116 | nlm_encode_oh(__be32 *p, struct xdr_netobj *oh) |
117 | { | 117 | { |
118 | return xdr_encode_netobj(p, oh); | 118 | return xdr_encode_netobj(p, oh); |
119 | } | 119 | } |
120 | 120 | ||
121 | static u32 * | 121 | static __be32 * |
122 | nlm_decode_lock(u32 *p, struct nlm_lock *lock) | 122 | nlm_decode_lock(__be32 *p, struct nlm_lock *lock) |
123 | { | 123 | { |
124 | struct file_lock *fl = &lock->fl; | 124 | struct file_lock *fl = &lock->fl; |
125 | s32 start, len, end; | 125 | s32 start, len, end; |
@@ -153,8 +153,8 @@ nlm_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 | nlm_encode_lock(u32 *p, struct nlm_lock *lock) | 157 | nlm_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 | __s32 start, len; | 160 | __s32 start, len; |
@@ -184,8 +184,8 @@ nlm_encode_lock(u32 *p, struct nlm_lock *lock) | |||
184 | /* | 184 | /* |
185 | * Encode result of a TEST/TEST_MSG call | 185 | * Encode result of a TEST/TEST_MSG call |
186 | */ | 186 | */ |
187 | static u32 * | 187 | static __be32 * |
188 | nlm_encode_testres(u32 *p, struct nlm_res *resp) | 188 | nlm_encode_testres(__be32 *p, struct nlm_res *resp) |
189 | { | 189 | { |
190 | s32 start, len; | 190 | s32 start, len; |
191 | 191 | ||
@@ -221,7 +221,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp) | |||
221 | * First, the server side XDR functions | 221 | * First, the server side XDR functions |
222 | */ | 222 | */ |
223 | int | 223 | int |
224 | nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 224 | nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
225 | { | 225 | { |
226 | u32 exclusive; | 226 | u32 exclusive; |
227 | 227 | ||
@@ -238,7 +238,7 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | int | 240 | int |
241 | nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 241 | nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
242 | { | 242 | { |
243 | if (!(p = nlm_encode_testres(p, resp))) | 243 | if (!(p = nlm_encode_testres(p, resp))) |
244 | return 0; | 244 | return 0; |
@@ -246,7 +246,7 @@ nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
246 | } | 246 | } |
247 | 247 | ||
248 | int | 248 | int |
249 | nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 249 | nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
250 | { | 250 | { |
251 | u32 exclusive; | 251 | u32 exclusive; |
252 | 252 | ||
@@ -266,7 +266,7 @@ nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
266 | } | 266 | } |
267 | 267 | ||
268 | int | 268 | int |
269 | nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 269 | nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
270 | { | 270 | { |
271 | u32 exclusive; | 271 | u32 exclusive; |
272 | 272 | ||
@@ -282,7 +282,7 @@ nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
282 | } | 282 | } |
283 | 283 | ||
284 | int | 284 | int |
285 | nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 285 | nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
286 | { | 286 | { |
287 | if (!(p = nlm_decode_cookie(p, &argp->cookie)) | 287 | if (!(p = nlm_decode_cookie(p, &argp->cookie)) |
288 | || !(p = nlm_decode_lock(p, &argp->lock))) | 288 | || !(p = nlm_decode_lock(p, &argp->lock))) |
@@ -292,7 +292,7 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
292 | } | 292 | } |
293 | 293 | ||
294 | int | 294 | int |
295 | nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | 295 | nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) |
296 | { | 296 | { |
297 | struct nlm_lock *lock = &argp->lock; | 297 | struct nlm_lock *lock = &argp->lock; |
298 | 298 | ||
@@ -313,7 +313,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) | |||
313 | } | 313 | } |
314 | 314 | ||
315 | int | 315 | int |
316 | nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 316 | nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
317 | { | 317 | { |
318 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) | 318 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) |
319 | return 0; | 319 | return 0; |
@@ -323,7 +323,7 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
323 | } | 323 | } |
324 | 324 | ||
325 | int | 325 | int |
326 | nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 326 | nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
327 | { | 327 | { |
328 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) | 328 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) |
329 | return 0; | 329 | return 0; |
@@ -332,7 +332,7 @@ nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
332 | } | 332 | } |
333 | 333 | ||
334 | int | 334 | int |
335 | nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) | 335 | nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp) |
336 | { | 336 | { |
337 | struct nlm_lock *lock = &argp->lock; | 337 | struct nlm_lock *lock = &argp->lock; |
338 | 338 | ||
@@ -344,7 +344,7 @@ nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) | |||
344 | } | 344 | } |
345 | 345 | ||
346 | int | 346 | int |
347 | nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) | 347 | nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp) |
348 | { | 348 | { |
349 | if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) | 349 | if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) |
350 | return 0; | 350 | return 0; |
@@ -357,7 +357,7 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) | |||
357 | } | 357 | } |
358 | 358 | ||
359 | int | 359 | int |
360 | nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | 360 | nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) |
361 | { | 361 | { |
362 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) | 362 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) |
363 | return 0; | 363 | return 0; |
@@ -366,13 +366,13 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) | |||
366 | } | 366 | } |
367 | 367 | ||
368 | int | 368 | int |
369 | nlmsvc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 369 | nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
370 | { | 370 | { |
371 | return xdr_argsize_check(rqstp, p); | 371 | return xdr_argsize_check(rqstp, p); |
372 | } | 372 | } |
373 | 373 | ||
374 | int | 374 | int |
375 | nlmsvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) | 375 | nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
376 | { | 376 | { |
377 | return xdr_ressize_check(rqstp, p); | 377 | return xdr_ressize_check(rqstp, p); |
378 | } | 378 | } |
@@ -389,7 +389,7 @@ nlmclt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr) | |||
389 | #endif | 389 | #endif |
390 | 390 | ||
391 | static int | 391 | static int |
392 | nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 392 | nlmclt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
393 | { | 393 | { |
394 | struct nlm_lock *lock = &argp->lock; | 394 | struct nlm_lock *lock = &argp->lock; |
395 | 395 | ||
@@ -403,7 +403,7 @@ nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | static int | 405 | static int |
406 | nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 406 | nlmclt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
407 | { | 407 | { |
408 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) | 408 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) |
409 | return -EIO; | 409 | return -EIO; |
@@ -438,7 +438,7 @@ nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
438 | 438 | ||
439 | 439 | ||
440 | static int | 440 | static int |
441 | nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 441 | nlmclt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
442 | { | 442 | { |
443 | struct nlm_lock *lock = &argp->lock; | 443 | struct nlm_lock *lock = &argp->lock; |
444 | 444 | ||
@@ -455,7 +455,7 @@ nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
455 | } | 455 | } |
456 | 456 | ||
457 | static int | 457 | static int |
458 | nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 458 | nlmclt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
459 | { | 459 | { |
460 | struct nlm_lock *lock = &argp->lock; | 460 | struct nlm_lock *lock = &argp->lock; |
461 | 461 | ||
@@ -470,7 +470,7 @@ nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
470 | } | 470 | } |
471 | 471 | ||
472 | static int | 472 | static int |
473 | nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | 473 | nlmclt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp) |
474 | { | 474 | { |
475 | struct nlm_lock *lock = &argp->lock; | 475 | struct nlm_lock *lock = &argp->lock; |
476 | 476 | ||
@@ -483,7 +483,7 @@ nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) | |||
483 | } | 483 | } |
484 | 484 | ||
485 | static int | 485 | static int |
486 | nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 486 | nlmclt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
487 | { | 487 | { |
488 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) | 488 | if (!(p = nlm_encode_cookie(p, &resp->cookie))) |
489 | return -EIO; | 489 | return -EIO; |
@@ -493,7 +493,7 @@ nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
493 | } | 493 | } |
494 | 494 | ||
495 | static int | 495 | static int |
496 | nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 496 | nlmclt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
497 | { | 497 | { |
498 | if (!(p = nlm_encode_testres(p, resp))) | 498 | if (!(p = nlm_encode_testres(p, resp))) |
499 | return -EIO; | 499 | return -EIO; |
@@ -502,7 +502,7 @@ nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | |||
502 | } | 502 | } |
503 | 503 | ||
504 | static int | 504 | static int |
505 | nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) | 505 | nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp) |
506 | { | 506 | { |
507 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) | 507 | if (!(p = nlm_decode_cookie(p, &resp->cookie))) |
508 | return -EIO; | 508 | return -EIO; |