diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-12-16 09:51:13 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-12-17 15:48:25 -0500 |
commit | 04f4ad16b231abbfde34c762697ad035a3af0b5f (patch) | |
tree | 43e3adde9776d9bb8a2bcf70a7ba7a721d1ac06a | |
parent | 0ff7ab46719a9c1e264b8d8e85416d59737ff13c (diff) |
nfsd4: implement secinfo_no_name
Implementation of this operation is mandatory for NFSv4.1.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4proc.c | 27 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 15 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 5 | ||||
-rw-r--r-- | include/linux/nfs4.h | 3 |
4 files changed, 48 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 095431a35722..f80c3997d24c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -780,6 +780,29 @@ nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
780 | } | 780 | } |
781 | 781 | ||
782 | static __be32 | 782 | static __be32 |
783 | nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | ||
784 | struct nfsd4_secinfo_no_name *sin) | ||
785 | { | ||
786 | __be32 err; | ||
787 | |||
788 | switch (sin->sin_style) { | ||
789 | case NFS4_SECINFO_STYLE4_CURRENT_FH: | ||
790 | break; | ||
791 | case NFS4_SECINFO_STYLE4_PARENT: | ||
792 | err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); | ||
793 | if (err) | ||
794 | return err; | ||
795 | break; | ||
796 | default: | ||
797 | return nfserr_inval; | ||
798 | } | ||
799 | exp_get(cstate->current_fh.fh_export); | ||
800 | sin->sin_exp = cstate->current_fh.fh_export; | ||
801 | fh_put(&cstate->current_fh); | ||
802 | return nfs_ok; | ||
803 | } | ||
804 | |||
805 | static __be32 | ||
783 | nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 806 | nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
784 | struct nfsd4_setattr *setattr) | 807 | struct nfsd4_setattr *setattr) |
785 | { | 808 | { |
@@ -1327,6 +1350,10 @@ static struct nfsd4_operation nfsd4_ops[] = { | |||
1327 | .op_flags = ALLOWED_WITHOUT_FH, | 1350 | .op_flags = ALLOWED_WITHOUT_FH, |
1328 | .op_name = "OP_RECLAIM_COMPLETE", | 1351 | .op_name = "OP_RECLAIM_COMPLETE", |
1329 | }, | 1352 | }, |
1353 | [OP_SECINFO_NO_NAME] = { | ||
1354 | .op_func = (nfsd4op_func)nfsd4_secinfo_no_name, | ||
1355 | .op_name = "OP_SECINFO_NO_NAME", | ||
1356 | }, | ||
1330 | }; | 1357 | }; |
1331 | 1358 | ||
1332 | static const char *nfsd4_op_name(unsigned opnum) | 1359 | static const char *nfsd4_op_name(unsigned opnum) |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 71d7d339e44a..b543b2410b54 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -847,6 +847,17 @@ nfsd4_decode_secinfo(struct nfsd4_compoundargs *argp, | |||
847 | } | 847 | } |
848 | 848 | ||
849 | static __be32 | 849 | static __be32 |
850 | nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp, | ||
851 | struct nfsd4_secinfo_no_name *sin) | ||
852 | { | ||
853 | DECODE_HEAD; | ||
854 | |||
855 | READ_BUF(4); | ||
856 | READ32(sin->sin_style); | ||
857 | DECODE_TAIL; | ||
858 | } | ||
859 | |||
860 | static __be32 | ||
850 | nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr) | 861 | nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr) |
851 | { | 862 | { |
852 | __be32 status; | 863 | __be32 status; |
@@ -1358,7 +1369,7 @@ static nfsd4_dec nfsd41_dec_ops[] = { | |||
1358 | [OP_LAYOUTCOMMIT] = (nfsd4_dec)nfsd4_decode_notsupp, | 1369 | [OP_LAYOUTCOMMIT] = (nfsd4_dec)nfsd4_decode_notsupp, |
1359 | [OP_LAYOUTGET] = (nfsd4_dec)nfsd4_decode_notsupp, | 1370 | [OP_LAYOUTGET] = (nfsd4_dec)nfsd4_decode_notsupp, |
1360 | [OP_LAYOUTRETURN] = (nfsd4_dec)nfsd4_decode_notsupp, | 1371 | [OP_LAYOUTRETURN] = (nfsd4_dec)nfsd4_decode_notsupp, |
1361 | [OP_SECINFO_NO_NAME] = (nfsd4_dec)nfsd4_decode_notsupp, | 1372 | [OP_SECINFO_NO_NAME] = (nfsd4_dec)nfsd4_decode_secinfo_no_name, |
1362 | [OP_SEQUENCE] = (nfsd4_dec)nfsd4_decode_sequence, | 1373 | [OP_SEQUENCE] = (nfsd4_dec)nfsd4_decode_sequence, |
1363 | [OP_SET_SSV] = (nfsd4_dec)nfsd4_decode_notsupp, | 1374 | [OP_SET_SSV] = (nfsd4_dec)nfsd4_decode_notsupp, |
1364 | [OP_TEST_STATEID] = (nfsd4_dec)nfsd4_decode_notsupp, | 1375 | [OP_TEST_STATEID] = (nfsd4_dec)nfsd4_decode_notsupp, |
@@ -3162,7 +3173,7 @@ static nfsd4_enc nfsd4_enc_ops[] = { | |||
3162 | [OP_LAYOUTCOMMIT] = (nfsd4_enc)nfsd4_encode_noop, | 3173 | [OP_LAYOUTCOMMIT] = (nfsd4_enc)nfsd4_encode_noop, |
3163 | [OP_LAYOUTGET] = (nfsd4_enc)nfsd4_encode_noop, | 3174 | [OP_LAYOUTGET] = (nfsd4_enc)nfsd4_encode_noop, |
3164 | [OP_LAYOUTRETURN] = (nfsd4_enc)nfsd4_encode_noop, | 3175 | [OP_LAYOUTRETURN] = (nfsd4_enc)nfsd4_encode_noop, |
3165 | [OP_SECINFO_NO_NAME] = (nfsd4_enc)nfsd4_encode_noop, | 3176 | [OP_SECINFO_NO_NAME] = (nfsd4_enc)nfsd4_encode_secinfo, |
3166 | [OP_SEQUENCE] = (nfsd4_enc)nfsd4_encode_sequence, | 3177 | [OP_SEQUENCE] = (nfsd4_enc)nfsd4_encode_sequence, |
3167 | [OP_SET_SSV] = (nfsd4_enc)nfsd4_encode_noop, | 3178 | [OP_SET_SSV] = (nfsd4_enc)nfsd4_encode_noop, |
3168 | [OP_TEST_STATEID] = (nfsd4_enc)nfsd4_encode_noop, | 3179 | [OP_TEST_STATEID] = (nfsd4_enc)nfsd4_encode_noop, |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 60fce3dc5cb5..799c30c3b495 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -311,6 +311,11 @@ struct nfsd4_secinfo { | |||
311 | struct svc_export *si_exp; /* response */ | 311 | struct svc_export *si_exp; /* response */ |
312 | }; | 312 | }; |
313 | 313 | ||
314 | struct nfsd4_secinfo_no_name { | ||
315 | u32 sin_style; /* request */ | ||
316 | struct svc_export *sin_exp; /* response */ | ||
317 | }; | ||
318 | |||
314 | struct nfsd4_setattr { | 319 | struct nfsd4_setattr { |
315 | stateid_t sa_stateid; /* request */ | 320 | stateid_t sa_stateid; /* request */ |
316 | u32 sa_bmval[3]; /* request */ | 321 | u32 sa_bmval[3]; /* request */ |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 4925b22219d2..26afa3021ed6 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -136,6 +136,9 @@ | |||
136 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 | 136 | #define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200 |
137 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 | 137 | #define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400 |
138 | 138 | ||
139 | #define NFS4_SECINFO_STYLE4_CURRENT_FH 0 | ||
140 | #define NFS4_SECINFO_STYLE4_PARENT 1 | ||
141 | |||
139 | #define NFS4_MAX_UINT64 (~(u64)0) | 142 | #define NFS4_MAX_UINT64 (~(u64)0) |
140 | 143 | ||
141 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. | 144 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. |