diff options
author | J. Bruce Fields <bfields@redhat.com> | 2017-05-06 10:38:39 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-08-01 17:36:35 -0400 |
commit | 0020939f20ce2881e51488e254fbb7a9b6c515f6 (patch) | |
tree | 3d41a3fb79f92fe71bc3047bf18c69bccde3beb7 | |
parent | 16f73eb02d7e1765ccab3d2018e0bd98eb93d973 (diff) |
nfsd4: move some nfsd4 op definitions to xdr4.h
I want code in nfs4xdr.c to have access to this stuff.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4proc.c | 43 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 44 |
2 files changed, 44 insertions, 43 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d27e75ad25e3..9a627a6c52aa 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1541,49 +1541,6 @@ static inline void nfsd4_increment_op_stats(u32 opnum) | |||
1541 | nfsdstats.nfs4_opcount[opnum]++; | 1541 | nfsdstats.nfs4_opcount[opnum]++; |
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | enum nfsd4_op_flags { | ||
1545 | ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */ | ||
1546 | ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */ | ||
1547 | ALLOWED_AS_FIRST_OP = 1 << 2, /* ops reqired first in compound */ | ||
1548 | /* For rfc 5661 section 2.6.3.1.1: */ | ||
1549 | OP_HANDLES_WRONGSEC = 1 << 3, | ||
1550 | OP_IS_PUTFH_LIKE = 1 << 4, | ||
1551 | /* | ||
1552 | * These are the ops whose result size we estimate before | ||
1553 | * encoding, to avoid performing an op then not being able to | ||
1554 | * respond or cache a response. This includes writes and setattrs | ||
1555 | * as well as the operations usually called "nonidempotent": | ||
1556 | */ | ||
1557 | OP_MODIFIES_SOMETHING = 1 << 5, | ||
1558 | /* | ||
1559 | * Cache compounds containing these ops in the xid-based drc: | ||
1560 | * We use the DRC for compounds containing non-idempotent | ||
1561 | * operations, *except* those that are 4.1-specific (since | ||
1562 | * sessions provide their own EOS), and except for stateful | ||
1563 | * operations other than setclientid and setclientid_confirm | ||
1564 | * (since sequence numbers provide EOS for open, lock, etc in | ||
1565 | * the v4.0 case). | ||
1566 | */ | ||
1567 | OP_CACHEME = 1 << 6, | ||
1568 | /* | ||
1569 | * These are ops which clear current state id. | ||
1570 | */ | ||
1571 | OP_CLEAR_STATEID = 1 << 7, | ||
1572 | }; | ||
1573 | |||
1574 | struct nfsd4_operation { | ||
1575 | __be32 (*op_func)(struct svc_rqst *, struct nfsd4_compound_state *, | ||
1576 | union nfsd4_op_u *); | ||
1577 | u32 op_flags; | ||
1578 | char *op_name; | ||
1579 | /* Try to get response size before operation */ | ||
1580 | u32 (*op_rsize_bop)(struct svc_rqst *, struct nfsd4_op *); | ||
1581 | void (*op_get_currentstateid)(struct nfsd4_compound_state *, | ||
1582 | union nfsd4_op_u *); | ||
1583 | void (*op_set_currentstateid)(struct nfsd4_compound_state *, | ||
1584 | union nfsd4_op_u *); | ||
1585 | }; | ||
1586 | |||
1587 | static const struct nfsd4_operation nfsd4_ops[]; | 1544 | static const struct nfsd4_operation nfsd4_ops[]; |
1588 | 1545 | ||
1589 | static const char *nfsd4_op_name(unsigned opnum); | 1546 | static const char *nfsd4_op_name(unsigned opnum); |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 72c6ad136107..fcdfe1c3ff4f 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -748,6 +748,50 @@ extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp, | |||
748 | struct nfsd4_compound_state *, union nfsd4_op_u *); | 748 | struct nfsd4_compound_state *, union nfsd4_op_u *); |
749 | extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr); | 749 | extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr); |
750 | 750 | ||
751 | enum nfsd4_op_flags { | ||
752 | ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */ | ||
753 | ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */ | ||
754 | ALLOWED_AS_FIRST_OP = 1 << 2, /* ops reqired first in compound */ | ||
755 | /* For rfc 5661 section 2.6.3.1.1: */ | ||
756 | OP_HANDLES_WRONGSEC = 1 << 3, | ||
757 | OP_IS_PUTFH_LIKE = 1 << 4, | ||
758 | /* | ||
759 | * These are the ops whose result size we estimate before | ||
760 | * encoding, to avoid performing an op then not being able to | ||
761 | * respond or cache a response. This includes writes and setattrs | ||
762 | * as well as the operations usually called "nonidempotent": | ||
763 | */ | ||
764 | OP_MODIFIES_SOMETHING = 1 << 5, | ||
765 | /* | ||
766 | * Cache compounds containing these ops in the xid-based drc: | ||
767 | * We use the DRC for compounds containing non-idempotent | ||
768 | * operations, *except* those that are 4.1-specific (since | ||
769 | * sessions provide their own EOS), and except for stateful | ||
770 | * operations other than setclientid and setclientid_confirm | ||
771 | * (since sequence numbers provide EOS for open, lock, etc in | ||
772 | * the v4.0 case). | ||
773 | */ | ||
774 | OP_CACHEME = 1 << 6, | ||
775 | /* | ||
776 | * These are ops which clear current state id. | ||
777 | */ | ||
778 | OP_CLEAR_STATEID = 1 << 7, | ||
779 | }; | ||
780 | |||
781 | struct nfsd4_operation { | ||
782 | __be32 (*op_func)(struct svc_rqst *, struct nfsd4_compound_state *, | ||
783 | union nfsd4_op_u *); | ||
784 | u32 op_flags; | ||
785 | char *op_name; | ||
786 | /* Try to get response size before operation */ | ||
787 | u32 (*op_rsize_bop)(struct svc_rqst *, struct nfsd4_op *); | ||
788 | void (*op_get_currentstateid)(struct nfsd4_compound_state *, | ||
789 | union nfsd4_op_u *); | ||
790 | void (*op_set_currentstateid)(struct nfsd4_compound_state *, | ||
791 | union nfsd4_op_u *); | ||
792 | }; | ||
793 | |||
794 | |||
751 | #endif | 795 | #endif |
752 | 796 | ||
753 | /* | 797 | /* |