diff options
author | J. Bruce Fields <bfields@redhat.com> | 2017-07-06 17:51:29 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-08-24 21:12:20 -0400 |
commit | f4f9ef4a1b0a1ca80b152e28e176d69515bdf7e8 (patch) | |
tree | 1f52ae97829e434eae88af200b524b74f7b9ecdc /fs/nfsd | |
parent | 0020939f20ce2881e51488e254fbb7a9b6c515f6 (diff) |
nfsd4: opdesc will be useful outside nfs4proc.c
Trivial cleanup, no change in behavior.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 25 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 1 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 9a627a6c52aa..01d7f2456f62 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1578,7 +1578,7 @@ static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args) | |||
1578 | return nfs_ok; | 1578 | return nfs_ok; |
1579 | } | 1579 | } |
1580 | 1580 | ||
1581 | static inline const struct nfsd4_operation *OPDESC(struct nfsd4_op *op) | 1581 | const struct nfsd4_operation *OPDESC(struct nfsd4_op *op) |
1582 | { | 1582 | { |
1583 | return &nfsd4_ops[op->opnum]; | 1583 | return &nfsd4_ops[op->opnum]; |
1584 | } | 1584 | } |
@@ -1651,7 +1651,6 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) | |||
1651 | struct nfsd4_compoundargs *args = rqstp->rq_argp; | 1651 | struct nfsd4_compoundargs *args = rqstp->rq_argp; |
1652 | struct nfsd4_compoundres *resp = rqstp->rq_resp; | 1652 | struct nfsd4_compoundres *resp = rqstp->rq_resp; |
1653 | struct nfsd4_op *op; | 1653 | struct nfsd4_op *op; |
1654 | const struct nfsd4_operation *opdesc; | ||
1655 | struct nfsd4_compound_state *cstate = &resp->cstate; | 1654 | struct nfsd4_compound_state *cstate = &resp->cstate; |
1656 | struct svc_fh *current_fh = &cstate->current_fh; | 1655 | struct svc_fh *current_fh = &cstate->current_fh; |
1657 | struct svc_fh *save_fh = &cstate->save_fh; | 1656 | struct svc_fh *save_fh = &cstate->save_fh; |
@@ -1704,15 +1703,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) | |||
1704 | goto encode_op; | 1703 | goto encode_op; |
1705 | } | 1704 | } |
1706 | 1705 | ||
1707 | opdesc = OPDESC(op); | ||
1708 | |||
1709 | if (!current_fh->fh_dentry) { | 1706 | if (!current_fh->fh_dentry) { |
1710 | if (!(opdesc->op_flags & ALLOWED_WITHOUT_FH)) { | 1707 | if (!(op->opdesc->op_flags & ALLOWED_WITHOUT_FH)) { |
1711 | op->status = nfserr_nofilehandle; | 1708 | op->status = nfserr_nofilehandle; |
1712 | goto encode_op; | 1709 | goto encode_op; |
1713 | } | 1710 | } |
1714 | } else if (current_fh->fh_export->ex_fslocs.migrated && | 1711 | } else if (current_fh->fh_export->ex_fslocs.migrated && |
1715 | !(opdesc->op_flags & ALLOWED_ON_ABSENT_FS)) { | 1712 | !(op->opdesc->op_flags & ALLOWED_ON_ABSENT_FS)) { |
1716 | op->status = nfserr_moved; | 1713 | op->status = nfserr_moved; |
1717 | goto encode_op; | 1714 | goto encode_op; |
1718 | } | 1715 | } |
@@ -1720,12 +1717,12 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) | |||
1720 | fh_clear_wcc(current_fh); | 1717 | fh_clear_wcc(current_fh); |
1721 | 1718 | ||
1722 | /* If op is non-idempotent */ | 1719 | /* If op is non-idempotent */ |
1723 | if (opdesc->op_flags & OP_MODIFIES_SOMETHING) { | 1720 | if (op->opdesc->op_flags & OP_MODIFIES_SOMETHING) { |
1724 | /* | 1721 | /* |
1725 | * Don't execute this op if we couldn't encode a | 1722 | * Don't execute this op if we couldn't encode a |
1726 | * succesful reply: | 1723 | * succesful reply: |
1727 | */ | 1724 | */ |
1728 | u32 plen = opdesc->op_rsize_bop(rqstp, op); | 1725 | u32 plen = op->opdesc->op_rsize_bop(rqstp, op); |
1729 | /* | 1726 | /* |
1730 | * Plus if there's another operation, make sure | 1727 | * Plus if there's another operation, make sure |
1731 | * we'll have space to at least encode an error: | 1728 | * we'll have space to at least encode an error: |
@@ -1738,9 +1735,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) | |||
1738 | if (op->status) | 1735 | if (op->status) |
1739 | goto encode_op; | 1736 | goto encode_op; |
1740 | 1737 | ||
1741 | if (opdesc->op_get_currentstateid) | 1738 | if (op->opdesc->op_get_currentstateid) |
1742 | opdesc->op_get_currentstateid(cstate, &op->u); | 1739 | op->opdesc->op_get_currentstateid(cstate, &op->u); |
1743 | op->status = opdesc->op_func(rqstp, cstate, &op->u); | 1740 | op->status = op->opdesc->op_func(rqstp, cstate, &op->u); |
1744 | 1741 | ||
1745 | /* Only from SEQUENCE */ | 1742 | /* Only from SEQUENCE */ |
1746 | if (cstate->status == nfserr_replay_cache) { | 1743 | if (cstate->status == nfserr_replay_cache) { |
@@ -1749,10 +1746,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) | |||
1749 | goto out; | 1746 | goto out; |
1750 | } | 1747 | } |
1751 | if (!op->status) { | 1748 | if (!op->status) { |
1752 | if (opdesc->op_set_currentstateid) | 1749 | if (op->opdesc->op_set_currentstateid) |
1753 | opdesc->op_set_currentstateid(cstate, &op->u); | 1750 | op->opdesc->op_set_currentstateid(cstate, &op->u); |
1754 | 1751 | ||
1755 | if (opdesc->op_flags & OP_CLEAR_STATEID) | 1752 | if (op->opdesc->op_flags & OP_CLEAR_STATEID) |
1756 | clear_current_stateid(cstate); | 1753 | clear_current_stateid(cstate); |
1757 | 1754 | ||
1758 | if (need_wrongsec_check(rqstp)) | 1755 | if (need_wrongsec_check(rqstp)) |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 20fbcab97753..40ed23fda814 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1929,6 +1929,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) | |||
1929 | op->opnum = OP_ILLEGAL; | 1929 | op->opnum = OP_ILLEGAL; |
1930 | op->status = nfserr_op_illegal; | 1930 | op->status = nfserr_op_illegal; |
1931 | } | 1931 | } |
1932 | op->opdesc = OPDESC(op); | ||
1932 | /* | 1933 | /* |
1933 | * We'll try to cache the result in the DRC if any one | 1934 | * We'll try to cache the result in the DRC if any one |
1934 | * op in the compound wants to be cached: | 1935 | * op in the compound wants to be cached: |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index fcdfe1c3ff4f..90b928006bc7 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -538,6 +538,7 @@ struct nfsd4_seek { | |||
538 | 538 | ||
539 | struct nfsd4_op { | 539 | struct nfsd4_op { |
540 | int opnum; | 540 | int opnum; |
541 | const struct nfsd4_operation * opdesc; | ||
541 | __be32 status; | 542 | __be32 status; |
542 | union nfsd4_op_u { | 543 | union nfsd4_op_u { |
543 | struct nfsd4_access access; | 544 | struct nfsd4_access access; |
@@ -661,6 +662,7 @@ static inline bool nfsd4_last_compound_op(struct svc_rqst *rqstp) | |||
661 | return argp->opcnt == resp->opcnt; | 662 | return argp->opcnt == resp->opcnt; |
662 | } | 663 | } |
663 | 664 | ||
665 | const struct nfsd4_operation *OPDESC(struct nfsd4_op *op); | ||
664 | int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op); | 666 | int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op); |
665 | void warn_on_nonidempotent_op(struct nfsd4_op *op); | 667 | void warn_on_nonidempotent_op(struct nfsd4_op *op); |
666 | 668 | ||