diff options
author | John Spray <john.spray@redhat.com> | 2014-09-19 13:51:08 +0100 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-10-14 12:56:50 -0700 |
commit | a687ecaf50f18329206c6b78764a8c7bd30a9df0 (patch) | |
tree | 1709001b18c7658b1c1567f105686758b1ec7447 | |
parent | b1ee94aa593abd03634bc3887b8e189840e42c12 (diff) | |
download | op-kernel-dev-a687ecaf50f18329206c6b78764a8c7bd30a9df0.zip op-kernel-dev-a687ecaf50f18329206c6b78764a8c7bd30a9df0.tar.gz |
ceph: export ceph_session_state_name function
...so that it can be used from the ceph debugfs
code when dumping session info.
Signed-off-by: John Spray <john.spray@redhat.com>
-rw-r--r-- | fs/ceph/mds_client.c | 14 | ||||
-rw-r--r-- | fs/ceph/mds_client.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index f8f774e..a92d3f5 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -335,7 +335,7 @@ static void destroy_reply_info(struct ceph_mds_reply_info_parsed *info) /* * sessions */ -static const char *session_state_name(int s) +const char *ceph_session_state_name(int s) { switch (s) { case CEPH_MDS_SESSION_NEW: return "new"; @@ -1235,7 +1235,7 @@ static int send_flushmsg_ack(struct ceph_mds_client *mdsc, struct ceph_msg *msg; dout("send_flushmsg_ack to mds%d (%s)s seq %lld\n", - session->s_mds, session_state_name(session->s_state), seq); + session->s_mds, ceph_session_state_name(session->s_state), seq); msg = create_session_msg(CEPH_SESSION_FLUSHMSG_ACK, seq); if (!msg) return -ENOMEM; @@ -1287,7 +1287,7 @@ static int request_close_session(struct ceph_mds_client *mdsc, struct ceph_msg *msg; dout("request_close_session mds%d state %s seq %lld\n", - session->s_mds, session_state_name(session->s_state), + session->s_mds, ceph_session_state_name(session->s_state), session->s_seq); msg = create_session_msg(CEPH_SESSION_REQUEST_CLOSE, session->s_seq); if (!msg) @@ -2080,7 +2080,7 @@ static int __do_request(struct ceph_mds_client *mdsc, req->r_session = get_session(session); dout("do_request mds%d session %p state %s\n", mds, session, - session_state_name(session->s_state)); + ceph_session_state_name(session->s_state)); if (session->s_state != CEPH_MDS_SESSION_OPEN && session->s_state != CEPH_MDS_SESSION_HUNG) { if (session->s_state == CEPH_MDS_SESSION_NEW || @@ -2518,7 +2518,7 @@ static void handle_session(struct ceph_mds_session *session, dout("handle_session mds%d %s %p state %s seq %llu\n", mds, ceph_session_op_name(op), session, - session_state_name(session->s_state), seq); + ceph_session_state_name(session->s_state), seq); if (session->s_state == CEPH_MDS_SESSION_HUNG) { session->s_state = CEPH_MDS_SESSION_OPEN; @@ -2771,7 +2771,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, session->s_seq = 0; dout("session %p state %s\n", session, - session_state_name(session->s_state)); + ceph_session_state_name(session->s_state)); spin_lock(&session->s_gen_ttl_lock); session->s_cap_gen++; @@ -2904,7 +2904,7 @@ static void check_new_map(struct ceph_mds_client *mdsc, ceph_mdsmap_is_laggy(oldmap, i) ? " (laggy)" : "", ceph_mds_state_name(newstate), ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "", - session_state_name(s->s_state)); + ceph_session_state_name(s->s_state)); if (i >= newmap->m_max_mds || memcmp(ceph_mdsmap_get_addr(oldmap, i), diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 23015f7..3288359 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h @@ -330,6 +330,8 @@ ceph_get_mds_session(struct ceph_mds_session *s) return s; } +extern const char *ceph_session_state_name(int s); + extern void ceph_put_mds_session(struct ceph_mds_session *s); extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc, |