Commit 3e98abffd1665b884a322aedcd528577842f762f

Authored by J. Bruce Fields
1 parent ab1350b2b3

nfsd4: call nfsd4_release_compoundargs from pc_release

This simplifies cleanup a bit.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>

Showing 3 changed files with 8 additions and 10 deletions Side-by-side Diff

... ... @@ -1218,7 +1218,6 @@
1218 1218 fh_put(&resp->cstate.save_fh);
1219 1219 BUG_ON(resp->cstate.replay_owner);
1220 1220 out:
1221   - nfsd4_release_compoundargs(args);
1222 1221 /* Reset deferral mechanism for RPC deferrals */
1223 1222 rqstp->rq_usedeferral = 1;
1224 1223 dprintk("nfsv4 compound returned %d\n", ntohl(status));
... ... @@ -1473,6 +1472,7 @@
1473 1472 .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres,
1474 1473 .pc_argsize = sizeof(struct nfsd4_compoundargs),
1475 1474 .pc_ressize = sizeof(struct nfsd4_compoundres),
  1475 + .pc_release = nfsd4_release_compoundargs,
1476 1476 .pc_cachetype = RC_NOCACHE,
1477 1477 .pc_xdrressize = NFSD_BUFSIZE/4,
1478 1478 },
... ... @@ -3428,8 +3428,11 @@
3428 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 3436 if (args->ops != args->iops) {
3434 3437 kfree(args->ops);
3435 3438 args->ops = args->iops;
3436 3439  
... ... @@ -3442,13 +3445,12 @@
3442 3445 tb->release(tb->buf);
3443 3446 kfree(tb);
3444 3447 }
  3448 + return 1;
3445 3449 }
3446 3450  
3447 3451 int
3448 3452 nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args)
3449 3453 {
3450   - __be32 status;
3451   -
3452 3454 args->p = p;
3453 3455 args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len;
3454 3456 args->pagelist = rqstp->rq_arg.pages;
... ... @@ -3458,11 +3460,7 @@
3458 3460 args->ops = args->iops;
3459 3461 args->rqstp = rqstp;
3460 3462  
3461   - status = nfsd4_decode_compound(args);
3462   - if (status) {
3463   - nfsd4_release_compoundargs(args);
3464   - }
3465   - return !status;
  3463 + return !nfsd4_decode_compound(args);
3466 3464 }
3467 3465  
3468 3466 int
... ... @@ -580,7 +580,7 @@
580 580 nfsd4_release_lockowner(struct svc_rqst *rqstp,
581 581 struct nfsd4_compound_state *,
582 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 584 extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
585 585 struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
586 586 extern __be32 nfsd4_renew(struct svc_rqst *rqstp,