diff options
author | Benny Halevy <bhalevy@panasas.com> | 2008-07-02 04:15:03 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-07-02 19:03:19 -0400 |
commit | b001a1b6aa960949a24c2cdc28257dfcc9428d74 (patch) | |
tree | 8d60006778f3cbfdd88c57bbca83661c9b82d05a /fs/nfsd | |
parent | f2feb96bc3d18e50cab7de9eab142f99d91aa5f6 (diff) |
nfsd: dprint operation names
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 5c3683cfd59e..eef1629806f5 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -846,10 +846,13 @@ struct nfsd4_operation { | |||
846 | #define ALLOWED_WITHOUT_FH 1 | 846 | #define ALLOWED_WITHOUT_FH 1 |
847 | /* GETATTR and ops not listed as returning NFS4ERR_MOVED: */ | 847 | /* GETATTR and ops not listed as returning NFS4ERR_MOVED: */ |
848 | #define ALLOWED_ON_ABSENT_FS 2 | 848 | #define ALLOWED_ON_ABSENT_FS 2 |
849 | char *op_name; | ||
849 | }; | 850 | }; |
850 | 851 | ||
851 | static struct nfsd4_operation nfsd4_ops[]; | 852 | static struct nfsd4_operation nfsd4_ops[]; |
852 | 853 | ||
854 | static inline char *nfsd4_op_name(unsigned opnum); | ||
855 | |||
853 | /* | 856 | /* |
854 | * COMPOUND call. | 857 | * COMPOUND call. |
855 | */ | 858 | */ |
@@ -891,7 +894,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
891 | while (!status && resp->opcnt < args->opcnt) { | 894 | while (!status && resp->opcnt < args->opcnt) { |
892 | op = &args->ops[resp->opcnt++]; | 895 | op = &args->ops[resp->opcnt++]; |
893 | 896 | ||
894 | dprintk("nfsv4 compound op #%d: %d\n", resp->opcnt, op->opnum); | 897 | dprintk("nfsv4 compound op #%d/%d: %d (%s)\n", |
898 | resp->opcnt, args->opcnt, op->opnum, | ||
899 | nfsd4_op_name(op->opnum)); | ||
895 | 900 | ||
896 | /* | 901 | /* |
897 | * The XDR decode routines may have pre-set op->status; | 902 | * The XDR decode routines may have pre-set op->status; |
@@ -962,120 +967,163 @@ out: | |||
962 | static struct nfsd4_operation nfsd4_ops[OP_RELEASE_LOCKOWNER+1] = { | 967 | static struct nfsd4_operation nfsd4_ops[OP_RELEASE_LOCKOWNER+1] = { |
963 | [OP_ACCESS] = { | 968 | [OP_ACCESS] = { |
964 | .op_func = (nfsd4op_func)nfsd4_access, | 969 | .op_func = (nfsd4op_func)nfsd4_access, |
970 | .op_name = "OP_ACCESS", | ||
965 | }, | 971 | }, |
966 | [OP_CLOSE] = { | 972 | [OP_CLOSE] = { |
967 | .op_func = (nfsd4op_func)nfsd4_close, | 973 | .op_func = (nfsd4op_func)nfsd4_close, |
974 | .op_name = "OP_CLOSE", | ||
968 | }, | 975 | }, |
969 | [OP_COMMIT] = { | 976 | [OP_COMMIT] = { |
970 | .op_func = (nfsd4op_func)nfsd4_commit, | 977 | .op_func = (nfsd4op_func)nfsd4_commit, |
978 | .op_name = "OP_COMMIT", | ||
971 | }, | 979 | }, |
972 | [OP_CREATE] = { | 980 | [OP_CREATE] = { |
973 | .op_func = (nfsd4op_func)nfsd4_create, | 981 | .op_func = (nfsd4op_func)nfsd4_create, |
982 | .op_name = "OP_CREATE", | ||
974 | }, | 983 | }, |
975 | [OP_DELEGRETURN] = { | 984 | [OP_DELEGRETURN] = { |
976 | .op_func = (nfsd4op_func)nfsd4_delegreturn, | 985 | .op_func = (nfsd4op_func)nfsd4_delegreturn, |
986 | .op_name = "OP_DELEGRETURN", | ||
977 | }, | 987 | }, |
978 | [OP_GETATTR] = { | 988 | [OP_GETATTR] = { |
979 | .op_func = (nfsd4op_func)nfsd4_getattr, | 989 | .op_func = (nfsd4op_func)nfsd4_getattr, |
980 | .op_flags = ALLOWED_ON_ABSENT_FS, | 990 | .op_flags = ALLOWED_ON_ABSENT_FS, |
991 | .op_name = "OP_GETATTR", | ||
981 | }, | 992 | }, |
982 | [OP_GETFH] = { | 993 | [OP_GETFH] = { |
983 | .op_func = (nfsd4op_func)nfsd4_getfh, | 994 | .op_func = (nfsd4op_func)nfsd4_getfh, |
995 | .op_name = "OP_GETFH", | ||
984 | }, | 996 | }, |
985 | [OP_LINK] = { | 997 | [OP_LINK] = { |
986 | .op_func = (nfsd4op_func)nfsd4_link, | 998 | .op_func = (nfsd4op_func)nfsd4_link, |
999 | .op_name = "OP_LINK", | ||
987 | }, | 1000 | }, |
988 | [OP_LOCK] = { | 1001 | [OP_LOCK] = { |
989 | .op_func = (nfsd4op_func)nfsd4_lock, | 1002 | .op_func = (nfsd4op_func)nfsd4_lock, |
1003 | .op_name = "OP_LOCK", | ||
990 | }, | 1004 | }, |
991 | [OP_LOCKT] = { | 1005 | [OP_LOCKT] = { |
992 | .op_func = (nfsd4op_func)nfsd4_lockt, | 1006 | .op_func = (nfsd4op_func)nfsd4_lockt, |
1007 | .op_name = "OP_LOCKT", | ||
993 | }, | 1008 | }, |
994 | [OP_LOCKU] = { | 1009 | [OP_LOCKU] = { |
995 | .op_func = (nfsd4op_func)nfsd4_locku, | 1010 | .op_func = (nfsd4op_func)nfsd4_locku, |
1011 | .op_name = "OP_LOCKU", | ||
996 | }, | 1012 | }, |
997 | [OP_LOOKUP] = { | 1013 | [OP_LOOKUP] = { |
998 | .op_func = (nfsd4op_func)nfsd4_lookup, | 1014 | .op_func = (nfsd4op_func)nfsd4_lookup, |
1015 | .op_name = "OP_LOOKUP", | ||
999 | }, | 1016 | }, |
1000 | [OP_LOOKUPP] = { | 1017 | [OP_LOOKUPP] = { |
1001 | .op_func = (nfsd4op_func)nfsd4_lookupp, | 1018 | .op_func = (nfsd4op_func)nfsd4_lookupp, |
1019 | .op_name = "OP_LOOKUPP", | ||
1002 | }, | 1020 | }, |
1003 | [OP_NVERIFY] = { | 1021 | [OP_NVERIFY] = { |
1004 | .op_func = (nfsd4op_func)nfsd4_nverify, | 1022 | .op_func = (nfsd4op_func)nfsd4_nverify, |
1023 | .op_name = "OP_NVERIFY", | ||
1005 | }, | 1024 | }, |
1006 | [OP_OPEN] = { | 1025 | [OP_OPEN] = { |
1007 | .op_func = (nfsd4op_func)nfsd4_open, | 1026 | .op_func = (nfsd4op_func)nfsd4_open, |
1027 | .op_name = "OP_OPEN", | ||
1008 | }, | 1028 | }, |
1009 | [OP_OPEN_CONFIRM] = { | 1029 | [OP_OPEN_CONFIRM] = { |
1010 | .op_func = (nfsd4op_func)nfsd4_open_confirm, | 1030 | .op_func = (nfsd4op_func)nfsd4_open_confirm, |
1031 | .op_name = "OP_OPEN_CONFIRM", | ||
1011 | }, | 1032 | }, |
1012 | [OP_OPEN_DOWNGRADE] = { | 1033 | [OP_OPEN_DOWNGRADE] = { |
1013 | .op_func = (nfsd4op_func)nfsd4_open_downgrade, | 1034 | .op_func = (nfsd4op_func)nfsd4_open_downgrade, |
1035 | .op_name = "OP_OPEN_DOWNGRADE", | ||
1014 | }, | 1036 | }, |
1015 | [OP_PUTFH] = { | 1037 | [OP_PUTFH] = { |
1016 | .op_func = (nfsd4op_func)nfsd4_putfh, | 1038 | .op_func = (nfsd4op_func)nfsd4_putfh, |
1017 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1039 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1040 | .op_name = "OP_PUTFH", | ||
1018 | }, | 1041 | }, |
1019 | [OP_PUTPUBFH] = { | 1042 | [OP_PUTPUBFH] = { |
1020 | /* unsupported; just for future reference: */ | 1043 | /* unsupported, just for future reference: */ |
1021 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1044 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1045 | .op_name = "OP_PUTPUBFH", | ||
1022 | }, | 1046 | }, |
1023 | [OP_PUTROOTFH] = { | 1047 | [OP_PUTROOTFH] = { |
1024 | .op_func = (nfsd4op_func)nfsd4_putrootfh, | 1048 | .op_func = (nfsd4op_func)nfsd4_putrootfh, |
1025 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1049 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1050 | .op_name = "OP_PUTROOTFH", | ||
1026 | }, | 1051 | }, |
1027 | [OP_READ] = { | 1052 | [OP_READ] = { |
1028 | .op_func = (nfsd4op_func)nfsd4_read, | 1053 | .op_func = (nfsd4op_func)nfsd4_read, |
1054 | .op_name = "OP_READ", | ||
1029 | }, | 1055 | }, |
1030 | [OP_READDIR] = { | 1056 | [OP_READDIR] = { |
1031 | .op_func = (nfsd4op_func)nfsd4_readdir, | 1057 | .op_func = (nfsd4op_func)nfsd4_readdir, |
1058 | .op_name = "OP_READDIR", | ||
1032 | }, | 1059 | }, |
1033 | [OP_READLINK] = { | 1060 | [OP_READLINK] = { |
1034 | .op_func = (nfsd4op_func)nfsd4_readlink, | 1061 | .op_func = (nfsd4op_func)nfsd4_readlink, |
1062 | .op_name = "OP_READLINK", | ||
1035 | }, | 1063 | }, |
1036 | [OP_REMOVE] = { | 1064 | [OP_REMOVE] = { |
1037 | .op_func = (nfsd4op_func)nfsd4_remove, | 1065 | .op_func = (nfsd4op_func)nfsd4_remove, |
1066 | .op_name = "OP_REMOVE", | ||
1038 | }, | 1067 | }, |
1039 | [OP_RENAME] = { | 1068 | [OP_RENAME] = { |
1069 | .op_name = "OP_RENAME", | ||
1040 | .op_func = (nfsd4op_func)nfsd4_rename, | 1070 | .op_func = (nfsd4op_func)nfsd4_rename, |
1041 | }, | 1071 | }, |
1042 | [OP_RENEW] = { | 1072 | [OP_RENEW] = { |
1043 | .op_func = (nfsd4op_func)nfsd4_renew, | 1073 | .op_func = (nfsd4op_func)nfsd4_renew, |
1044 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1074 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1075 | .op_name = "OP_RENEW", | ||
1045 | }, | 1076 | }, |
1046 | [OP_RESTOREFH] = { | 1077 | [OP_RESTOREFH] = { |
1047 | .op_func = (nfsd4op_func)nfsd4_restorefh, | 1078 | .op_func = (nfsd4op_func)nfsd4_restorefh, |
1048 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1079 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1080 | .op_name = "OP_RESTOREFH", | ||
1049 | }, | 1081 | }, |
1050 | [OP_SAVEFH] = { | 1082 | [OP_SAVEFH] = { |
1051 | .op_func = (nfsd4op_func)nfsd4_savefh, | 1083 | .op_func = (nfsd4op_func)nfsd4_savefh, |
1084 | .op_name = "OP_SAVEFH", | ||
1052 | }, | 1085 | }, |
1053 | [OP_SECINFO] = { | 1086 | [OP_SECINFO] = { |
1054 | .op_func = (nfsd4op_func)nfsd4_secinfo, | 1087 | .op_func = (nfsd4op_func)nfsd4_secinfo, |
1088 | .op_name = "OP_SECINFO", | ||
1055 | }, | 1089 | }, |
1056 | [OP_SETATTR] = { | 1090 | [OP_SETATTR] = { |
1057 | .op_func = (nfsd4op_func)nfsd4_setattr, | 1091 | .op_func = (nfsd4op_func)nfsd4_setattr, |
1092 | .op_name = "OP_SETATTR", | ||
1058 | }, | 1093 | }, |
1059 | [OP_SETCLIENTID] = { | 1094 | [OP_SETCLIENTID] = { |
1060 | .op_func = (nfsd4op_func)nfsd4_setclientid, | 1095 | .op_func = (nfsd4op_func)nfsd4_setclientid, |
1061 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1096 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1097 | .op_name = "OP_SETCLIENTID", | ||
1062 | }, | 1098 | }, |
1063 | [OP_SETCLIENTID_CONFIRM] = { | 1099 | [OP_SETCLIENTID_CONFIRM] = { |
1064 | .op_func = (nfsd4op_func)nfsd4_setclientid_confirm, | 1100 | .op_func = (nfsd4op_func)nfsd4_setclientid_confirm, |
1065 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1101 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1102 | .op_name = "OP_SETCLIENTID_CONFIRM", | ||
1066 | }, | 1103 | }, |
1067 | [OP_VERIFY] = { | 1104 | [OP_VERIFY] = { |
1068 | .op_func = (nfsd4op_func)nfsd4_verify, | 1105 | .op_func = (nfsd4op_func)nfsd4_verify, |
1106 | .op_name = "OP_VERIFY", | ||
1069 | }, | 1107 | }, |
1070 | [OP_WRITE] = { | 1108 | [OP_WRITE] = { |
1071 | .op_func = (nfsd4op_func)nfsd4_write, | 1109 | .op_func = (nfsd4op_func)nfsd4_write, |
1110 | .op_name = "OP_WRITE", | ||
1072 | }, | 1111 | }, |
1073 | [OP_RELEASE_LOCKOWNER] = { | 1112 | [OP_RELEASE_LOCKOWNER] = { |
1074 | .op_func = (nfsd4op_func)nfsd4_release_lockowner, | 1113 | .op_func = (nfsd4op_func)nfsd4_release_lockowner, |
1075 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, | 1114 | .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS, |
1115 | .op_name = "OP_RELEASE_LOCKOWNER", | ||
1076 | }, | 1116 | }, |
1077 | }; | 1117 | }; |
1078 | 1118 | ||
1119 | static inline char * | ||
1120 | nfsd4_op_name(unsigned opnum) | ||
1121 | { | ||
1122 | if (opnum < ARRAY_SIZE(nfsd4_ops)) | ||
1123 | return nfsd4_ops[opnum].op_name; | ||
1124 | return "unknown_operation"; | ||
1125 | } | ||
1126 | |||
1079 | #define nfs4svc_decode_voidargs NULL | 1127 | #define nfs4svc_decode_voidargs NULL |
1080 | #define nfs4svc_release_void NULL | 1128 | #define nfs4svc_release_void NULL |
1081 | #define nfsd4_voidres nfsd4_voidargs | 1129 | #define nfsd4_voidres nfsd4_voidargs |