diff options
author | Ilya Dryomov <idryomov@redhat.com> | 2014-10-02 09:22:29 -0400 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-10-14 15:57:02 -0400 |
commit | 70b5bfa360aea4157b45c2863746ca67896c6ef1 (patch) | |
tree | 3993bf80ea7b6e6a0fc7f2b079b4fd7a68cc2c8b /net/ceph | |
parent | eb179d3975c804ad98eaa403425eb6e48cfd3cc2 (diff) |
libceph: sync osd op definitions in rados.h
Bring in missing osd ops and strings, use macros to eliminate multiple
points of maintenance.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/ceph_strings.c | 75 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 65 |
2 files changed, 8 insertions, 132 deletions
diff --git a/net/ceph/ceph_strings.c b/net/ceph/ceph_strings.c index 1348df96fe15..30560202f57b 100644 --- a/net/ceph/ceph_strings.c +++ b/net/ceph/ceph_strings.c | |||
@@ -19,77 +19,12 @@ const char *ceph_entity_type_name(int type) | |||
19 | const char *ceph_osd_op_name(int op) | 19 | const char *ceph_osd_op_name(int op) |
20 | { | 20 | { |
21 | switch (op) { | 21 | switch (op) { |
22 | case CEPH_OSD_OP_READ: return "read"; | 22 | #define GENERATE_CASE(op, opcode, str) case CEPH_OSD_OP_##op: return (str); |
23 | case CEPH_OSD_OP_STAT: return "stat"; | 23 | __CEPH_FORALL_OSD_OPS(GENERATE_CASE) |
24 | case CEPH_OSD_OP_MAPEXT: return "mapext"; | 24 | #undef GENERATE_CASE |
25 | case CEPH_OSD_OP_SPARSE_READ: return "sparse-read"; | 25 | default: |
26 | case CEPH_OSD_OP_NOTIFY: return "notify"; | 26 | return "???"; |
27 | case CEPH_OSD_OP_NOTIFY_ACK: return "notify-ack"; | ||
28 | case CEPH_OSD_OP_ASSERT_VER: return "assert-version"; | ||
29 | |||
30 | case CEPH_OSD_OP_MASKTRUNC: return "masktrunc"; | ||
31 | |||
32 | case CEPH_OSD_OP_CREATE: return "create"; | ||
33 | case CEPH_OSD_OP_WRITE: return "write"; | ||
34 | case CEPH_OSD_OP_DELETE: return "delete"; | ||
35 | case CEPH_OSD_OP_TRUNCATE: return "truncate"; | ||
36 | case CEPH_OSD_OP_ZERO: return "zero"; | ||
37 | case CEPH_OSD_OP_WRITEFULL: return "writefull"; | ||
38 | case CEPH_OSD_OP_ROLLBACK: return "rollback"; | ||
39 | |||
40 | case CEPH_OSD_OP_APPEND: return "append"; | ||
41 | case CEPH_OSD_OP_STARTSYNC: return "startsync"; | ||
42 | case CEPH_OSD_OP_SETTRUNC: return "settrunc"; | ||
43 | case CEPH_OSD_OP_TRIMTRUNC: return "trimtrunc"; | ||
44 | |||
45 | case CEPH_OSD_OP_TMAPUP: return "tmapup"; | ||
46 | case CEPH_OSD_OP_TMAPGET: return "tmapget"; | ||
47 | case CEPH_OSD_OP_TMAPPUT: return "tmapput"; | ||
48 | case CEPH_OSD_OP_WATCH: return "watch"; | ||
49 | |||
50 | case CEPH_OSD_OP_CLONERANGE: return "clonerange"; | ||
51 | case CEPH_OSD_OP_ASSERT_SRC_VERSION: return "assert-src-version"; | ||
52 | case CEPH_OSD_OP_SRC_CMPXATTR: return "src-cmpxattr"; | ||
53 | |||
54 | case CEPH_OSD_OP_GETXATTR: return "getxattr"; | ||
55 | case CEPH_OSD_OP_GETXATTRS: return "getxattrs"; | ||
56 | case CEPH_OSD_OP_SETXATTR: return "setxattr"; | ||
57 | case CEPH_OSD_OP_SETXATTRS: return "setxattrs"; | ||
58 | case CEPH_OSD_OP_RESETXATTRS: return "resetxattrs"; | ||
59 | case CEPH_OSD_OP_RMXATTR: return "rmxattr"; | ||
60 | case CEPH_OSD_OP_CMPXATTR: return "cmpxattr"; | ||
61 | |||
62 | case CEPH_OSD_OP_PULL: return "pull"; | ||
63 | case CEPH_OSD_OP_PUSH: return "push"; | ||
64 | case CEPH_OSD_OP_BALANCEREADS: return "balance-reads"; | ||
65 | case CEPH_OSD_OP_UNBALANCEREADS: return "unbalance-reads"; | ||
66 | case CEPH_OSD_OP_SCRUB: return "scrub"; | ||
67 | case CEPH_OSD_OP_SCRUB_RESERVE: return "scrub-reserve"; | ||
68 | case CEPH_OSD_OP_SCRUB_UNRESERVE: return "scrub-unreserve"; | ||
69 | case CEPH_OSD_OP_SCRUB_STOP: return "scrub-stop"; | ||
70 | case CEPH_OSD_OP_SCRUB_MAP: return "scrub-map"; | ||
71 | |||
72 | case CEPH_OSD_OP_WRLOCK: return "wrlock"; | ||
73 | case CEPH_OSD_OP_WRUNLOCK: return "wrunlock"; | ||
74 | case CEPH_OSD_OP_RDLOCK: return "rdlock"; | ||
75 | case CEPH_OSD_OP_RDUNLOCK: return "rdunlock"; | ||
76 | case CEPH_OSD_OP_UPLOCK: return "uplock"; | ||
77 | case CEPH_OSD_OP_DNLOCK: return "dnlock"; | ||
78 | |||
79 | case CEPH_OSD_OP_CALL: return "call"; | ||
80 | |||
81 | case CEPH_OSD_OP_PGLS: return "pgls"; | ||
82 | case CEPH_OSD_OP_PGLS_FILTER: return "pgls-filter"; | ||
83 | case CEPH_OSD_OP_OMAPGETKEYS: return "omap-get-keys"; | ||
84 | case CEPH_OSD_OP_OMAPGETVALS: return "omap-get-vals"; | ||
85 | case CEPH_OSD_OP_OMAPGETHEADER: return "omap-get-header"; | ||
86 | case CEPH_OSD_OP_OMAPGETVALSBYKEYS: return "omap-get-vals-by-keys"; | ||
87 | case CEPH_OSD_OP_OMAPSETVALS: return "omap-set-vals"; | ||
88 | case CEPH_OSD_OP_OMAPSETHEADER: return "omap-set-header"; | ||
89 | case CEPH_OSD_OP_OMAPCLEAR: return "omap-clear"; | ||
90 | case CEPH_OSD_OP_OMAPRMKEYS: return "omap-rm-keys"; | ||
91 | } | 27 | } |
92 | return "???"; | ||
93 | } | 28 | } |
94 | 29 | ||
95 | const char *ceph_osd_state_name(int s) | 30 | const char *ceph_osd_state_name(int s) |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index a528ea34253a..f3fc54eac09d 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -431,68 +431,9 @@ EXPORT_SYMBOL(ceph_osdc_alloc_request); | |||
431 | static bool osd_req_opcode_valid(u16 opcode) | 431 | static bool osd_req_opcode_valid(u16 opcode) |
432 | { | 432 | { |
433 | switch (opcode) { | 433 | switch (opcode) { |
434 | case CEPH_OSD_OP_READ: | 434 | #define GENERATE_CASE(op, opcode, str) case CEPH_OSD_OP_##op: return true; |
435 | case CEPH_OSD_OP_STAT: | 435 | __CEPH_FORALL_OSD_OPS(GENERATE_CASE) |
436 | case CEPH_OSD_OP_MAPEXT: | 436 | #undef GENERATE_CASE |
437 | case CEPH_OSD_OP_MASKTRUNC: | ||
438 | case CEPH_OSD_OP_SPARSE_READ: | ||
439 | case CEPH_OSD_OP_NOTIFY: | ||
440 | case CEPH_OSD_OP_NOTIFY_ACK: | ||
441 | case CEPH_OSD_OP_ASSERT_VER: | ||
442 | case CEPH_OSD_OP_WRITE: | ||
443 | case CEPH_OSD_OP_WRITEFULL: | ||
444 | case CEPH_OSD_OP_TRUNCATE: | ||
445 | case CEPH_OSD_OP_ZERO: | ||
446 | case CEPH_OSD_OP_DELETE: | ||
447 | case CEPH_OSD_OP_APPEND: | ||
448 | case CEPH_OSD_OP_STARTSYNC: | ||
449 | case CEPH_OSD_OP_SETTRUNC: | ||
450 | case CEPH_OSD_OP_TRIMTRUNC: | ||
451 | case CEPH_OSD_OP_TMAPUP: | ||
452 | case CEPH_OSD_OP_TMAPPUT: | ||
453 | case CEPH_OSD_OP_TMAPGET: | ||
454 | case CEPH_OSD_OP_CREATE: | ||
455 | case CEPH_OSD_OP_ROLLBACK: | ||
456 | case CEPH_OSD_OP_WATCH: | ||
457 | case CEPH_OSD_OP_OMAPGETKEYS: | ||
458 | case CEPH_OSD_OP_OMAPGETVALS: | ||
459 | case CEPH_OSD_OP_OMAPGETHEADER: | ||
460 | case CEPH_OSD_OP_OMAPGETVALSBYKEYS: | ||
461 | case CEPH_OSD_OP_OMAPSETVALS: | ||
462 | case CEPH_OSD_OP_OMAPSETHEADER: | ||
463 | case CEPH_OSD_OP_OMAPCLEAR: | ||
464 | case CEPH_OSD_OP_OMAPRMKEYS: | ||
465 | case CEPH_OSD_OP_OMAP_CMP: | ||
466 | case CEPH_OSD_OP_SETALLOCHINT: | ||
467 | case CEPH_OSD_OP_CLONERANGE: | ||
468 | case CEPH_OSD_OP_ASSERT_SRC_VERSION: | ||
469 | case CEPH_OSD_OP_SRC_CMPXATTR: | ||
470 | case CEPH_OSD_OP_GETXATTR: | ||
471 | case CEPH_OSD_OP_GETXATTRS: | ||
472 | case CEPH_OSD_OP_CMPXATTR: | ||
473 | case CEPH_OSD_OP_SETXATTR: | ||
474 | case CEPH_OSD_OP_SETXATTRS: | ||
475 | case CEPH_OSD_OP_RESETXATTRS: | ||
476 | case CEPH_OSD_OP_RMXATTR: | ||
477 | case CEPH_OSD_OP_PULL: | ||
478 | case CEPH_OSD_OP_PUSH: | ||
479 | case CEPH_OSD_OP_BALANCEREADS: | ||
480 | case CEPH_OSD_OP_UNBALANCEREADS: | ||
481 | case CEPH_OSD_OP_SCRUB: | ||
482 | case CEPH_OSD_OP_SCRUB_RESERVE: | ||
483 | case CEPH_OSD_OP_SCRUB_UNRESERVE: | ||
484 | case CEPH_OSD_OP_SCRUB_STOP: | ||
485 | case CEPH_OSD_OP_SCRUB_MAP: | ||
486 | case CEPH_OSD_OP_WRLOCK: | ||
487 | case CEPH_OSD_OP_WRUNLOCK: | ||
488 | case CEPH_OSD_OP_RDLOCK: | ||
489 | case CEPH_OSD_OP_RDUNLOCK: | ||
490 | case CEPH_OSD_OP_UPLOCK: | ||
491 | case CEPH_OSD_OP_DNLOCK: | ||
492 | case CEPH_OSD_OP_CALL: | ||
493 | case CEPH_OSD_OP_PGLS: | ||
494 | case CEPH_OSD_OP_PGLS_FILTER: | ||
495 | return true; | ||
496 | default: | 437 | default: |
497 | return false; | 438 | return false; |
498 | } | 439 | } |