diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2010-04-06 18:14:15 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-10-20 18:37:28 -0400 |
commit | 3d14c5d2b6e15c21d8e5467dc62d33127c23a644 (patch) | |
tree | 7d123c47847df9d1e865b6b78dc7da3fe739b704 /fs/ceph/ceph_strings.c | |
parent | ae1533b62b3369e6ae32338f4a77d64d0e88f676 (diff) |
ceph: factor out libceph from Ceph file system
This factors out protocol and low-level storage parts of ceph into a
separate libceph module living in net/ceph and include/linux/ceph. This
is mostly a matter of moving files around. However, a few key pieces
of the interface change as well:
- ceph_client becomes ceph_fs_client and ceph_client, where the latter
captures the mon and osd clients, and the fs_client gets the mds client
and file system specific pieces.
- Mount option parsing and debugfs setup is correspondingly broken into
two pieces.
- The mon client gets a generic handler callback for otherwise unknown
messages (mds map, in this case).
- The basic supported/required feature bits can be expanded (and are by
ceph_fs_client).
No functional change, aside from some subtle error handling cases that got
cleaned up in the refactoring process.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/ceph_strings.c')
-rw-r--r-- | fs/ceph/ceph_strings.c | 193 |
1 files changed, 0 insertions, 193 deletions
diff --git a/fs/ceph/ceph_strings.c b/fs/ceph/ceph_strings.c deleted file mode 100644 index c6179d3a26a2..000000000000 --- a/fs/ceph/ceph_strings.c +++ /dev/null | |||
@@ -1,193 +0,0 @@ | |||
1 | /* | ||
2 | * Ceph string constants | ||
3 | */ | ||
4 | #include "types.h" | ||
5 | |||
6 | const char *ceph_entity_type_name(int type) | ||
7 | { | ||
8 | switch (type) { | ||
9 | case CEPH_ENTITY_TYPE_MDS: return "mds"; | ||
10 | case CEPH_ENTITY_TYPE_OSD: return "osd"; | ||
11 | case CEPH_ENTITY_TYPE_MON: return "mon"; | ||
12 | case CEPH_ENTITY_TYPE_CLIENT: return "client"; | ||
13 | case CEPH_ENTITY_TYPE_AUTH: return "auth"; | ||
14 | default: return "unknown"; | ||
15 | } | ||
16 | } | ||
17 | |||
18 | const char *ceph_osd_op_name(int op) | ||
19 | { | ||
20 | switch (op) { | ||
21 | case CEPH_OSD_OP_READ: return "read"; | ||
22 | case CEPH_OSD_OP_STAT: return "stat"; | ||
23 | |||
24 | case CEPH_OSD_OP_MASKTRUNC: return "masktrunc"; | ||
25 | |||
26 | case CEPH_OSD_OP_WRITE: return "write"; | ||
27 | case CEPH_OSD_OP_DELETE: return "delete"; | ||
28 | case CEPH_OSD_OP_TRUNCATE: return "truncate"; | ||
29 | case CEPH_OSD_OP_ZERO: return "zero"; | ||
30 | case CEPH_OSD_OP_WRITEFULL: return "writefull"; | ||
31 | case CEPH_OSD_OP_ROLLBACK: return "rollback"; | ||
32 | |||
33 | case CEPH_OSD_OP_APPEND: return "append"; | ||
34 | case CEPH_OSD_OP_STARTSYNC: return "startsync"; | ||
35 | case CEPH_OSD_OP_SETTRUNC: return "settrunc"; | ||
36 | case CEPH_OSD_OP_TRIMTRUNC: return "trimtrunc"; | ||
37 | |||
38 | case CEPH_OSD_OP_TMAPUP: return "tmapup"; | ||
39 | case CEPH_OSD_OP_TMAPGET: return "tmapget"; | ||
40 | case CEPH_OSD_OP_TMAPPUT: return "tmapput"; | ||
41 | |||
42 | case CEPH_OSD_OP_GETXATTR: return "getxattr"; | ||
43 | case CEPH_OSD_OP_GETXATTRS: return "getxattrs"; | ||
44 | case CEPH_OSD_OP_SETXATTR: return "setxattr"; | ||
45 | case CEPH_OSD_OP_SETXATTRS: return "setxattrs"; | ||
46 | case CEPH_OSD_OP_RESETXATTRS: return "resetxattrs"; | ||
47 | case CEPH_OSD_OP_RMXATTR: return "rmxattr"; | ||
48 | case CEPH_OSD_OP_CMPXATTR: return "cmpxattr"; | ||
49 | |||
50 | case CEPH_OSD_OP_PULL: return "pull"; | ||
51 | case CEPH_OSD_OP_PUSH: return "push"; | ||
52 | case CEPH_OSD_OP_BALANCEREADS: return "balance-reads"; | ||
53 | case CEPH_OSD_OP_UNBALANCEREADS: return "unbalance-reads"; | ||
54 | case CEPH_OSD_OP_SCRUB: return "scrub"; | ||
55 | |||
56 | case CEPH_OSD_OP_WRLOCK: return "wrlock"; | ||
57 | case CEPH_OSD_OP_WRUNLOCK: return "wrunlock"; | ||
58 | case CEPH_OSD_OP_RDLOCK: return "rdlock"; | ||
59 | case CEPH_OSD_OP_RDUNLOCK: return "rdunlock"; | ||
60 | case CEPH_OSD_OP_UPLOCK: return "uplock"; | ||
61 | case CEPH_OSD_OP_DNLOCK: return "dnlock"; | ||
62 | |||
63 | case CEPH_OSD_OP_CALL: return "call"; | ||
64 | |||
65 | case CEPH_OSD_OP_PGLS: return "pgls"; | ||
66 | } | ||
67 | return "???"; | ||
68 | } | ||
69 | |||
70 | const char *ceph_mds_state_name(int s) | ||
71 | { | ||
72 | switch (s) { | ||
73 | /* down and out */ | ||
74 | case CEPH_MDS_STATE_DNE: return "down:dne"; | ||
75 | case CEPH_MDS_STATE_STOPPED: return "down:stopped"; | ||
76 | /* up and out */ | ||
77 | case CEPH_MDS_STATE_BOOT: return "up:boot"; | ||
78 | case CEPH_MDS_STATE_STANDBY: return "up:standby"; | ||
79 | case CEPH_MDS_STATE_STANDBY_REPLAY: return "up:standby-replay"; | ||
80 | case CEPH_MDS_STATE_CREATING: return "up:creating"; | ||
81 | case CEPH_MDS_STATE_STARTING: return "up:starting"; | ||
82 | /* up and in */ | ||
83 | case CEPH_MDS_STATE_REPLAY: return "up:replay"; | ||
84 | case CEPH_MDS_STATE_RESOLVE: return "up:resolve"; | ||
85 | case CEPH_MDS_STATE_RECONNECT: return "up:reconnect"; | ||
86 | case CEPH_MDS_STATE_REJOIN: return "up:rejoin"; | ||
87 | case CEPH_MDS_STATE_CLIENTREPLAY: return "up:clientreplay"; | ||
88 | case CEPH_MDS_STATE_ACTIVE: return "up:active"; | ||
89 | case CEPH_MDS_STATE_STOPPING: return "up:stopping"; | ||
90 | } | ||
91 | return "???"; | ||
92 | } | ||
93 | |||
94 | const char *ceph_session_op_name(int op) | ||
95 | { | ||
96 | switch (op) { | ||
97 | case CEPH_SESSION_REQUEST_OPEN: return "request_open"; | ||
98 | case CEPH_SESSION_OPEN: return "open"; | ||
99 | case CEPH_SESSION_REQUEST_CLOSE: return "request_close"; | ||
100 | case CEPH_SESSION_CLOSE: return "close"; | ||
101 | case CEPH_SESSION_REQUEST_RENEWCAPS: return "request_renewcaps"; | ||
102 | case CEPH_SESSION_RENEWCAPS: return "renewcaps"; | ||
103 | case CEPH_SESSION_STALE: return "stale"; | ||
104 | case CEPH_SESSION_RECALL_STATE: return "recall_state"; | ||
105 | } | ||
106 | return "???"; | ||
107 | } | ||
108 | |||
109 | const char *ceph_mds_op_name(int op) | ||
110 | { | ||
111 | switch (op) { | ||
112 | case CEPH_MDS_OP_LOOKUP: return "lookup"; | ||
113 | case CEPH_MDS_OP_LOOKUPHASH: return "lookuphash"; | ||
114 | case CEPH_MDS_OP_LOOKUPPARENT: return "lookupparent"; | ||
115 | case CEPH_MDS_OP_GETATTR: return "getattr"; | ||
116 | case CEPH_MDS_OP_SETXATTR: return "setxattr"; | ||
117 | case CEPH_MDS_OP_SETATTR: return "setattr"; | ||
118 | case CEPH_MDS_OP_RMXATTR: return "rmxattr"; | ||
119 | case CEPH_MDS_OP_READDIR: return "readdir"; | ||
120 | case CEPH_MDS_OP_MKNOD: return "mknod"; | ||
121 | case CEPH_MDS_OP_LINK: return "link"; | ||
122 | case CEPH_MDS_OP_UNLINK: return "unlink"; | ||
123 | case CEPH_MDS_OP_RENAME: return "rename"; | ||
124 | case CEPH_MDS_OP_MKDIR: return "mkdir"; | ||
125 | case CEPH_MDS_OP_RMDIR: return "rmdir"; | ||
126 | case CEPH_MDS_OP_SYMLINK: return "symlink"; | ||
127 | case CEPH_MDS_OP_CREATE: return "create"; | ||
128 | case CEPH_MDS_OP_OPEN: return "open"; | ||
129 | case CEPH_MDS_OP_LOOKUPSNAP: return "lookupsnap"; | ||
130 | case CEPH_MDS_OP_LSSNAP: return "lssnap"; | ||
131 | case CEPH_MDS_OP_MKSNAP: return "mksnap"; | ||
132 | case CEPH_MDS_OP_RMSNAP: return "rmsnap"; | ||
133 | case CEPH_MDS_OP_SETFILELOCK: return "setfilelock"; | ||
134 | case CEPH_MDS_OP_GETFILELOCK: return "getfilelock"; | ||
135 | } | ||
136 | return "???"; | ||
137 | } | ||
138 | |||
139 | const char *ceph_cap_op_name(int op) | ||
140 | { | ||
141 | switch (op) { | ||
142 | case CEPH_CAP_OP_GRANT: return "grant"; | ||
143 | case CEPH_CAP_OP_REVOKE: return "revoke"; | ||
144 | case CEPH_CAP_OP_TRUNC: return "trunc"; | ||
145 | case CEPH_CAP_OP_EXPORT: return "export"; | ||
146 | case CEPH_CAP_OP_IMPORT: return "import"; | ||
147 | case CEPH_CAP_OP_UPDATE: return "update"; | ||
148 | case CEPH_CAP_OP_DROP: return "drop"; | ||
149 | case CEPH_CAP_OP_FLUSH: return "flush"; | ||
150 | case CEPH_CAP_OP_FLUSH_ACK: return "flush_ack"; | ||
151 | case CEPH_CAP_OP_FLUSHSNAP: return "flushsnap"; | ||
152 | case CEPH_CAP_OP_FLUSHSNAP_ACK: return "flushsnap_ack"; | ||
153 | case CEPH_CAP_OP_RELEASE: return "release"; | ||
154 | case CEPH_CAP_OP_RENEW: return "renew"; | ||
155 | } | ||
156 | return "???"; | ||
157 | } | ||
158 | |||
159 | const char *ceph_lease_op_name(int o) | ||
160 | { | ||
161 | switch (o) { | ||
162 | case CEPH_MDS_LEASE_REVOKE: return "revoke"; | ||
163 | case CEPH_MDS_LEASE_RELEASE: return "release"; | ||
164 | case CEPH_MDS_LEASE_RENEW: return "renew"; | ||
165 | case CEPH_MDS_LEASE_REVOKE_ACK: return "revoke_ack"; | ||
166 | } | ||
167 | return "???"; | ||
168 | } | ||
169 | |||
170 | const char *ceph_snap_op_name(int o) | ||
171 | { | ||
172 | switch (o) { | ||
173 | case CEPH_SNAP_OP_UPDATE: return "update"; | ||
174 | case CEPH_SNAP_OP_CREATE: return "create"; | ||
175 | case CEPH_SNAP_OP_DESTROY: return "destroy"; | ||
176 | case CEPH_SNAP_OP_SPLIT: return "split"; | ||
177 | } | ||
178 | return "???"; | ||
179 | } | ||
180 | |||
181 | const char *ceph_pool_op_name(int op) | ||
182 | { | ||
183 | switch (op) { | ||
184 | case POOL_OP_CREATE: return "create"; | ||
185 | case POOL_OP_DELETE: return "delete"; | ||
186 | case POOL_OP_AUID_CHANGE: return "auid change"; | ||
187 | case POOL_OP_CREATE_SNAP: return "create snap"; | ||
188 | case POOL_OP_DELETE_SNAP: return "delete snap"; | ||
189 | case POOL_OP_CREATE_UNMANAGED_SNAP: return "create unmanaged snap"; | ||
190 | case POOL_OP_DELETE_UNMANAGED_SNAP: return "delete unmanaged snap"; | ||
191 | } | ||
192 | return "???"; | ||
193 | } | ||