aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4xdr.c148
-rw-r--r--include/linux/nfsd/xdr4.h22
2 files changed, 170 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 76a0b2a8d69b..6973d61bedea 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -997,6 +997,34 @@ nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_rel
997} 997}
998 998
999static __be32 999static __be32
1000nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,
1001 struct nfsd4_exchange_id *clid)
1002{
1003 return nfserr_opnotsupp; /* stub */
1004}
1005
1006static __be32
1007nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,
1008 struct nfsd4_create_session *sess)
1009{
1010 return nfserr_opnotsupp; /* stub */
1011}
1012
1013static __be32
1014nfsd4_decode_destroy_session(struct nfsd4_compoundargs *argp,
1015 struct nfsd4_destroy_session *destroy_session)
1016{
1017 return nfserr_opnotsupp; /* stub */
1018}
1019
1020static __be32
1021nfsd4_decode_sequence(struct nfsd4_compoundargs *argp,
1022 struct nfsd4_sequence *seq)
1023{
1024 return nfserr_opnotsupp; /* stub */
1025}
1026
1027static __be32
1000nfsd4_decode_noop(struct nfsd4_compoundargs *argp, void *p) 1028nfsd4_decode_noop(struct nfsd4_compoundargs *argp, void *p)
1001{ 1029{
1002 return nfs_ok; 1030 return nfs_ok;
@@ -1050,6 +1078,67 @@ static nfsd4_dec nfsd4_dec_ops[] = {
1050 [OP_RELEASE_LOCKOWNER] = (nfsd4_dec)nfsd4_decode_release_lockowner, 1078 [OP_RELEASE_LOCKOWNER] = (nfsd4_dec)nfsd4_decode_release_lockowner,
1051}; 1079};
1052 1080
1081static nfsd4_dec nfsd41_dec_ops[] = {
1082 [OP_ACCESS] (nfsd4_dec)nfsd4_decode_access,
1083 [OP_CLOSE] (nfsd4_dec)nfsd4_decode_close,
1084 [OP_COMMIT] (nfsd4_dec)nfsd4_decode_commit,
1085 [OP_CREATE] (nfsd4_dec)nfsd4_decode_create,
1086 [OP_DELEGPURGE] (nfsd4_dec)nfsd4_decode_notsupp,
1087 [OP_DELEGRETURN] (nfsd4_dec)nfsd4_decode_delegreturn,
1088 [OP_GETATTR] (nfsd4_dec)nfsd4_decode_getattr,
1089 [OP_GETFH] (nfsd4_dec)nfsd4_decode_noop,
1090 [OP_LINK] (nfsd4_dec)nfsd4_decode_link,
1091 [OP_LOCK] (nfsd4_dec)nfsd4_decode_lock,
1092 [OP_LOCKT] (nfsd4_dec)nfsd4_decode_lockt,
1093 [OP_LOCKU] (nfsd4_dec)nfsd4_decode_locku,
1094 [OP_LOOKUP] (nfsd4_dec)nfsd4_decode_lookup,
1095 [OP_LOOKUPP] (nfsd4_dec)nfsd4_decode_noop,
1096 [OP_NVERIFY] (nfsd4_dec)nfsd4_decode_verify,
1097 [OP_OPEN] (nfsd4_dec)nfsd4_decode_open,
1098 [OP_OPENATTR] (nfsd4_dec)nfsd4_decode_notsupp,
1099 [OP_OPEN_CONFIRM] (nfsd4_dec)nfsd4_decode_notsupp,
1100 [OP_OPEN_DOWNGRADE] (nfsd4_dec)nfsd4_decode_open_downgrade,
1101 [OP_PUTFH] (nfsd4_dec)nfsd4_decode_putfh,
1102 [OP_PUTPUBFH] (nfsd4_dec)nfsd4_decode_notsupp,
1103 [OP_PUTROOTFH] (nfsd4_dec)nfsd4_decode_noop,
1104 [OP_READ] (nfsd4_dec)nfsd4_decode_read,
1105 [OP_READDIR] (nfsd4_dec)nfsd4_decode_readdir,
1106 [OP_READLINK] (nfsd4_dec)nfsd4_decode_noop,
1107 [OP_REMOVE] (nfsd4_dec)nfsd4_decode_remove,
1108 [OP_RENAME] (nfsd4_dec)nfsd4_decode_rename,
1109 [OP_RENEW] (nfsd4_dec)nfsd4_decode_notsupp,
1110 [OP_RESTOREFH] (nfsd4_dec)nfsd4_decode_noop,
1111 [OP_SAVEFH] (nfsd4_dec)nfsd4_decode_noop,
1112 [OP_SECINFO] (nfsd4_dec)nfsd4_decode_secinfo,
1113 [OP_SETATTR] (nfsd4_dec)nfsd4_decode_setattr,
1114 [OP_SETCLIENTID] (nfsd4_dec)nfsd4_decode_notsupp,
1115 [OP_SETCLIENTID_CONFIRM](nfsd4_dec)nfsd4_decode_notsupp,
1116 [OP_VERIFY] (nfsd4_dec)nfsd4_decode_verify,
1117 [OP_WRITE] (nfsd4_dec)nfsd4_decode_write,
1118 [OP_RELEASE_LOCKOWNER] (nfsd4_dec)nfsd4_decode_notsupp,
1119
1120 /* new operations for NFSv4.1 */
1121 [OP_BACKCHANNEL_CTL] (nfsd4_dec)nfsd4_decode_notsupp,
1122 [OP_BIND_CONN_TO_SESSION](nfsd4_dec)nfsd4_decode_notsupp,
1123 [OP_EXCHANGE_ID] (nfsd4_dec)nfsd4_decode_exchange_id,
1124 [OP_CREATE_SESSION] (nfsd4_dec)nfsd4_decode_create_session,
1125 [OP_DESTROY_SESSION] (nfsd4_dec)nfsd4_decode_destroy_session,
1126 [OP_FREE_STATEID] (nfsd4_dec)nfsd4_decode_notsupp,
1127 [OP_GET_DIR_DELEGATION] (nfsd4_dec)nfsd4_decode_notsupp,
1128 [OP_GETDEVICEINFO] (nfsd4_dec)nfsd4_decode_notsupp,
1129 [OP_GETDEVICELIST] (nfsd4_dec)nfsd4_decode_notsupp,
1130 [OP_LAYOUTCOMMIT] (nfsd4_dec)nfsd4_decode_notsupp,
1131 [OP_LAYOUTGET] (nfsd4_dec)nfsd4_decode_notsupp,
1132 [OP_LAYOUTRETURN] (nfsd4_dec)nfsd4_decode_notsupp,
1133 [OP_SECINFO_NO_NAME] (nfsd4_dec)nfsd4_decode_notsupp,
1134 [OP_SEQUENCE] (nfsd4_dec)nfsd4_decode_sequence,
1135 [OP_SET_SSV] (nfsd4_dec)nfsd4_decode_notsupp,
1136 [OP_TEST_STATEID] (nfsd4_dec)nfsd4_decode_notsupp,
1137 [OP_WANT_DELEGATION] (nfsd4_dec)nfsd4_decode_notsupp,
1138 [OP_DESTROY_CLIENTID] (nfsd4_dec)nfsd4_decode_notsupp,
1139 [OP_RECLAIM_COMPLETE] (nfsd4_dec)nfsd4_decode_notsupp,
1140};
1141
1053struct nfsd4_minorversion_ops { 1142struct nfsd4_minorversion_ops {
1054 nfsd4_dec *decoders; 1143 nfsd4_dec *decoders;
1055 int nops; 1144 int nops;
@@ -1057,6 +1146,7 @@ struct nfsd4_minorversion_ops {
1057 1146
1058static struct nfsd4_minorversion_ops nfsd4_minorversion[] = { 1147static struct nfsd4_minorversion_ops nfsd4_minorversion[] = {
1059 [0] = { nfsd4_dec_ops, ARRAY_SIZE(nfsd4_dec_ops) }, 1148 [0] = { nfsd4_dec_ops, ARRAY_SIZE(nfsd4_dec_ops) },
1149 [1] = { nfsd41_dec_ops, ARRAY_SIZE(nfsd41_dec_ops) },
1060}; 1150};
1061 1151
1062static __be32 1152static __be32
@@ -2572,6 +2662,38 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_w
2572} 2662}
2573 2663
2574static __be32 2664static __be32
2665nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, int nfserr,
2666 struct nfsd4_exchange_id *exid)
2667{
2668 /* stub */
2669 return nfserr;
2670}
2671
2672static __be32
2673nfsd4_encode_create_session(struct nfsd4_compoundres *resp, int nfserr,
2674 struct nfsd4_create_session *sess)
2675{
2676 /* stub */
2677 return nfserr;
2678}
2679
2680static __be32
2681nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, int nfserr,
2682 struct nfsd4_destroy_session *destroy_session)
2683{
2684 /* stub */
2685 return nfserr;
2686}
2687
2688static __be32
2689nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
2690 struct nfsd4_sequence *seq)
2691{
2692 /* stub */
2693 return nfserr;
2694}
2695
2696static __be32
2575nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p) 2697nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p)
2576{ 2698{
2577 return nfserr; 2699 return nfserr;
@@ -2579,6 +2701,11 @@ nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p)
2579 2701
2580typedef __be32(* nfsd4_enc)(struct nfsd4_compoundres *, __be32, void *); 2702typedef __be32(* nfsd4_enc)(struct nfsd4_compoundres *, __be32, void *);
2581 2703
2704/*
2705 * Note: nfsd4_enc_ops vector is shared for v4.0 and v4.1
2706 * since we don't need to filter out obsolete ops as this is
2707 * done in the decoding phase.
2708 */
2582static nfsd4_enc nfsd4_enc_ops[] = { 2709static nfsd4_enc nfsd4_enc_ops[] = {
2583 [OP_ACCESS] = (nfsd4_enc)nfsd4_encode_access, 2710 [OP_ACCESS] = (nfsd4_enc)nfsd4_encode_access,
2584 [OP_CLOSE] = (nfsd4_enc)nfsd4_encode_close, 2711 [OP_CLOSE] = (nfsd4_enc)nfsd4_encode_close,
@@ -2617,6 +2744,27 @@ static nfsd4_enc nfsd4_enc_ops[] = {
2617 [OP_VERIFY] = (nfsd4_enc)nfsd4_encode_noop, 2744 [OP_VERIFY] = (nfsd4_enc)nfsd4_encode_noop,
2618 [OP_WRITE] = (nfsd4_enc)nfsd4_encode_write, 2745 [OP_WRITE] = (nfsd4_enc)nfsd4_encode_write,
2619 [OP_RELEASE_LOCKOWNER] = (nfsd4_enc)nfsd4_encode_noop, 2746 [OP_RELEASE_LOCKOWNER] = (nfsd4_enc)nfsd4_encode_noop,
2747
2748 /* NFSv4.1 operations */
2749 [OP_BACKCHANNEL_CTL] = (nfsd4_enc)nfsd4_encode_noop,
2750 [OP_BIND_CONN_TO_SESSION] = (nfsd4_enc)nfsd4_encode_noop,
2751 [OP_EXCHANGE_ID] = (nfsd4_enc)nfsd4_encode_exchange_id,
2752 [OP_CREATE_SESSION] = (nfsd4_enc)nfsd4_encode_create_session,
2753 [OP_DESTROY_SESSION] = (nfsd4_enc)nfsd4_encode_destroy_session,
2754 [OP_FREE_STATEID] = (nfsd4_enc)nfsd4_encode_noop,
2755 [OP_GET_DIR_DELEGATION] = (nfsd4_enc)nfsd4_encode_noop,
2756 [OP_GETDEVICEINFO] = (nfsd4_enc)nfsd4_encode_noop,
2757 [OP_GETDEVICELIST] = (nfsd4_enc)nfsd4_encode_noop,
2758 [OP_LAYOUTCOMMIT] = (nfsd4_enc)nfsd4_encode_noop,
2759 [OP_LAYOUTGET] = (nfsd4_enc)nfsd4_encode_noop,
2760 [OP_LAYOUTRETURN] = (nfsd4_enc)nfsd4_encode_noop,
2761 [OP_SECINFO_NO_NAME] = (nfsd4_enc)nfsd4_encode_noop,
2762 [OP_SEQUENCE] = (nfsd4_enc)nfsd4_encode_sequence,
2763 [OP_SET_SSV] = (nfsd4_enc)nfsd4_encode_noop,
2764 [OP_TEST_STATEID] = (nfsd4_enc)nfsd4_encode_noop,
2765 [OP_WANT_DELEGATION] = (nfsd4_enc)nfsd4_encode_noop,
2766 [OP_DESTROY_CLIENTID] = (nfsd4_enc)nfsd4_encode_noop,
2767 [OP_RECLAIM_COMPLETE] = (nfsd4_enc)nfsd4_encode_noop,
2620}; 2768};
2621 2769
2622void 2770void
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index fd15ddc3359d..28af925c2a3d 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -344,6 +344,22 @@ struct nfsd4_write {
344 nfs4_verifier wr_verifier; /* response */ 344 nfs4_verifier wr_verifier; /* response */
345}; 345};
346 346
347struct nfsd4_exchange_id {
348 int foo; /* stub */
349};
350
351struct nfsd4_create_session {
352 int foo; /* stub */
353};
354
355struct nfsd4_sequence {
356 int foo; /* stub */
357};
358
359struct nfsd4_destroy_session {
360 int foo; /* stub */
361};
362
347struct nfsd4_op { 363struct nfsd4_op {
348 int opnum; 364 int opnum;
349 __be32 status; 365 __be32 status;
@@ -378,6 +394,12 @@ struct nfsd4_op {
378 struct nfsd4_verify verify; 394 struct nfsd4_verify verify;
379 struct nfsd4_write write; 395 struct nfsd4_write write;
380 struct nfsd4_release_lockowner release_lockowner; 396 struct nfsd4_release_lockowner release_lockowner;
397
398 /* NFSv4.1 */
399 struct nfsd4_exchange_id exchange_id;
400 struct nfsd4_create_session create_session;
401 struct nfsd4_destroy_session destroy_session;
402 struct nfsd4_sequence sequence;
381 } u; 403 } u;
382 struct nfs4_replay * replay; 404 struct nfs4_replay * replay;
383}; 405};