ceph_strings.c 866 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define GENERATE_CASE(op, opcode, str) case CEPH_OSD_OP_##op: return (str);
  21. __CEPH_FORALL_OSD_OPS(GENERATE_CASE)
  22. #undef GENERATE_CASE
  23. default:
  24. return "???";
  25. }
  26. }
  27. const char *ceph_osd_state_name(int s)
  28. {
  29. switch (s) {
  30. case CEPH_OSD_EXISTS:
  31. return "exists";
  32. case CEPH_OSD_UP:
  33. return "up";
  34. case CEPH_OSD_AUTOOUT:
  35. return "autoout";
  36. case CEPH_OSD_NEW:
  37. return "new";
  38. default:
  39. return "???";
  40. }
  41. }