aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-20 22:53:53 -0400
committerSage Weil <sage@inktank.com>2012-07-06 00:14:32 -0400
commitbc18f4b1c850ab355e38373fbb60fd28568d84b5 (patch)
treebe5f51233f281d329bc7648fbcf216deb4511b01 /net/ceph
parent5821bd8ccdf5d17ab2c391c773756538603838c3 (diff)
libceph: add some fine ASCII art
Sage liked the state diagram I put in my commit description so I'm putting it in with the code. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 4578e99bbef1..dcc50e4cd5cd 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -29,7 +29,47 @@
29 * the sender. 29 * the sender.
30 */ 30 */
31 31
32/* State values for ceph_connection->sock_state; NEW is assumed to be 0 */ 32/*
33 * We track the state of the socket on a given connection using
34 * values defined below. The transition to a new socket state is
35 * handled by a function which verifies we aren't coming from an
36 * unexpected state.
37 *
38 * --------
39 * | NEW* | transient initial state
40 * --------
41 * | con_sock_state_init()
42 * v
43 * ----------
44 * | CLOSED | initialized, but no socket (and no
45 * ---------- TCP connection)
46 * ^ \
47 * | \ con_sock_state_connecting()
48 * | ----------------------
49 * | \
50 * + con_sock_state_closed() \
51 * |\ \
52 * | \ \
53 * | ----------- \
54 * | | CLOSING | socket event; \
55 * | ----------- await close \
56 * | ^ |
57 * | | |
58 * | + con_sock_state_closing() |
59 * | / \ |
60 * | / --------------- |
61 * | / \ v
62 * | / --------------
63 * | / -----------------| CONNECTING | socket created, TCP
64 * | | / -------------- connect initiated
65 * | | | con_sock_state_connected()
66 * | | v
67 * -------------
68 * | CONNECTED | TCP connection established
69 * -------------
70 *
71 * State values for ceph_connection->sock_state; NEW is assumed to be 0.
72 */
33 73
34#define CON_SOCK_STATE_NEW 0 /* -> CLOSED */ 74#define CON_SOCK_STATE_NEW 0 /* -> CLOSED */
35#define CON_SOCK_STATE_CLOSED 1 /* -> CONNECTING */ 75#define CON_SOCK_STATE_CLOSED 1 /* -> CONNECTING */