ceph: export ceph_session_state_name function
authorJohn Spray <john.spray@redhat.com>
Fri, 19 Sep 2014 12:51:08 +0000 (13:51 +0100)
committerSage Weil <sage@redhat.com>
Tue, 14 Oct 2014 19:56:50 +0000 (12:56 -0700)
...so that it can be used from the ceph debugfs
code when dumping session info.

Signed-off-by: John Spray <john.spray@redhat.com>
fs/ceph/mds_client.c
fs/ceph/mds_client.h

index f8f774e6f86833c884bb6d0652cb96ca3d959bdb..a92d3f5c6c12fa3ae0b7308c9fcd379ac821cc67 100644 (file)
@@ -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),
index 23015f747061b86098b71a201b226946c2800f52..3288359353e9b84783a0d5ef65c06141398e625c 100644 (file)
@@ -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,