]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: make ack le64 to match seq
authorSage Weil <sage@newdream.net>
Thu, 10 Sep 2009 21:44:52 +0000 (14:44 -0700)
committerSage Weil <sage@newdream.net>
Thu, 10 Sep 2009 21:44:52 +0000 (14:44 -0700)
src/include/msgr.h
src/kernel/messenger.c
src/kernel/messenger.h
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h

index 8e9fc934186a4c85b1028903bf8a547641d5eac1..968b4ba0849f87b4f6fd0fc880a44e5c43cba483 100644 (file)
@@ -21,7 +21,7 @@
  * whenever the wire protocol changes.  try to keep this string length
  * constant.
  */
-#define CEPH_BANNER "ceph v018"
+#define CEPH_BANNER "ceph v019"
 #define CEPH_BANNER_MAX_LEN 30
 
 
index ba4d0656d7d79dc44591a1a1e0010572eb362d4c..9d51b6eaa7cd188375f371e564cf183b7404df6c 100644 (file)
@@ -384,10 +384,10 @@ static void prepare_write_message(struct ceph_connection *con)
                con->in_seq_acked = con->in_seq;
                con->out_kvec[v].iov_base = &tag_ack;
                con->out_kvec[v++].iov_len = 1;
-               con->out_temp_ack = cpu_to_le32(con->in_seq_acked);
+               con->out_temp_ack = cpu_to_le64(con->in_seq_acked);
                con->out_kvec[v].iov_base = &con->out_temp_ack;
-               con->out_kvec[v++].iov_len = 4;
-               con->out_kvec_bytes = 1 + 4;
+               con->out_kvec[v++].iov_len = sizeof(con->out_temp_ack);
+               con->out_kvec_bytes = 1 + sizeof(con->out_temp_ack);
        }
 
        /* move message to sending/sent list */
@@ -461,17 +461,17 @@ static void prepare_write_message(struct ceph_connection *con)
  */
 static void prepare_write_ack(struct ceph_connection *con)
 {
-       dout("prepare_write_ack %p %u -> %u\n", con,
+       dout("prepare_write_ack %p %llu -> %llu\n", con,
             con->in_seq_acked, con->in_seq);
        con->in_seq_acked = con->in_seq;
 
        con->out_kvec[0].iov_base = &tag_ack;
        con->out_kvec[0].iov_len = 1;
-       con->out_temp_ack = cpu_to_le32(con->in_seq_acked);
+       con->out_temp_ack = cpu_to_le64(con->in_seq_acked);
        con->out_kvec[1].iov_base = &con->out_temp_ack;
-       con->out_kvec[1].iov_len = 4;
+       con->out_kvec[1].iov_len = sizeof(con->out_temp_ack);
        con->out_kvec_left = 2;
-       con->out_kvec_bytes = 1 + 4;
+       con->out_kvec_bytes = 1 + sizeof(con->out_temp_ack);
        con->out_kvec_cur = con->out_kvec;
        con->out_more = 1;  /* more will follow.. eventually.. */
        set_bit(WRITE_PENDING, &con->state);
index 317fe89c86823ac50949561fd6292bad1509c68e..574ccbbdd82e73ecf8f322a136c4c1a7fcb96cc8 100644 (file)
@@ -168,7 +168,7 @@ struct ceph_connection {
        u64 out_seq_sent;            /* last message sent */
        bool out_keepalive_pending;
 
-       u32 in_seq, in_seq_acked;  /* last message received, acked */
+       u64 in_seq, in_seq_acked;  /* last message received, acked */
 
        /* connection negotiation temps */
        char in_banner[CEPH_BANNER_MAX_LEN];
@@ -196,7 +196,7 @@ struct ceph_connection {
        int out_kvec_bytes;  /* total bytes left */
        bool out_kvec_is_msg; /* kvec refers to out_msg */
        int out_more;        /* there is more data after the kvecs */
-       __le32 out_temp_ack; /* for writing an ack */
+       __le64 out_temp_ack; /* for writing an ack */
 
        /* message in temps */
        struct ceph_msg_header in_hdr;
@@ -206,7 +206,7 @@ struct ceph_connection {
 
        char in_tag;         /* protocol control byte */
        int in_base_pos;     /* bytes read */
-       __le32 in_temp_ack;  /* for reading an ack */
+       __le64 in_temp_ack;  /* for reading an ack */
 
        struct delayed_work work;           /* send|recv work */
        unsigned long       delay;          /* current delay interval */
index ceda59f836c5f9de373a1b659859ac8cbe7bdeb2..c4158c33d9fb37dfe284307790b21a0e1231b69f 100644 (file)
@@ -1279,7 +1279,7 @@ void SimpleMessenger::Pipe::reader()
     // open ...
     if (tag == CEPH_MSGR_TAG_ACK) {
       dout(20) << "reader got ACK" << dendl;
-      __u32 seq;
+      __le64 seq;
       int rc = tcp_read( sd, (char*)&seq, sizeof(seq));
       lock.Lock();
       if (rc < 0) {
@@ -1748,12 +1748,12 @@ int SimpleMessenger::Pipe::do_sendmsg(int sd, struct msghdr *msg, int len)
 }
 
 
-int SimpleMessenger::Pipe::write_ack(unsigned seq)
+int SimpleMessenger::Pipe::write_ack(__u64 seq)
 {
   dout(10) << "write_ack " << seq << dendl;
 
   char c = CEPH_MSGR_TAG_ACK;
-  __le32 s;
+  __le64 s;
   s = seq;
 
   struct msghdr msg;
@@ -1766,7 +1766,7 @@ int SimpleMessenger::Pipe::write_ack(unsigned seq)
   msg.msg_iov = msgvec;
   msg.msg_iovlen = 2;
   
-  if (do_sendmsg(sd, &msg, 5) < 0) 
+  if (do_sendmsg(sd, &msg, 1 + sizeof(s)) < 0) 
     return -1; 
   return 0;
 }
index b64b0a58a8e61d4a000b3f5e480c2ff827506963..6f8242ba1fd3a8c4c9bb096604a3f5ffbcf99881 100644 (file)
@@ -150,8 +150,8 @@ private:
     bool keepalive;
     
     __u32 connect_seq, peer_global_seq;
-    __u32 out_seq;
-    __u32 in_seq, in_seq_acked;
+    __u64 out_seq;
+    __u64 in_seq, in_seq_acked;
     
     int accept();   // server handshake
     int connect();  // client handshake
@@ -161,7 +161,7 @@ private:
     Message *read_message();
     int write_message(Message *m);
     int do_sendmsg(int sd, struct msghdr *msg, int len);
-    int write_ack(unsigned s);
+    int write_ack(__u64 s);
     int write_keepalive();
 
     void fault(bool silent=false, bool reader=false);