diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-07-16 17:15:10 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-07-18 09:38:02 -0400 |
commit | 3e98abffd1665b884a322aedcd528577842f762f (patch) | |
tree | 3f94883dd56081c17e3bbfadbe196eb5cb2a7595 /fs/nfsd | |
parent | ab1350b2b3c1dd2e465a6abdda608d8c44facfb8 (diff) |
nfsd4: call nfsd4_release_compoundargs from pc_release
This simplifies cleanup a bit.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 14 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 121fd84e7f90..7ef1b27f1125 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1218,7 +1218,6 @@ encode_op: | |||
1218 | fh_put(&resp->cstate.save_fh); | 1218 | fh_put(&resp->cstate.save_fh); |
1219 | BUG_ON(resp->cstate.replay_owner); | 1219 | BUG_ON(resp->cstate.replay_owner); |
1220 | out: | 1220 | out: |
1221 | nfsd4_release_compoundargs(args); | ||
1222 | /* Reset deferral mechanism for RPC deferrals */ | 1221 | /* Reset deferral mechanism for RPC deferrals */ |
1223 | rqstp->rq_usedeferral = 1; | 1222 | rqstp->rq_usedeferral = 1; |
1224 | dprintk("nfsv4 compound returned %d\n", ntohl(status)); | 1223 | dprintk("nfsv4 compound returned %d\n", ntohl(status)); |
@@ -1473,6 +1472,7 @@ static struct svc_procedure nfsd_procedures4[2] = { | |||
1473 | .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, | 1472 | .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, |
1474 | .pc_argsize = sizeof(struct nfsd4_compoundargs), | 1473 | .pc_argsize = sizeof(struct nfsd4_compoundargs), |
1475 | .pc_ressize = sizeof(struct nfsd4_compoundres), | 1474 | .pc_ressize = sizeof(struct nfsd4_compoundres), |
1475 | .pc_release = nfsd4_release_compoundargs, | ||
1476 | .pc_cachetype = RC_NOCACHE, | 1476 | .pc_cachetype = RC_NOCACHE, |
1477 | .pc_xdrressize = NFSD_BUFSIZE/4, | 1477 | .pc_xdrressize = NFSD_BUFSIZE/4, |
1478 | }, | 1478 | }, |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index a8d83bd5c1d5..c43f56021501 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -3428,8 +3428,11 @@ nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) | |||
3428 | return xdr_ressize_check(rqstp, p); | 3428 | return xdr_ressize_check(rqstp, p); |
3429 | } | 3429 | } |
3430 | 3430 | ||
3431 | void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args) | 3431 | int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp) |
3432 | { | 3432 | { |
3433 | struct svc_rqst *rqstp = rq; | ||
3434 | struct nfsd4_compoundargs *args = rqstp->rq_argp; | ||
3435 | |||
3433 | if (args->ops != args->iops) { | 3436 | if (args->ops != args->iops) { |
3434 | kfree(args->ops); | 3437 | kfree(args->ops); |
3435 | args->ops = args->iops; | 3438 | args->ops = args->iops; |
@@ -3442,13 +3445,12 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args) | |||
3442 | tb->release(tb->buf); | 3445 | tb->release(tb->buf); |
3443 | kfree(tb); | 3446 | kfree(tb); |
3444 | } | 3447 | } |
3448 | return 1; | ||
3445 | } | 3449 | } |
3446 | 3450 | ||
3447 | int | 3451 | int |
3448 | nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args) | 3452 | nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args) |
3449 | { | 3453 | { |
3450 | __be32 status; | ||
3451 | |||
3452 | args->p = p; | 3454 | args->p = p; |
3453 | args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len; | 3455 | args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len; |
3454 | args->pagelist = rqstp->rq_arg.pages; | 3456 | args->pagelist = rqstp->rq_arg.pages; |
@@ -3458,11 +3460,7 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_comp | |||
3458 | args->ops = args->iops; | 3460 | args->ops = args->iops; |
3459 | args->rqstp = rqstp; | 3461 | args->rqstp = rqstp; |
3460 | 3462 | ||
3461 | status = nfsd4_decode_compound(args); | 3463 | return !nfsd4_decode_compound(args); |
3462 | if (status) { | ||
3463 | nfsd4_release_compoundargs(args); | ||
3464 | } | ||
3465 | return !status; | ||
3466 | } | 3464 | } |
3467 | 3465 | ||
3468 | int | 3466 | int |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 02fb0e09de7f..351348c79631 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -580,7 +580,7 @@ extern __be32 | |||
580 | nfsd4_release_lockowner(struct svc_rqst *rqstp, | 580 | nfsd4_release_lockowner(struct svc_rqst *rqstp, |
581 | struct nfsd4_compound_state *, | 581 | struct nfsd4_compound_state *, |
582 | struct nfsd4_release_lockowner *rlockowner); | 582 | struct nfsd4_release_lockowner *rlockowner); |
583 | extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); | 583 | extern int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp); |
584 | extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, | 584 | extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, |
585 | struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); | 585 | struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); |
586 | extern __be32 nfsd4_renew(struct svc_rqst *rqstp, | 586 | extern __be32 nfsd4_renew(struct svc_rqst *rqstp, |