diff options
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 6b38b6fbb25f..47499dc0e413 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -683,19 +683,17 @@ static int prepare_connect_authorizer(struct ceph_connection *con) | |||
683 | /* | 683 | /* |
684 | * We connected to a peer and are saying hello. | 684 | * We connected to a peer and are saying hello. |
685 | */ | 685 | */ |
686 | static void prepare_write_banner(struct ceph_messenger *msgr, | 686 | static void prepare_write_banner(struct ceph_connection *con) |
687 | struct ceph_connection *con) | ||
688 | { | 687 | { |
689 | ceph_con_out_kvec_add(con, strlen(CEPH_BANNER), CEPH_BANNER); | 688 | ceph_con_out_kvec_add(con, strlen(CEPH_BANNER), CEPH_BANNER); |
690 | ceph_con_out_kvec_add(con, sizeof (msgr->my_enc_addr), | 689 | ceph_con_out_kvec_add(con, sizeof (con->msgr->my_enc_addr), |
691 | &msgr->my_enc_addr); | 690 | &con->msgr->my_enc_addr); |
692 | 691 | ||
693 | con->out_more = 0; | 692 | con->out_more = 0; |
694 | set_bit(WRITE_PENDING, &con->state); | 693 | set_bit(WRITE_PENDING, &con->state); |
695 | } | 694 | } |
696 | 695 | ||
697 | static int prepare_write_connect(struct ceph_messenger *msgr, | 696 | static int prepare_write_connect(struct ceph_connection *con) |
698 | struct ceph_connection *con) | ||
699 | { | 697 | { |
700 | unsigned global_seq = get_global_seq(con->msgr, 0); | 698 | unsigned global_seq = get_global_seq(con->msgr, 0); |
701 | int proto; | 699 | int proto; |
@@ -717,7 +715,7 @@ static int prepare_write_connect(struct ceph_messenger *msgr, | |||
717 | dout("prepare_write_connect %p cseq=%d gseq=%d proto=%d\n", con, | 715 | dout("prepare_write_connect %p cseq=%d gseq=%d proto=%d\n", con, |
718 | con->connect_seq, global_seq, proto); | 716 | con->connect_seq, global_seq, proto); |
719 | 717 | ||
720 | con->out_connect.features = cpu_to_le64(msgr->supported_features); | 718 | con->out_connect.features = cpu_to_le64(con->msgr->supported_features); |
721 | con->out_connect.host_type = cpu_to_le32(CEPH_ENTITY_TYPE_CLIENT); | 719 | con->out_connect.host_type = cpu_to_le32(CEPH_ENTITY_TYPE_CLIENT); |
722 | con->out_connect.connect_seq = cpu_to_le32(con->connect_seq); | 720 | con->out_connect.connect_seq = cpu_to_le32(con->connect_seq); |
723 | con->out_connect.global_seq = cpu_to_le32(global_seq); | 721 | con->out_connect.global_seq = cpu_to_le32(global_seq); |
@@ -1386,7 +1384,7 @@ static int process_connect(struct ceph_connection *con) | |||
1386 | } | 1384 | } |
1387 | con->auth_retry = 1; | 1385 | con->auth_retry = 1; |
1388 | ceph_con_out_kvec_reset(con); | 1386 | ceph_con_out_kvec_reset(con); |
1389 | ret = prepare_write_connect(con->msgr, con); | 1387 | ret = prepare_write_connect(con); |
1390 | if (ret < 0) | 1388 | if (ret < 0) |
1391 | return ret; | 1389 | return ret; |
1392 | prepare_read_connect(con); | 1390 | prepare_read_connect(con); |
@@ -1407,7 +1405,7 @@ static int process_connect(struct ceph_connection *con) | |||
1407 | ceph_pr_addr(&con->peer_addr.in_addr)); | 1405 | ceph_pr_addr(&con->peer_addr.in_addr)); |
1408 | reset_connection(con); | 1406 | reset_connection(con); |
1409 | ceph_con_out_kvec_reset(con); | 1407 | ceph_con_out_kvec_reset(con); |
1410 | prepare_write_connect(con->msgr, con); | 1408 | prepare_write_connect(con); |
1411 | prepare_read_connect(con); | 1409 | prepare_read_connect(con); |
1412 | 1410 | ||
1413 | /* Tell ceph about it. */ | 1411 | /* Tell ceph about it. */ |
@@ -1431,7 +1429,7 @@ static int process_connect(struct ceph_connection *con) | |||
1431 | le32_to_cpu(con->in_connect.connect_seq)); | 1429 | le32_to_cpu(con->in_connect.connect_seq)); |
1432 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); | 1430 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); |
1433 | ceph_con_out_kvec_reset(con); | 1431 | ceph_con_out_kvec_reset(con); |
1434 | prepare_write_connect(con->msgr, con); | 1432 | prepare_write_connect(con); |
1435 | prepare_read_connect(con); | 1433 | prepare_read_connect(con); |
1436 | break; | 1434 | break; |
1437 | 1435 | ||
@@ -1446,7 +1444,7 @@ static int process_connect(struct ceph_connection *con) | |||
1446 | get_global_seq(con->msgr, | 1444 | get_global_seq(con->msgr, |
1447 | le32_to_cpu(con->in_connect.global_seq)); | 1445 | le32_to_cpu(con->in_connect.global_seq)); |
1448 | ceph_con_out_kvec_reset(con); | 1446 | ceph_con_out_kvec_reset(con); |
1449 | prepare_write_connect(con->msgr, con); | 1447 | prepare_write_connect(con); |
1450 | prepare_read_connect(con); | 1448 | prepare_read_connect(con); |
1451 | break; | 1449 | break; |
1452 | 1450 | ||
@@ -1840,7 +1838,6 @@ static void process_message(struct ceph_connection *con) | |||
1840 | */ | 1838 | */ |
1841 | static int try_write(struct ceph_connection *con) | 1839 | static int try_write(struct ceph_connection *con) |
1842 | { | 1840 | { |
1843 | struct ceph_messenger *msgr = con->msgr; | ||
1844 | int ret = 1; | 1841 | int ret = 1; |
1845 | 1842 | ||
1846 | dout("try_write start %p state %lu nref %d\n", con, con->state, | 1843 | dout("try_write start %p state %lu nref %d\n", con, con->state, |
@@ -1852,8 +1849,8 @@ more: | |||
1852 | /* open the socket first? */ | 1849 | /* open the socket first? */ |
1853 | if (con->sock == NULL) { | 1850 | if (con->sock == NULL) { |
1854 | ceph_con_out_kvec_reset(con); | 1851 | ceph_con_out_kvec_reset(con); |
1855 | prepare_write_banner(msgr, con); | 1852 | prepare_write_banner(con); |
1856 | prepare_write_connect(msgr, con); | 1853 | prepare_write_connect(con); |
1857 | prepare_read_banner(con); | 1854 | prepare_read_banner(con); |
1858 | set_bit(CONNECTING, &con->state); | 1855 | set_bit(CONNECTING, &con->state); |
1859 | clear_bit(NEGOTIATING, &con->state); | 1856 | clear_bit(NEGOTIATING, &con->state); |