]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: kill msgr WAIT
authorSage Weil <sage@newdream.net>
Tue, 8 Sep 2009 20:52:34 +0000 (13:52 -0700)
committerSage Weil <sage@newdream.net>
Tue, 8 Sep 2009 20:52:34 +0000 (13:52 -0700)
src/kernel/messenger.c
src/kernel/messenger.h

index 2a30c02fb4285117e807db4c81c687d68d4c151f..b7f2bea7903d9b964f7cc6cb6a63363cb062a738 100644 (file)
@@ -854,18 +854,6 @@ static int process_connect(struct ceph_connection *con)
                prepare_read_connect(con);
                break;
 
-       case CEPH_MSGR_TAG_WAIT:
-               /*
-                * If there is a connection race (we are opening connections to
-                * each other), one of us may just have to WAIT.  We will keep
-                * our queued messages, in expectation of being replaced by an
-                * incoming connection.
-                */
-               dout("process_connect peer connecting WAIT\n");
-               set_bit(WAIT, &con->state);
-               con_close_socket(con);
-               break;
-
        case CEPH_MSGR_TAG_READY:
                clear_bit(CONNECTING, &con->state);
                if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY)
@@ -883,6 +871,15 @@ static int process_connect(struct ceph_connection *con)
                prepare_read_tag(con);
                break;
 
+       case CEPH_MSGR_TAG_WAIT:
+               /*
+                * If there is a connection race (we are opening
+                * connections to each other), one of us may just have
+                * to WAIT.  This shouldn't happen if we are the
+                * client.
+                */
+               pr_err("process_connect peer connecting WAIT\n");
+
        default:
                pr_err("ceph connect protocol error, will retry\n");
                con->error_msg = "protocol error, garbage tag during connect";
@@ -1305,7 +1302,7 @@ more:
                ret = read_partial_connect(con);
                if (ret <= 0)
                        goto done;
-               if (process_connect(con) < 0 || test_bit(WAIT, &con->state)) {
+               if (process_connect(con) < 0) {
                        ret = -1;
                        goto out;
                }
@@ -1412,9 +1409,8 @@ bad_tag:
  */
 static void queue_con(struct ceph_connection *con)
 {
-       if (test_bit(WAIT, &con->state) ||
-           test_bit(DEAD, &con->state)) {
-               dout("queue_con %p ignoring: WAIT|DEAD\n",
+       if (test_bit(DEAD, &con->state)) {
+               dout("queue_con %p ignoring: DEAD\n",
                     con);
                return;
        }
@@ -1461,10 +1457,6 @@ more:
                dout("con_work OPENING\n");
                con_close_socket(con);
        }
-       if (test_bit(WAIT, &con->state)) {   /* we are a zombie */
-               dout("con_work WAIT\n");
-               goto done;
-       }
 
        if (test_and_clear_bit(SOCK_CLOSED, &con->state) ||
            try_read(con) < 0 ||
index 8e94bbafe6f25c032f7470ef6179c234c57117d3..ed675f5d9a84cf0d41e173f0cd52e8b73f67f595 100644 (file)
@@ -131,8 +131,6 @@ struct ceph_msg_pos {
 #define STANDBY                8  /* no outgoing messages, socket closed.  we keep
                            * the ceph_connection around to maintain shared
                            * state with the peer. */
-#define WAIT           9  /* waiting for peer to connect to us (during a
-                           * connection race) */
 #define CLOSED         10 /* we've closed the connection */
 #define SOCK_CLOSED    11 /* socket state changed to closed */
 #define REGISTERED      12 /* connection appears in con_tree */