2010-04-06 22:14:15 +00:00
|
|
|
/*
|
|
|
|
* Ceph string constants
|
|
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/ceph/types.h>
|
|
|
|
|
|
|
|
const char *ceph_entity_type_name(int type)
|
|
|
|
{
|
|
|
|
switch (type) {
|
|
|
|
case CEPH_ENTITY_TYPE_MDS: return "mds";
|
|
|
|
case CEPH_ENTITY_TYPE_OSD: return "osd";
|
|
|
|
case CEPH_ENTITY_TYPE_MON: return "mon";
|
|
|
|
case CEPH_ENTITY_TYPE_CLIENT: return "client";
|
|
|
|
case CEPH_ENTITY_TYPE_AUTH: return "auth";
|
|
|
|
default: return "unknown";
|
|
|
|
}
|
|
|
|
}
|
2016-08-12 14:40:02 +00:00
|
|
|
EXPORT_SYMBOL(ceph_entity_type_name);
|
2010-04-06 22:14:15 +00:00
|
|
|
|
|
|
|
const char *ceph_osd_op_name(int op)
|
|
|
|
{
|
|
|
|
switch (op) {
|
2014-10-02 13:22:29 +00:00
|
|
|
#define GENERATE_CASE(op, opcode, str) case CEPH_OSD_OP_##op: return (str);
|
|
|
|
__CEPH_FORALL_OSD_OPS(GENERATE_CASE)
|
|
|
|
#undef GENERATE_CASE
|
|
|
|
default:
|
|
|
|
return "???";
|
2010-04-06 22:14:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-25 23:15:02 +00:00
|
|
|
const char *ceph_osd_watch_op_name(int o)
|
|
|
|
{
|
|
|
|
switch (o) {
|
|
|
|
case CEPH_OSD_WATCH_OP_UNWATCH:
|
|
|
|
return "unwatch";
|
|
|
|
case CEPH_OSD_WATCH_OP_WATCH:
|
|
|
|
return "watch";
|
|
|
|
case CEPH_OSD_WATCH_OP_RECONNECT:
|
|
|
|
return "reconnect";
|
|
|
|
case CEPH_OSD_WATCH_OP_PING:
|
|
|
|
return "ping";
|
|
|
|
default:
|
|
|
|
return "???";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-15 17:42:30 +00:00
|
|
|
const char *ceph_osd_state_name(int s)
|
|
|
|
{
|
|
|
|
switch (s) {
|
|
|
|
case CEPH_OSD_EXISTS:
|
|
|
|
return "exists";
|
|
|
|
case CEPH_OSD_UP:
|
|
|
|
return "up";
|
|
|
|
case CEPH_OSD_AUTOOUT:
|
|
|
|
return "autoout";
|
|
|
|
case CEPH_OSD_NEW:
|
|
|
|
return "new";
|
|
|
|
default:
|
|
|
|
return "???";
|
|
|
|
}
|
|
|
|
}
|