diff options
author | Alex Elder <elder@inktank.com> | 2012-05-16 16:16:38 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-05-17 09:18:12 -0400 |
commit | 41b90c00858129f52d08e6a05c9cfdb0f2bd074d (patch) | |
tree | 167a416ff234fcec5af9d08e21115bb8ca3fdc9f /net | |
parent | 84fb3adf6413862cff51d8af3fce5f0b655586a2 (diff) |
ceph: messenger: send banner in process_connect()
prepare_write_connect() has an argument indicating whether a banner
should be sent out before sending out a connection message. It's
only ever set in one of its callers, so move the code that arranges
to send the banner into that caller and drop the "include_banner"
argument from prepare_write_connect().
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index cca3cf341d70..6b38b6fbb25f 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -695,8 +695,7 @@ static void prepare_write_banner(struct ceph_messenger *msgr, | |||
695 | } | 695 | } |
696 | 696 | ||
697 | static int prepare_write_connect(struct ceph_messenger *msgr, | 697 | static int prepare_write_connect(struct ceph_messenger *msgr, |
698 | struct ceph_connection *con, | 698 | struct ceph_connection *con) |
699 | int include_banner) | ||
700 | { | 699 | { |
701 | unsigned global_seq = get_global_seq(con->msgr, 0); | 700 | unsigned global_seq = get_global_seq(con->msgr, 0); |
702 | int proto; | 701 | int proto; |
@@ -725,8 +724,6 @@ static int prepare_write_connect(struct ceph_messenger *msgr, | |||
725 | con->out_connect.protocol_version = cpu_to_le32(proto); | 724 | con->out_connect.protocol_version = cpu_to_le32(proto); |
726 | con->out_connect.flags = 0; | 725 | con->out_connect.flags = 0; |
727 | 726 | ||
728 | if (include_banner) | ||
729 | prepare_write_banner(msgr, con); | ||
730 | ceph_con_out_kvec_add(con, sizeof (con->out_connect), &con->out_connect); | 727 | ceph_con_out_kvec_add(con, sizeof (con->out_connect), &con->out_connect); |
731 | 728 | ||
732 | con->out_more = 0; | 729 | con->out_more = 0; |
@@ -1389,7 +1386,7 @@ static int process_connect(struct ceph_connection *con) | |||
1389 | } | 1386 | } |
1390 | con->auth_retry = 1; | 1387 | con->auth_retry = 1; |
1391 | ceph_con_out_kvec_reset(con); | 1388 | ceph_con_out_kvec_reset(con); |
1392 | ret = prepare_write_connect(con->msgr, con, 0); | 1389 | ret = prepare_write_connect(con->msgr, con); |
1393 | if (ret < 0) | 1390 | if (ret < 0) |
1394 | return ret; | 1391 | return ret; |
1395 | prepare_read_connect(con); | 1392 | prepare_read_connect(con); |
@@ -1410,7 +1407,7 @@ static int process_connect(struct ceph_connection *con) | |||
1410 | ceph_pr_addr(&con->peer_addr.in_addr)); | 1407 | ceph_pr_addr(&con->peer_addr.in_addr)); |
1411 | reset_connection(con); | 1408 | reset_connection(con); |
1412 | ceph_con_out_kvec_reset(con); | 1409 | ceph_con_out_kvec_reset(con); |
1413 | prepare_write_connect(con->msgr, con, 0); | 1410 | prepare_write_connect(con->msgr, con); |
1414 | prepare_read_connect(con); | 1411 | prepare_read_connect(con); |
1415 | 1412 | ||
1416 | /* Tell ceph about it. */ | 1413 | /* Tell ceph about it. */ |
@@ -1434,7 +1431,7 @@ static int process_connect(struct ceph_connection *con) | |||
1434 | le32_to_cpu(con->in_connect.connect_seq)); | 1431 | le32_to_cpu(con->in_connect.connect_seq)); |
1435 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); | 1432 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); |
1436 | ceph_con_out_kvec_reset(con); | 1433 | ceph_con_out_kvec_reset(con); |
1437 | prepare_write_connect(con->msgr, con, 0); | 1434 | prepare_write_connect(con->msgr, con); |
1438 | prepare_read_connect(con); | 1435 | prepare_read_connect(con); |
1439 | break; | 1436 | break; |
1440 | 1437 | ||
@@ -1449,7 +1446,7 @@ static int process_connect(struct ceph_connection *con) | |||
1449 | get_global_seq(con->msgr, | 1446 | get_global_seq(con->msgr, |
1450 | le32_to_cpu(con->in_connect.global_seq)); | 1447 | le32_to_cpu(con->in_connect.global_seq)); |
1451 | ceph_con_out_kvec_reset(con); | 1448 | ceph_con_out_kvec_reset(con); |
1452 | prepare_write_connect(con->msgr, con, 0); | 1449 | prepare_write_connect(con->msgr, con); |
1453 | prepare_read_connect(con); | 1450 | prepare_read_connect(con); |
1454 | break; | 1451 | break; |
1455 | 1452 | ||
@@ -1855,7 +1852,8 @@ more: | |||
1855 | /* open the socket first? */ | 1852 | /* open the socket first? */ |
1856 | if (con->sock == NULL) { | 1853 | if (con->sock == NULL) { |
1857 | ceph_con_out_kvec_reset(con); | 1854 | ceph_con_out_kvec_reset(con); |
1858 | prepare_write_connect(msgr, con, 1); | 1855 | prepare_write_banner(msgr, con); |
1856 | prepare_write_connect(msgr, con); | ||
1859 | prepare_read_banner(con); | 1857 | prepare_read_banner(con); |
1860 | set_bit(CONNECTING, &con->state); | 1858 | set_bit(CONNECTING, &con->state); |
1861 | clear_bit(NEGOTIATING, &con->state); | 1859 | clear_bit(NEGOTIATING, &con->state); |