diff options
author | John Spray <john.spray@redhat.com> | 2014-09-19 08:51:08 -0400 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-10-14 15:56:50 -0400 |
commit | a687ecaf50f18329206c6b78764a8c7bd30a9df0 (patch) | |
tree | 1709001b18c7658b1c1567f105686758b1ec7447 /fs/ceph | |
parent | b1ee94aa593abd03634bc3887b8e189840e42c12 (diff) |
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>
Diffstat (limited to 'fs/ceph')
-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 f8f774e6f868..a92d3f5c6c12 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) | |||
335 | /* | 335 | /* |
336 | * sessions | 336 | * sessions |
337 | */ | 337 | */ |
338 | static const char *session_state_name(int s) | 338 | const char *ceph_session_state_name(int s) |
339 | { | 339 | { |
340 | switch (s) { | 340 | switch (s) { |
341 | case CEPH_MDS_SESSION_NEW: return "new"; | 341 | case CEPH_MDS_SESSION_NEW: return "new"; |
@@ -1235,7 +1235,7 @@ static int send_flushmsg_ack(struct ceph_mds_client *mdsc, | |||
1235 | struct ceph_msg *msg; | 1235 | struct ceph_msg *msg; |
1236 | 1236 | ||
1237 | dout("send_flushmsg_ack to mds%d (%s)s seq %lld\n", | 1237 | dout("send_flushmsg_ack to mds%d (%s)s seq %lld\n", |
1238 | session->s_mds, session_state_name(session->s_state), seq); | 1238 | session->s_mds, ceph_session_state_name(session->s_state), seq); |
1239 | msg = create_session_msg(CEPH_SESSION_FLUSHMSG_ACK, seq); | 1239 | msg = create_session_msg(CEPH_SESSION_FLUSHMSG_ACK, seq); |
1240 | if (!msg) | 1240 | if (!msg) |
1241 | return -ENOMEM; | 1241 | return -ENOMEM; |
@@ -1287,7 +1287,7 @@ static int request_close_session(struct ceph_mds_client *mdsc, | |||
1287 | struct ceph_msg *msg; | 1287 | struct ceph_msg *msg; |
1288 | 1288 | ||
1289 | dout("request_close_session mds%d state %s seq %lld\n", | 1289 | dout("request_close_session mds%d state %s seq %lld\n", |
1290 | session->s_mds, session_state_name(session->s_state), | 1290 | session->s_mds, ceph_session_state_name(session->s_state), |
1291 | session->s_seq); | 1291 | session->s_seq); |
1292 | msg = create_session_msg(CEPH_SESSION_REQUEST_CLOSE, session->s_seq); | 1292 | msg = create_session_msg(CEPH_SESSION_REQUEST_CLOSE, session->s_seq); |
1293 | if (!msg) | 1293 | if (!msg) |
@@ -2080,7 +2080,7 @@ static int __do_request(struct ceph_mds_client *mdsc, | |||
2080 | req->r_session = get_session(session); | 2080 | req->r_session = get_session(session); |
2081 | 2081 | ||
2082 | dout("do_request mds%d session %p state %s\n", mds, session, | 2082 | dout("do_request mds%d session %p state %s\n", mds, session, |
2083 | session_state_name(session->s_state)); | 2083 | ceph_session_state_name(session->s_state)); |
2084 | if (session->s_state != CEPH_MDS_SESSION_OPEN && | 2084 | if (session->s_state != CEPH_MDS_SESSION_OPEN && |
2085 | session->s_state != CEPH_MDS_SESSION_HUNG) { | 2085 | session->s_state != CEPH_MDS_SESSION_HUNG) { |
2086 | if (session->s_state == CEPH_MDS_SESSION_NEW || | 2086 | if (session->s_state == CEPH_MDS_SESSION_NEW || |
@@ -2518,7 +2518,7 @@ static void handle_session(struct ceph_mds_session *session, | |||
2518 | 2518 | ||
2519 | dout("handle_session mds%d %s %p state %s seq %llu\n", | 2519 | dout("handle_session mds%d %s %p state %s seq %llu\n", |
2520 | mds, ceph_session_op_name(op), session, | 2520 | mds, ceph_session_op_name(op), session, |
2521 | session_state_name(session->s_state), seq); | 2521 | ceph_session_state_name(session->s_state), seq); |
2522 | 2522 | ||
2523 | if (session->s_state == CEPH_MDS_SESSION_HUNG) { | 2523 | if (session->s_state == CEPH_MDS_SESSION_HUNG) { |
2524 | session->s_state = CEPH_MDS_SESSION_OPEN; | 2524 | session->s_state = CEPH_MDS_SESSION_OPEN; |
@@ -2771,7 +2771,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2771 | session->s_seq = 0; | 2771 | session->s_seq = 0; |
2772 | 2772 | ||
2773 | dout("session %p state %s\n", session, | 2773 | dout("session %p state %s\n", session, |
2774 | session_state_name(session->s_state)); | 2774 | ceph_session_state_name(session->s_state)); |
2775 | 2775 | ||
2776 | spin_lock(&session->s_gen_ttl_lock); | 2776 | spin_lock(&session->s_gen_ttl_lock); |
2777 | session->s_cap_gen++; | 2777 | session->s_cap_gen++; |
@@ -2904,7 +2904,7 @@ static void check_new_map(struct ceph_mds_client *mdsc, | |||
2904 | ceph_mdsmap_is_laggy(oldmap, i) ? " (laggy)" : "", | 2904 | ceph_mdsmap_is_laggy(oldmap, i) ? " (laggy)" : "", |
2905 | ceph_mds_state_name(newstate), | 2905 | ceph_mds_state_name(newstate), |
2906 | ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "", | 2906 | ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "", |
2907 | session_state_name(s->s_state)); | 2907 | ceph_session_state_name(s->s_state)); |
2908 | 2908 | ||
2909 | if (i >= newmap->m_max_mds || | 2909 | if (i >= newmap->m_max_mds || |
2910 | memcmp(ceph_mdsmap_get_addr(oldmap, i), | 2910 | memcmp(ceph_mdsmap_get_addr(oldmap, i), |
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 23015f747061..3288359353e9 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) | |||
330 | return s; | 330 | return s; |
331 | } | 331 | } |
332 | 332 | ||
333 | extern const char *ceph_session_state_name(int s); | ||
334 | |||
333 | extern void ceph_put_mds_session(struct ceph_mds_session *s); | 335 | extern void ceph_put_mds_session(struct ceph_mds_session *s); |
334 | 336 | ||
335 | extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc, | 337 | extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc, |