Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Ceph fs string constants |
| 3 | */ |
| 4 | #include <linux/module.h> |
| 5 | #include <linux/ceph/types.h> |
| 6 | |
| 7 | |
| 8 | const char *ceph_mds_state_name(int s) |
| 9 | { |
| 10 | switch (s) { |
| 11 | /* down and out */ |
| 12 | case CEPH_MDS_STATE_DNE: return "down:dne"; |
| 13 | case CEPH_MDS_STATE_STOPPED: return "down:stopped"; |
| 14 | /* up and out */ |
| 15 | case CEPH_MDS_STATE_BOOT: return "up:boot"; |
| 16 | case CEPH_MDS_STATE_STANDBY: return "up:standby"; |
| 17 | case CEPH_MDS_STATE_STANDBY_REPLAY: return "up:standby-replay"; |
Alex Elder | 0eb40bf | 2013-02-15 11:42:30 -0600 | [diff] [blame] | 18 | case CEPH_MDS_STATE_REPLAYONCE: return "up:oneshot-replay"; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 19 | case CEPH_MDS_STATE_CREATING: return "up:creating"; |
| 20 | case CEPH_MDS_STATE_STARTING: return "up:starting"; |
| 21 | /* up and in */ |
| 22 | case CEPH_MDS_STATE_REPLAY: return "up:replay"; |
| 23 | case CEPH_MDS_STATE_RESOLVE: return "up:resolve"; |
| 24 | case CEPH_MDS_STATE_RECONNECT: return "up:reconnect"; |
| 25 | case CEPH_MDS_STATE_REJOIN: return "up:rejoin"; |
| 26 | case CEPH_MDS_STATE_CLIENTREPLAY: return "up:clientreplay"; |
| 27 | case CEPH_MDS_STATE_ACTIVE: return "up:active"; |
| 28 | case CEPH_MDS_STATE_STOPPING: return "up:stopping"; |
| 29 | } |
| 30 | return "???"; |
| 31 | } |
| 32 | |
| 33 | const char *ceph_session_op_name(int op) |
| 34 | { |
| 35 | switch (op) { |
| 36 | case CEPH_SESSION_REQUEST_OPEN: return "request_open"; |
| 37 | case CEPH_SESSION_OPEN: return "open"; |
| 38 | case CEPH_SESSION_REQUEST_CLOSE: return "request_close"; |
| 39 | case CEPH_SESSION_CLOSE: return "close"; |
| 40 | case CEPH_SESSION_REQUEST_RENEWCAPS: return "request_renewcaps"; |
| 41 | case CEPH_SESSION_RENEWCAPS: return "renewcaps"; |
| 42 | case CEPH_SESSION_STALE: return "stale"; |
| 43 | case CEPH_SESSION_RECALL_STATE: return "recall_state"; |
Yan, Zheng | 186e4f7 | 2013-11-22 14:48:37 +0800 | [diff] [blame] | 44 | case CEPH_SESSION_FLUSHMSG: return "flushmsg"; |
| 45 | case CEPH_SESSION_FLUSHMSG_ACK: return "flushmsg_ack"; |
Yan, Zheng | fcff415 | 2016-09-14 16:39:51 +0800 | [diff] [blame] | 46 | case CEPH_SESSION_FORCE_RO: return "force_ro"; |
| 47 | case CEPH_SESSION_REJECT: return "reject"; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 48 | } |
| 49 | return "???"; |
| 50 | } |
| 51 | |
| 52 | const char *ceph_mds_op_name(int op) |
| 53 | { |
| 54 | switch (op) { |
| 55 | case CEPH_MDS_OP_LOOKUP: return "lookup"; |
| 56 | case CEPH_MDS_OP_LOOKUPHASH: return "lookuphash"; |
| 57 | case CEPH_MDS_OP_LOOKUPPARENT: return "lookupparent"; |
Alex Elder | 0eb40bf | 2013-02-15 11:42:30 -0600 | [diff] [blame] | 58 | case CEPH_MDS_OP_LOOKUPINO: return "lookupino"; |
Yan, Zheng | 19913b4 | 2014-03-06 16:40:32 +0800 | [diff] [blame] | 59 | case CEPH_MDS_OP_LOOKUPNAME: return "lookupname"; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 60 | case CEPH_MDS_OP_GETATTR: return "getattr"; |
| 61 | case CEPH_MDS_OP_SETXATTR: return "setxattr"; |
| 62 | case CEPH_MDS_OP_SETATTR: return "setattr"; |
| 63 | case CEPH_MDS_OP_RMXATTR: return "rmxattr"; |
Alex Elder | 0eb40bf | 2013-02-15 11:42:30 -0600 | [diff] [blame] | 64 | case CEPH_MDS_OP_SETLAYOUT: return "setlayou"; |
| 65 | case CEPH_MDS_OP_SETDIRLAYOUT: return "setdirlayout"; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 66 | case CEPH_MDS_OP_READDIR: return "readdir"; |
| 67 | case CEPH_MDS_OP_MKNOD: return "mknod"; |
| 68 | case CEPH_MDS_OP_LINK: return "link"; |
| 69 | case CEPH_MDS_OP_UNLINK: return "unlink"; |
| 70 | case CEPH_MDS_OP_RENAME: return "rename"; |
| 71 | case CEPH_MDS_OP_MKDIR: return "mkdir"; |
| 72 | case CEPH_MDS_OP_RMDIR: return "rmdir"; |
| 73 | case CEPH_MDS_OP_SYMLINK: return "symlink"; |
| 74 | case CEPH_MDS_OP_CREATE: return "create"; |
| 75 | case CEPH_MDS_OP_OPEN: return "open"; |
| 76 | case CEPH_MDS_OP_LOOKUPSNAP: return "lookupsnap"; |
| 77 | case CEPH_MDS_OP_LSSNAP: return "lssnap"; |
| 78 | case CEPH_MDS_OP_MKSNAP: return "mksnap"; |
| 79 | case CEPH_MDS_OP_RMSNAP: return "rmsnap"; |
Yan, Zheng | 0ea611a | 2015-04-07 15:36:32 +0800 | [diff] [blame] | 80 | case CEPH_MDS_OP_RENAMESNAP: return "renamesnap"; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 81 | case CEPH_MDS_OP_SETFILELOCK: return "setfilelock"; |
| 82 | case CEPH_MDS_OP_GETFILELOCK: return "getfilelock"; |
| 83 | } |
| 84 | return "???"; |
| 85 | } |
| 86 | |
| 87 | const char *ceph_cap_op_name(int op) |
| 88 | { |
| 89 | switch (op) { |
| 90 | case CEPH_CAP_OP_GRANT: return "grant"; |
| 91 | case CEPH_CAP_OP_REVOKE: return "revoke"; |
| 92 | case CEPH_CAP_OP_TRUNC: return "trunc"; |
| 93 | case CEPH_CAP_OP_EXPORT: return "export"; |
| 94 | case CEPH_CAP_OP_IMPORT: return "import"; |
| 95 | case CEPH_CAP_OP_UPDATE: return "update"; |
| 96 | case CEPH_CAP_OP_DROP: return "drop"; |
| 97 | case CEPH_CAP_OP_FLUSH: return "flush"; |
| 98 | case CEPH_CAP_OP_FLUSH_ACK: return "flush_ack"; |
| 99 | case CEPH_CAP_OP_FLUSHSNAP: return "flushsnap"; |
| 100 | case CEPH_CAP_OP_FLUSHSNAP_ACK: return "flushsnap_ack"; |
| 101 | case CEPH_CAP_OP_RELEASE: return "release"; |
| 102 | case CEPH_CAP_OP_RENEW: return "renew"; |
| 103 | } |
| 104 | return "???"; |
| 105 | } |
| 106 | |
| 107 | const char *ceph_lease_op_name(int o) |
| 108 | { |
| 109 | switch (o) { |
| 110 | case CEPH_MDS_LEASE_REVOKE: return "revoke"; |
| 111 | case CEPH_MDS_LEASE_RELEASE: return "release"; |
| 112 | case CEPH_MDS_LEASE_RENEW: return "renew"; |
| 113 | case CEPH_MDS_LEASE_REVOKE_ACK: return "revoke_ack"; |
| 114 | } |
| 115 | return "???"; |
| 116 | } |
| 117 | |
| 118 | const char *ceph_snap_op_name(int o) |
| 119 | { |
| 120 | switch (o) { |
| 121 | case CEPH_SNAP_OP_UPDATE: return "update"; |
| 122 | case CEPH_SNAP_OP_CREATE: return "create"; |
| 123 | case CEPH_SNAP_OP_DESTROY: return "destroy"; |
| 124 | case CEPH_SNAP_OP_SPLIT: return "split"; |
| 125 | } |
| 126 | return "???"; |
| 127 | } |