ceph_strings.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Ceph string constants
  3. */
  4. #include <linux/module.h>
  5. #include <linux/ceph/types.h>
  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. const char *ceph_osd_op_name(int op)
  18. {
  19. switch (op) {
  20. case CEPH_OSD_OP_READ: return "read";
  21. case CEPH_OSD_OP_STAT: return "stat";
  22. case CEPH_OSD_OP_MASKTRUNC: return "masktrunc";
  23. case CEPH_OSD_OP_WRITE: return "write";
  24. case CEPH_OSD_OP_DELETE: return "delete";
  25. case CEPH_OSD_OP_TRUNCATE: return "truncate";
  26. case CEPH_OSD_OP_ZERO: return "zero";
  27. case CEPH_OSD_OP_WRITEFULL: return "writefull";
  28. case CEPH_OSD_OP_ROLLBACK: return "rollback";
  29. case CEPH_OSD_OP_APPEND: return "append";
  30. case CEPH_OSD_OP_STARTSYNC: return "startsync";
  31. case CEPH_OSD_OP_SETTRUNC: return "settrunc";
  32. case CEPH_OSD_OP_TRIMTRUNC: return "trimtrunc";
  33. case CEPH_OSD_OP_TMAPUP: return "tmapup";
  34. case CEPH_OSD_OP_TMAPGET: return "tmapget";
  35. case CEPH_OSD_OP_TMAPPUT: return "tmapput";
  36. case CEPH_OSD_OP_GETXATTR: return "getxattr";
  37. case CEPH_OSD_OP_GETXATTRS: return "getxattrs";
  38. case CEPH_OSD_OP_SETXATTR: return "setxattr";
  39. case CEPH_OSD_OP_SETXATTRS: return "setxattrs";
  40. case CEPH_OSD_OP_RESETXATTRS: return "resetxattrs";
  41. case CEPH_OSD_OP_RMXATTR: return "rmxattr";
  42. case CEPH_OSD_OP_CMPXATTR: return "cmpxattr";
  43. case CEPH_OSD_OP_PULL: return "pull";
  44. case CEPH_OSD_OP_PUSH: return "push";
  45. case CEPH_OSD_OP_BALANCEREADS: return "balance-reads";
  46. case CEPH_OSD_OP_UNBALANCEREADS: return "unbalance-reads";
  47. case CEPH_OSD_OP_SCRUB: return "scrub";
  48. case CEPH_OSD_OP_WRLOCK: return "wrlock";
  49. case CEPH_OSD_OP_WRUNLOCK: return "wrunlock";
  50. case CEPH_OSD_OP_RDLOCK: return "rdlock";
  51. case CEPH_OSD_OP_RDUNLOCK: return "rdunlock";
  52. case CEPH_OSD_OP_UPLOCK: return "uplock";
  53. case CEPH_OSD_OP_DNLOCK: return "dnlock";
  54. case CEPH_OSD_OP_CALL: return "call";
  55. case CEPH_OSD_OP_PGLS: return "pgls";
  56. }
  57. return "???";
  58. }
  59. const char *ceph_pool_op_name(int op)
  60. {
  61. switch (op) {
  62. case POOL_OP_CREATE: return "create";
  63. case POOL_OP_DELETE: return "delete";
  64. case POOL_OP_AUID_CHANGE: return "auid change";
  65. case POOL_OP_CREATE_SNAP: return "create snap";
  66. case POOL_OP_DELETE_SNAP: return "delete snap";
  67. case POOL_OP_CREATE_UNMANAGED_SNAP: return "create unmanaged snap";
  68. case POOL_OP_DELETE_UNMANAGED_SNAP: return "delete unmanaged snap";
  69. }
  70. return "???";
  71. }