Commit 4b568b1a authored by Alex Elder's avatar Alex Elder

libceph: add ceph_osd_state_name()

Add the definition of ceph_osd_state_name(), to match its
counterpart in user space.
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 0315a777
...@@ -150,6 +150,8 @@ struct ceph_eversion { ...@@ -150,6 +150,8 @@ struct ceph_eversion {
#define CEPH_OSD_AUTOOUT (1<<2) /* osd was automatically marked out */ #define CEPH_OSD_AUTOOUT (1<<2) /* osd was automatically marked out */
#define CEPH_OSD_NEW (1<<3) /* osd is new, never marked in */ #define CEPH_OSD_NEW (1<<3) /* osd is new, never marked in */
extern const char *ceph_osd_state_name(int s);
/* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */ /* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */
#define CEPH_OSD_IN 0x10000 #define CEPH_OSD_IN 0x10000
#define CEPH_OSD_OUT 0 #define CEPH_OSD_OUT 0
......
...@@ -68,6 +68,21 @@ const char *ceph_osd_op_name(int op) ...@@ -68,6 +68,21 @@ const char *ceph_osd_op_name(int op)
return "???"; return "???";
} }
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 "???";
}
}
const char *ceph_pool_op_name(int op) const char *ceph_pool_op_name(int op)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment