diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2013-06-05 11:15:02 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-06-08 16:20:18 -0400 |
commit | 6b140b85d92bd65db44f0a7a065b2e39a91e9a9d (patch) | |
tree | 5fb725e6877f30cb2bc8d39d6fbe37142543bfa7 | |
parent | 459de2edb9105a5d091f8215650e12c0812d59f3 (diff) |
NFS: Add in v4.2 callback operation
NFS v4.2 adds a CB_OFFLOAD operation used by COPY and WRITE_PLUS. Since
neither of these operations have been implemented yet, simply return
NFS4ERR_NOTSUPP.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/callback.h | 2 | ||||
-rw-r--r-- | fs/nfs/callback_xdr.c | 36 |
2 files changed, 36 insertions, 2 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index 41cf8934f4e7..84326e9fb47a 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -32,6 +32,8 @@ enum nfs4_callback_opnum { | |||
32 | OP_CB_WANTS_CANCELLED = 12, | 32 | OP_CB_WANTS_CANCELLED = 12, |
33 | OP_CB_NOTIFY_LOCK = 13, | 33 | OP_CB_NOTIFY_LOCK = 13, |
34 | OP_CB_NOTIFY_DEVICEID = 14, | 34 | OP_CB_NOTIFY_DEVICEID = 14, |
35 | /* Callback operations new to NFSv4.2 */ | ||
36 | OP_CB_OFFLOAD = 15, | ||
35 | OP_CB_ILLEGAL = 10044, | 37 | OP_CB_ILLEGAL = 10044, |
36 | }; | 38 | }; |
37 | 39 | ||
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 77c0b881520f..d450c21bc382 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -786,6 +786,26 @@ static void nfs4_cb_free_slot(struct cb_process_state *cps) | |||
786 | } | 786 | } |
787 | #endif /* CONFIG_NFS_V4_1 */ | 787 | #endif /* CONFIG_NFS_V4_1 */ |
788 | 788 | ||
789 | #ifdef CONFIG_NFS_V4_2 | ||
790 | static __be32 | ||
791 | preprocess_nfs42_op(int nop, unsigned int op_nr, struct callback_op **op) | ||
792 | { | ||
793 | __be32 status = preprocess_nfs41_op(nop, op_nr, op); | ||
794 | if (status != htonl(NFS4ERR_OP_ILLEGAL)) | ||
795 | return status; | ||
796 | |||
797 | if (op_nr == OP_CB_OFFLOAD) | ||
798 | return htonl(NFS4ERR_NOTSUPP); | ||
799 | return htonl(NFS4ERR_OP_ILLEGAL); | ||
800 | } | ||
801 | #else /* CONFIG_NFS_V4_2 */ | ||
802 | static __be32 | ||
803 | preprocess_nfs42_op(int nop, unsigned int op_nr, struct callback_op **op) | ||
804 | { | ||
805 | return htonl(NFS4ERR_MINOR_VERS_MISMATCH); | ||
806 | } | ||
807 | #endif /* CONFIG_NFS_V4_2 */ | ||
808 | |||
789 | static __be32 | 809 | static __be32 |
790 | preprocess_nfs4_op(unsigned int op_nr, struct callback_op **op) | 810 | preprocess_nfs4_op(unsigned int op_nr, struct callback_op **op) |
791 | { | 811 | { |
@@ -820,8 +840,20 @@ static __be32 process_op(int nop, struct svc_rqst *rqstp, | |||
820 | dprintk("%s: minorversion=%d nop=%d op_nr=%u\n", | 840 | dprintk("%s: minorversion=%d nop=%d op_nr=%u\n", |
821 | __func__, cps->minorversion, nop, op_nr); | 841 | __func__, cps->minorversion, nop, op_nr); |
822 | 842 | ||
823 | status = cps->minorversion ? preprocess_nfs41_op(nop, op_nr, &op) : | 843 | switch (cps->minorversion) { |
824 | preprocess_nfs4_op(op_nr, &op); | 844 | case 0: |
845 | status = preprocess_nfs4_op(op_nr, &op); | ||
846 | break; | ||
847 | case 1: | ||
848 | status = preprocess_nfs41_op(nop, op_nr, &op); | ||
849 | break; | ||
850 | case 2: | ||
851 | status = preprocess_nfs42_op(nop, op_nr, &op); | ||
852 | break; | ||
853 | default: | ||
854 | status = htonl(NFS4ERR_MINOR_VERS_MISMATCH); | ||
855 | } | ||
856 | |||
825 | if (status == htonl(NFS4ERR_OP_ILLEGAL)) | 857 | if (status == htonl(NFS4ERR_OP_ILLEGAL)) |
826 | op_nr = OP_CB_ILLEGAL; | 858 | op_nr = OP_CB_ILLEGAL; |
827 | if (status) | 859 | if (status) |