Skip to content

Commit

Permalink
libceph: add ceph_osd_state_name()
Browse files Browse the repository at this point in the history
Add the definition of ceph_osd_state_name(), to match its
counterpart in user space.

Signed-off-by: Alex Elder <[email protected]>
Reviewed-by: Josh Durgin <[email protected]>
  • Loading branch information
Alex Elder committed Feb 18, 2013
1 parent 0315a77 commit 4b568b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/ceph/rados.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ struct ceph_eversion {
#define CEPH_OSD_AUTOOUT (1<<2) /* osd was automatically marked out */
#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" */
#define CEPH_OSD_IN 0x10000
#define CEPH_OSD_OUT 0
Expand Down
15 changes: 15 additions & 0 deletions net/ceph/ceph_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ const char *ceph_osd_op_name(int op)
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)
{
Expand Down

0 comments on commit 4b568b1

Please sign in to comment.