diff mbox

[1/7] messenger: update state diagram

Message ID 1430154795-17123-2-git-send-email-elder@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Elder April 27, 2015, 5:13 p.m. UTC
Update the fabulous state diagram in "messenger.c" to reflect the
way the code operates.  Two new transitions are added:

    CLOSED -> CLOSED
    CLOSING -> CLOSING

Signed-off-by: Alex Elder <elder@linaro.org>
---
 net/ceph/messenger.c | 51 +++++++++++++++++++++++++--------------------------
 1 file changed, 25 insertions(+), 26 deletions(-)
diff mbox

Patch

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 967080a..9dfdb20 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -46,32 +46,31 @@ 
  *          | con_sock_state_init()
  *          v
  *      ----------
- *      | CLOSED |  initialized, but no socket (and no
- *      ----------  TCP connection)
- *       ^      \
- *       |       \ con_sock_state_connecting()
- *       |        ----------------------
- *       |                              \
- *       + con_sock_state_closed()       \
- *       |+---------------------------    \
- *       | \                          \    \
- *       |  -----------                \    \
- *       |  | CLOSING |  socket event;  \    \
- *       |  -----------  await close     \    \
- *       |       ^                        \   |
- *       |       |                         \  |
- *       |       + con_sock_state_closing() \ |
- *       |      / \                         | |
- *       |     /   ---------------          | |
- *       |    /                   \         v v
- *       |   /                    --------------
- *       |  /    -----------------| CONNECTING |  socket created, TCP
- *       |  |   /                 --------------  connect initiated
- *       |  |   | con_sock_state_connected()
- *       |  |   v
- *      -------------
- *      | CONNECTED |  TCP connection established
- *      -------------
+ *      | CLOSED |  initialized, but no socket (and no TCP connection)
+ *      ----------
+ *       ^   \  \  con_sock_state_connecting()
+ *       |   /   ------------------------
+ *       +<--                            \
+ *       |\  cen_sock_state_closed()      \
+ *       | +<--------------------------    \
+ *       |  \                          \    \
+ *       | -----------                  \    \
+ *       | | CLOSING |  socket event;    \    \
+ *       | -----------  await close       \    \
+ *       |    /   ^                        \    \
+ *       |    \   |                         \   |
+ *       |     -->+ con_sock_state_closing() \  |
+ *       |       / \                         |  |
+ *       |      /   ----------------------   |  |
+ *       |     /                          \  |  v
+ *       |    /                        --------------
+ *       |   /    ---------------------| CONNECTING |  socket created, TCP
+ *       |   |   /                     --------------  connect initiated
+ *       |   |   | con_sock_state_connected()
+ *       |   |   v
+ *     -------------
+ *     | CONNECTED |  TCP connection established
+ *     -------------
  *
  * State values for ceph_connection->sock_state; NEW is assumed to be 0.
  */