strings.c 4.1 KB

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