From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 2/3] libceph: add ceph_osd_state_name()
Date: Sat, 16 Feb 2013 10:57:27 -0600 [thread overview]
Message-ID: <511FBA77.3040104@inktank.com> (raw)
In-Reply-To: <511FBA36.4020407@inktank.com>
Add the definition of ceph_osd_state_name(), to match its
counterpart in user space.
Signed-off-by: Alex Elder <elder@inktank.com>
---
include/linux/ceph/rados.h | 2 ++
net/ceph/ceph_strings.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 9c3b4aa..b65182a 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -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
diff --git a/net/ceph/ceph_strings.c b/net/ceph/ceph_strings.c
index 3fbda04..833075c 100644
--- a/net/ceph/ceph_strings.c
+++ b/net/ceph/ceph_strings.c
@@ -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)
{
--
1.7.9.5
next prev parent reply other threads:[~2013-02-16 16:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 16:56 [PATCH 0/3] libceph: update rados.h and related code Alex Elder
2013-02-16 16:57 ` [PATCH 1/3] libceph: update rados.h Alex Elder
2013-02-16 16:57 ` Alex Elder [this message]
2013-02-16 16:57 ` [PATCH 3/3] libceph: update ceph_osd_op_name() Alex Elder
2013-02-16 23:54 ` [PATCH 0/3] libceph: update rados.h and related code Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=511FBA77.3040104@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.