* 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
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 */
*/
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);
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];
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;
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 */
// 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) {
}
-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;
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;
}
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
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);