aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntxdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/clntxdr.c')
-rw-r--r--fs/lockd/clntxdr.c92
1 files changed, 39 insertions, 53 deletions
diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
index 0472f2aff509..c6fda8fb1c5b 100644
--- a/fs/lockd/clntxdr.c
+++ b/fs/lockd/clntxdr.c
@@ -378,17 +378,15 @@ static void encode_nlm_lock(struct xdr_stream *xdr,
378 * struct nlm_lock alock; 378 * struct nlm_lock alock;
379 * }; 379 * };
380 */ 380 */
381static int nlm_xdr_enc_testargs(struct rpc_rqst *req, __be32 *p, 381static void nlm_xdr_enc_testargs(struct rpc_rqst *req,
382 const struct nlm_args *args) 382 struct xdr_stream *xdr,
383 const struct nlm_args *args)
383{ 384{
384 const struct nlm_lock *lock = &args->lock; 385 const struct nlm_lock *lock = &args->lock;
385 struct xdr_stream xdr;
386 386
387 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 387 encode_cookie(xdr, &args->cookie);
388 encode_cookie(&xdr, &args->cookie); 388 encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
389 encode_bool(&xdr, lock->fl.fl_type == F_WRLCK); 389 encode_nlm_lock(xdr, lock);
390 encode_nlm_lock(&xdr, lock);
391 return 0;
392} 390}
393 391
394/* 392/*
@@ -401,20 +399,18 @@ static int nlm_xdr_enc_testargs(struct rpc_rqst *req, __be32 *p,
401 * int state; 399 * int state;
402 * }; 400 * };
403 */ 401 */
404static int nlm_xdr_enc_lockargs(struct rpc_rqst *req, __be32 *p, 402static void nlm_xdr_enc_lockargs(struct rpc_rqst *req,
405 const struct nlm_args *args) 403 struct xdr_stream *xdr,
404 const struct nlm_args *args)
406{ 405{
407 const struct nlm_lock *lock = &args->lock; 406 const struct nlm_lock *lock = &args->lock;
408 struct xdr_stream xdr;
409 407
410 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 408 encode_cookie(xdr, &args->cookie);
411 encode_cookie(&xdr, &args->cookie); 409 encode_bool(xdr, args->block);
412 encode_bool(&xdr, args->block); 410 encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
413 encode_bool(&xdr, lock->fl.fl_type == F_WRLCK); 411 encode_nlm_lock(xdr, lock);
414 encode_nlm_lock(&xdr, lock); 412 encode_bool(xdr, args->reclaim);
415 encode_bool(&xdr, args->reclaim); 413 encode_int32(xdr, args->state);
416 encode_int32(&xdr, args->state);
417 return 0;
418} 414}
419 415
420/* 416/*
@@ -425,18 +421,16 @@ static int nlm_xdr_enc_lockargs(struct rpc_rqst *req, __be32 *p,
425 * struct nlm_lock alock; 421 * struct nlm_lock alock;
426 * }; 422 * };
427 */ 423 */
428static int nlm_xdr_enc_cancargs(struct rpc_rqst *req, __be32 *p, 424static void nlm_xdr_enc_cancargs(struct rpc_rqst *req,
429 const struct nlm_args *args) 425 struct xdr_stream *xdr,
426 const struct nlm_args *args)
430{ 427{
431 const struct nlm_lock *lock = &args->lock; 428 const struct nlm_lock *lock = &args->lock;
432 struct xdr_stream xdr;
433 429
434 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 430 encode_cookie(xdr, &args->cookie);
435 encode_cookie(&xdr, &args->cookie); 431 encode_bool(xdr, args->block);
436 encode_bool(&xdr, args->block); 432 encode_bool(xdr, lock->fl.fl_type == F_WRLCK);
437 encode_bool(&xdr, lock->fl.fl_type == F_WRLCK); 433 encode_nlm_lock(xdr, lock);
438 encode_nlm_lock(&xdr, lock);
439 return 0;
440} 434}
441 435
442/* 436/*
@@ -445,16 +439,14 @@ static int nlm_xdr_enc_cancargs(struct rpc_rqst *req, __be32 *p,
445 * struct nlm_lock alock; 439 * struct nlm_lock alock;
446 * }; 440 * };
447 */ 441 */
448static int nlm_xdr_enc_unlockargs(struct rpc_rqst *req, __be32 *p, 442static void nlm_xdr_enc_unlockargs(struct rpc_rqst *req,
449 const struct nlm_args *args) 443 struct xdr_stream *xdr,
444 const struct nlm_args *args)
450{ 445{
451 const struct nlm_lock *lock = &args->lock; 446 const struct nlm_lock *lock = &args->lock;
452 struct xdr_stream xdr;
453 447
454 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 448 encode_cookie(xdr, &args->cookie);
455 encode_cookie(&xdr, &args->cookie); 449 encode_nlm_lock(xdr, lock);
456 encode_nlm_lock(&xdr, lock);
457 return 0;
458} 450}
459 451
460/* 452/*
@@ -463,15 +455,12 @@ static int nlm_xdr_enc_unlockargs(struct rpc_rqst *req, __be32 *p,
463 * nlm_stat stat; 455 * nlm_stat stat;
464 * }; 456 * };
465 */ 457 */
466static int nlm_xdr_enc_res(struct rpc_rqst *req, __be32 *p, 458static void nlm_xdr_enc_res(struct rpc_rqst *req,
467 const struct nlm_res *result) 459 struct xdr_stream *xdr,
460 const struct nlm_res *result)
468{ 461{
469 struct xdr_stream xdr; 462 encode_cookie(xdr, &result->cookie);
470 463 encode_nlm_stat(xdr, result->status);
471 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
472 encode_cookie(&xdr, &result->cookie);
473 encode_nlm_stat(&xdr, result->status);
474 return 0;
475} 464}
476 465
477/* 466/*
@@ -494,16 +483,13 @@ static void encode_nlm_testrply(struct xdr_stream *xdr,
494 encode_nlm_holder(xdr, result); 483 encode_nlm_holder(xdr, result);
495} 484}
496 485
497static int nlm_xdr_enc_testres(struct rpc_rqst *req, __be32 *p, 486static void nlm_xdr_enc_testres(struct rpc_rqst *req,
498 const struct nlm_res *result) 487 struct xdr_stream *xdr,
488 const struct nlm_res *result)
499{ 489{
500 struct xdr_stream xdr; 490 encode_cookie(xdr, &result->cookie);
501 491 encode_nlm_stat(xdr, result->status);
502 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 492 encode_nlm_testrply(xdr, result);
503 encode_cookie(&xdr, &result->cookie);
504 encode_nlm_stat(&xdr, result->status);
505 encode_nlm_testrply(&xdr, result);
506 return 0;
507} 493}
508 494
509 495
@@ -586,7 +572,7 @@ out:
586#define PROC(proc, argtype, restype) \ 572#define PROC(proc, argtype, restype) \
587[NLMPROC_##proc] = { \ 573[NLMPROC_##proc] = { \
588 .p_proc = NLMPROC_##proc, \ 574 .p_proc = NLMPROC_##proc, \
589 .p_encode = (kxdrproc_t)nlm_xdr_enc_##argtype, \ 575 .p_encode = (kxdreproc_t)nlm_xdr_enc_##argtype, \
590 .p_decode = (kxdrproc_t)nlm_xdr_dec_##restype, \ 576 .p_decode = (kxdrproc_t)nlm_xdr_dec_##restype, \
591 .p_arglen = NLM_##argtype##_sz, \ 577 .p_arglen = NLM_##argtype##_sz, \
592 .p_replen = NLM_##restype##_sz, \ 578 .p_replen = NLM_##restype##_sz, \