aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-05-23 15:35:23 -0400
committerAlex Elder <elder@dreamhost.com>2012-06-01 09:37:55 -0400
commite22004235a900213625acd6583ac913d5a30c155 (patch)
tree0a699c1513353075b9c1768889890588eec4bc59 /net/ceph/messenger.c
parent327800bdc2cb9b71f4b458ca07aa9d522668dde0 (diff)
libceph: rename kvec_reset and kvec_add functions
The functions ceph_con_out_kvec_reset() and ceph_con_out_kvec_add() are entirely private functions, so drop the "ceph_" prefix in their name to make them slightly more wieldy. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 545255823de2..2ca491fc50e2 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -486,14 +486,14 @@ static u32 get_global_seq(struct ceph_messenger *msgr, u32 gt)
486 return ret; 486 return ret;
487} 487}
488 488
489static void ceph_con_out_kvec_reset(struct ceph_connection *con) 489static void con_out_kvec_reset(struct ceph_connection *con)
490{ 490{
491 con->out_kvec_left = 0; 491 con->out_kvec_left = 0;
492 con->out_kvec_bytes = 0; 492 con->out_kvec_bytes = 0;
493 con->out_kvec_cur = &con->out_kvec[0]; 493 con->out_kvec_cur = &con->out_kvec[0];
494} 494}
495 495
496static void ceph_con_out_kvec_add(struct ceph_connection *con, 496static void con_out_kvec_add(struct ceph_connection *con,
497 size_t size, void *data) 497 size_t size, void *data)
498{ 498{
499 int index; 499 int index;
@@ -534,7 +534,7 @@ static void prepare_write_message(struct ceph_connection *con)
534 struct ceph_msg *m; 534 struct ceph_msg *m;
535 u32 crc; 535 u32 crc;
536 536
537 ceph_con_out_kvec_reset(con); 537 con_out_kvec_reset(con);
538 con->out_kvec_is_msg = true; 538 con->out_kvec_is_msg = true;
539 con->out_msg_done = false; 539 con->out_msg_done = false;
540 540
@@ -542,9 +542,9 @@ static void prepare_write_message(struct ceph_connection *con)
542 * TCP packet that's a good thing. */ 542 * TCP packet that's a good thing. */
543 if (con->in_seq > con->in_seq_acked) { 543 if (con->in_seq > con->in_seq_acked) {
544 con->in_seq_acked = con->in_seq; 544 con->in_seq_acked = con->in_seq;
545 ceph_con_out_kvec_add(con, sizeof (tag_ack), &tag_ack); 545 con_out_kvec_add(con, sizeof (tag_ack), &tag_ack);
546 con->out_temp_ack = cpu_to_le64(con->in_seq_acked); 546 con->out_temp_ack = cpu_to_le64(con->in_seq_acked);
547 ceph_con_out_kvec_add(con, sizeof (con->out_temp_ack), 547 con_out_kvec_add(con, sizeof (con->out_temp_ack),
548 &con->out_temp_ack); 548 &con->out_temp_ack);
549 } 549 }
550 550
@@ -572,12 +572,12 @@ static void prepare_write_message(struct ceph_connection *con)
572 BUG_ON(le32_to_cpu(m->hdr.front_len) != m->front.iov_len); 572 BUG_ON(le32_to_cpu(m->hdr.front_len) != m->front.iov_len);
573 573
574 /* tag + hdr + front + middle */ 574 /* tag + hdr + front + middle */
575 ceph_con_out_kvec_add(con, sizeof (tag_msg), &tag_msg); 575 con_out_kvec_add(con, sizeof (tag_msg), &tag_msg);
576 ceph_con_out_kvec_add(con, sizeof (m->hdr), &m->hdr); 576 con_out_kvec_add(con, sizeof (m->hdr), &m->hdr);
577 ceph_con_out_kvec_add(con, m->front.iov_len, m->front.iov_base); 577 con_out_kvec_add(con, m->front.iov_len, m->front.iov_base);
578 578
579 if (m->middle) 579 if (m->middle)
580 ceph_con_out_kvec_add(con, m->middle->vec.iov_len, 580 con_out_kvec_add(con, m->middle->vec.iov_len,
581 m->middle->vec.iov_base); 581 m->middle->vec.iov_base);
582 582
583 /* fill in crc (except data pages), footer */ 583 /* fill in crc (except data pages), footer */
@@ -626,12 +626,12 @@ static void prepare_write_ack(struct ceph_connection *con)
626 con->in_seq_acked, con->in_seq); 626 con->in_seq_acked, con->in_seq);
627 con->in_seq_acked = con->in_seq; 627 con->in_seq_acked = con->in_seq;
628 628
629 ceph_con_out_kvec_reset(con); 629 con_out_kvec_reset(con);
630 630
631 ceph_con_out_kvec_add(con, sizeof (tag_ack), &tag_ack); 631 con_out_kvec_add(con, sizeof (tag_ack), &tag_ack);
632 632
633 con->out_temp_ack = cpu_to_le64(con->in_seq_acked); 633 con->out_temp_ack = cpu_to_le64(con->in_seq_acked);
634 ceph_con_out_kvec_add(con, sizeof (con->out_temp_ack), 634 con_out_kvec_add(con, sizeof (con->out_temp_ack),
635 &con->out_temp_ack); 635 &con->out_temp_ack);
636 636
637 con->out_more = 1; /* more will follow.. eventually.. */ 637 con->out_more = 1; /* more will follow.. eventually.. */
@@ -644,8 +644,8 @@ static void prepare_write_ack(struct ceph_connection *con)
644static void prepare_write_keepalive(struct ceph_connection *con) 644static void prepare_write_keepalive(struct ceph_connection *con)
645{ 645{
646 dout("prepare_write_keepalive %p\n", con); 646 dout("prepare_write_keepalive %p\n", con);
647 ceph_con_out_kvec_reset(con); 647 con_out_kvec_reset(con);
648 ceph_con_out_kvec_add(con, sizeof (tag_keepalive), &tag_keepalive); 648 con_out_kvec_add(con, sizeof (tag_keepalive), &tag_keepalive);
649 set_bit(WRITE_PENDING, &con->state); 649 set_bit(WRITE_PENDING, &con->state);
650} 650}
651 651
@@ -690,8 +690,8 @@ static struct ceph_auth_handshake *get_connect_authorizer(struct ceph_connection
690 */ 690 */
691static void prepare_write_banner(struct ceph_connection *con) 691static void prepare_write_banner(struct ceph_connection *con)
692{ 692{
693 ceph_con_out_kvec_add(con, strlen(CEPH_BANNER), CEPH_BANNER); 693 con_out_kvec_add(con, strlen(CEPH_BANNER), CEPH_BANNER);
694 ceph_con_out_kvec_add(con, sizeof (con->msgr->my_enc_addr), 694 con_out_kvec_add(con, sizeof (con->msgr->my_enc_addr),
695 &con->msgr->my_enc_addr); 695 &con->msgr->my_enc_addr);
696 696
697 con->out_more = 0; 697 con->out_more = 0;
@@ -738,10 +738,10 @@ static int prepare_write_connect(struct ceph_connection *con)
738 con->out_connect.authorizer_len = auth ? 738 con->out_connect.authorizer_len = auth ?
739 cpu_to_le32(auth->authorizer_buf_len) : 0; 739 cpu_to_le32(auth->authorizer_buf_len) : 0;
740 740
741 ceph_con_out_kvec_add(con, sizeof (con->out_connect), 741 con_out_kvec_add(con, sizeof (con->out_connect),
742 &con->out_connect); 742 &con->out_connect);
743 if (auth && auth->authorizer_buf_len) 743 if (auth && auth->authorizer_buf_len)
744 ceph_con_out_kvec_add(con, auth->authorizer_buf_len, 744 con_out_kvec_add(con, auth->authorizer_buf_len,
745 auth->authorizer_buf); 745 auth->authorizer_buf);
746 746
747 con->out_more = 0; 747 con->out_more = 0;
@@ -935,7 +935,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
935 /* prepare and queue up footer, too */ 935 /* prepare and queue up footer, too */
936 if (!do_datacrc) 936 if (!do_datacrc)
937 con->out_msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC; 937 con->out_msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC;
938 ceph_con_out_kvec_reset(con); 938 con_out_kvec_reset(con);
939 prepare_write_message_footer(con); 939 prepare_write_message_footer(con);
940 ret = 1; 940 ret = 1;
941out: 941out:
@@ -1398,7 +1398,7 @@ static int process_connect(struct ceph_connection *con)
1398 return -1; 1398 return -1;
1399 } 1399 }
1400 con->auth_retry = 1; 1400 con->auth_retry = 1;
1401 ceph_con_out_kvec_reset(con); 1401 con_out_kvec_reset(con);
1402 ret = prepare_write_connect(con); 1402 ret = prepare_write_connect(con);
1403 if (ret < 0) 1403 if (ret < 0)
1404 return ret; 1404 return ret;
@@ -1419,7 +1419,7 @@ static int process_connect(struct ceph_connection *con)
1419 ENTITY_NAME(con->peer_name), 1419 ENTITY_NAME(con->peer_name),
1420 ceph_pr_addr(&con->peer_addr.in_addr)); 1420 ceph_pr_addr(&con->peer_addr.in_addr));
1421 reset_connection(con); 1421 reset_connection(con);
1422 ceph_con_out_kvec_reset(con); 1422 con_out_kvec_reset(con);
1423 ret = prepare_write_connect(con); 1423 ret = prepare_write_connect(con);
1424 if (ret < 0) 1424 if (ret < 0)
1425 return ret; 1425 return ret;
@@ -1445,7 +1445,7 @@ static int process_connect(struct ceph_connection *con)
1445 le32_to_cpu(con->out_connect.connect_seq), 1445 le32_to_cpu(con->out_connect.connect_seq),
1446 le32_to_cpu(con->in_connect.connect_seq)); 1446 le32_to_cpu(con->in_connect.connect_seq));
1447 con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); 1447 con->connect_seq = le32_to_cpu(con->in_connect.connect_seq);
1448 ceph_con_out_kvec_reset(con); 1448 con_out_kvec_reset(con);
1449 ret = prepare_write_connect(con); 1449 ret = prepare_write_connect(con);
1450 if (ret < 0) 1450 if (ret < 0)
1451 return ret; 1451 return ret;
@@ -1462,7 +1462,7 @@ static int process_connect(struct ceph_connection *con)
1462 le32_to_cpu(con->in_connect.global_seq)); 1462 le32_to_cpu(con->in_connect.global_seq));
1463 get_global_seq(con->msgr, 1463 get_global_seq(con->msgr,
1464 le32_to_cpu(con->in_connect.global_seq)); 1464 le32_to_cpu(con->in_connect.global_seq));
1465 ceph_con_out_kvec_reset(con); 1465 con_out_kvec_reset(con);
1466 ret = prepare_write_connect(con); 1466 ret = prepare_write_connect(con);
1467 if (ret < 0) 1467 if (ret < 0)
1468 return ret; 1468 return ret;
@@ -1869,7 +1869,7 @@ more:
1869 1869
1870 /* open the socket first? */ 1870 /* open the socket first? */
1871 if (con->sock == NULL) { 1871 if (con->sock == NULL) {
1872 ceph_con_out_kvec_reset(con); 1872 con_out_kvec_reset(con);
1873 prepare_write_banner(con); 1873 prepare_write_banner(con);
1874 ret = prepare_write_connect(con); 1874 ret = prepare_write_connect(con);
1875 if (ret < 0) 1875 if (ret < 0)