aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/port.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-02-18 03:06:46 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-18 17:31:59 -0500
commit247f0f3c3176c55b46cb9a20011d3d6757634815 (patch)
tree634cb9d42ab33082f75f152a5886dffbcb9cc825 /net/tipc/port.c
parentb356e978e92fccd17a3e4620a4821bdbfb706c1a (diff)
tipc: align tipc function names with common naming practice in the network
Rename the following functions, which are shorter and more in line with common naming practice in the network subsystem. tipc_bclink_send_msg->tipc_bclink_xmit tipc_bclink_recv_pkt->tipc_bclink_rcv tipc_disc_recv_msg->tipc_disc_rcv tipc_link_send_proto_msg->tipc_link_proto_xmit link_recv_proto_msg->tipc_link_proto_rcv link_send_sections_long->tipc_link_iovec_long_xmit tipc_link_send_sections_fast->tipc_link_iovec_xmit_fast tipc_link_send_sync->tipc_link_sync_xmit tipc_link_recv_sync->tipc_link_sync_rcv tipc_link_send_buf->__tipc_link_xmit tipc_link_send->tipc_link_xmit tipc_link_send_names->tipc_link_names_xmit tipc_named_recv->tipc_named_rcv tipc_link_recv_bundle->tipc_link_bundle_rcv tipc_link_dup_send_queue->tipc_link_dup_queue_xmit link_send_long_buf->tipc_link_frag_xmit tipc_multicast->tipc_port_mcast_xmit tipc_port_recv_mcast->tipc_port_mcast_rcv tipc_port_reject_sections->tipc_port_iovec_reject tipc_port_recv_proto_msg->tipc_port_proto_rcv tipc_connect->tipc_port_connect __tipc_connect->__tipc_port_connect __tipc_disconnect->__tipc_port_disconnect tipc_disconnect->tipc_port_disconnect tipc_shutdown->tipc_port_shutdown tipc_port_recv_msg->tipc_port_rcv tipc_port_recv_sections->tipc_port_iovec_rcv release->tipc_release accept->tipc_accept bind->tipc_bind get_name->tipc_getname poll->tipc_poll send_msg->tipc_sendmsg send_packet->tipc_send_packet send_stream->tipc_send_stream recv_msg->tipc_recvmsg recv_stream->tipc_recv_stream connect->tipc_connect listen->tipc_listen shutdown->tipc_shutdown setsockopt->tipc_setsockopt getsockopt->tipc_getsockopt Above changes have no impact on current users of the functions. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r--net/tipc/port.c97
1 files changed, 49 insertions, 48 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c
index b742b2654525..c7c2b549a39e 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -87,10 +87,11 @@ int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg)
87} 87}
88 88
89/** 89/**
90 * tipc_multicast - send a multicast message to local and remote destinations 90 * tipc_port_mcast_xmit - send a multicast message to local and remote
91 * destinations
91 */ 92 */
92int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, 93int tipc_port_mcast_xmit(u32 ref, struct tipc_name_seq const *seq,
93 struct iovec const *msg_sect, unsigned int len) 94 struct iovec const *msg_sect, unsigned int len)
94{ 95{
95 struct tipc_msg *hdr; 96 struct tipc_msg *hdr;
96 struct sk_buff *buf; 97 struct sk_buff *buf;
@@ -131,7 +132,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
131 return -ENOMEM; 132 return -ENOMEM;
132 } 133 }
133 } 134 }
134 res = tipc_bclink_send_msg(buf); 135 res = tipc_bclink_xmit(buf);
135 if ((res < 0) && (dports.count != 0)) 136 if ((res < 0) && (dports.count != 0))
136 kfree_skb(ibuf); 137 kfree_skb(ibuf);
137 } else { 138 } else {
@@ -140,7 +141,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
140 141
141 if (res >= 0) { 142 if (res >= 0) {
142 if (ibuf) 143 if (ibuf)
143 tipc_port_recv_mcast(ibuf, &dports); 144 tipc_port_mcast_rcv(ibuf, &dports);
144 } else { 145 } else {
145 tipc_port_list_free(&dports); 146 tipc_port_list_free(&dports);
146 } 147 }
@@ -148,11 +149,11 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
148} 149}
149 150
150/** 151/**
151 * tipc_port_recv_mcast - deliver multicast message to all destination ports 152 * tipc_port_mcast_rcv - deliver multicast message to all destination ports
152 * 153 *
153 * If there is no port list, perform a lookup to create one 154 * If there is no port list, perform a lookup to create one
154 */ 155 */
155void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) 156void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp)
156{ 157{
157 struct tipc_msg *msg; 158 struct tipc_msg *msg;
158 struct tipc_port_list dports = {0, NULL, }; 159 struct tipc_port_list dports = {0, NULL, };
@@ -176,7 +177,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp)
176 msg_set_destnode(msg, tipc_own_addr); 177 msg_set_destnode(msg, tipc_own_addr);
177 if (dp->count == 1) { 178 if (dp->count == 1) {
178 msg_set_destport(msg, dp->ports[0]); 179 msg_set_destport(msg, dp->ports[0]);
179 tipc_port_recv_msg(buf); 180 tipc_port_rcv(buf);
180 tipc_port_list_free(dp); 181 tipc_port_list_free(dp);
181 return; 182 return;
182 } 183 }
@@ -191,7 +192,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp)
191 if ((index == 0) && (cnt != 0)) 192 if ((index == 0) && (cnt != 0))
192 item = item->next; 193 item = item->next;
193 msg_set_destport(buf_msg(b), item->ports[index]); 194 msg_set_destport(buf_msg(b), item->ports[index]);
194 tipc_port_recv_msg(b); 195 tipc_port_rcv(b);
195 } 196 }
196 } 197 }
197exit: 198exit:
@@ -422,17 +423,17 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
422 /* send returned message & dispose of rejected message */ 423 /* send returned message & dispose of rejected message */
423 src_node = msg_prevnode(msg); 424 src_node = msg_prevnode(msg);
424 if (in_own_node(src_node)) 425 if (in_own_node(src_node))
425 tipc_port_recv_msg(rbuf); 426 tipc_port_rcv(rbuf);
426 else 427 else
427 tipc_link_send(rbuf, src_node, msg_link_selector(rmsg)); 428 tipc_link_xmit(rbuf, src_node, msg_link_selector(rmsg));
428exit: 429exit:
429 kfree_skb(buf); 430 kfree_skb(buf);
430 return data_sz; 431 return data_sz;
431} 432}
432 433
433int tipc_port_reject_sections(struct tipc_port *p_ptr, struct tipc_msg *hdr, 434int tipc_port_iovec_reject(struct tipc_port *p_ptr, struct tipc_msg *hdr,
434 struct iovec const *msg_sect, unsigned int len, 435 struct iovec const *msg_sect, unsigned int len,
435 int err) 436 int err)
436{ 437{
437 struct sk_buff *buf; 438 struct sk_buff *buf;
438 int res; 439 int res;
@@ -519,7 +520,7 @@ static struct sk_buff *port_build_peer_abort_msg(struct tipc_port *p_ptr, u32 er
519 return buf; 520 return buf;
520} 521}
521 522
522void tipc_port_recv_proto_msg(struct sk_buff *buf) 523void tipc_port_proto_rcv(struct sk_buff *buf)
523{ 524{
524 struct tipc_msg *msg = buf_msg(buf); 525 struct tipc_msg *msg = buf_msg(buf);
525 struct tipc_port *p_ptr; 526 struct tipc_port *p_ptr;
@@ -760,7 +761,7 @@ int tipc_withdraw(struct tipc_port *p_ptr, unsigned int scope,
760 return res; 761 return res;
761} 762}
762 763
763int tipc_connect(u32 ref, struct tipc_portid const *peer) 764int tipc_port_connect(u32 ref, struct tipc_portid const *peer)
764{ 765{
765 struct tipc_port *p_ptr; 766 struct tipc_port *p_ptr;
766 int res; 767 int res;
@@ -768,17 +769,17 @@ int tipc_connect(u32 ref, struct tipc_portid const *peer)
768 p_ptr = tipc_port_lock(ref); 769 p_ptr = tipc_port_lock(ref);
769 if (!p_ptr) 770 if (!p_ptr)
770 return -EINVAL; 771 return -EINVAL;
771 res = __tipc_connect(ref, p_ptr, peer); 772 res = __tipc_port_connect(ref, p_ptr, peer);
772 tipc_port_unlock(p_ptr); 773 tipc_port_unlock(p_ptr);
773 return res; 774 return res;
774} 775}
775 776
776/* 777/*
777 * __tipc_connect - connect to a remote peer 778 * __tipc_port_connect - connect to a remote peer
778 * 779 *
779 * Port must be locked. 780 * Port must be locked.
780 */ 781 */
781int __tipc_connect(u32 ref, struct tipc_port *p_ptr, 782int __tipc_port_connect(u32 ref, struct tipc_port *p_ptr,
782 struct tipc_portid const *peer) 783 struct tipc_portid const *peer)
783{ 784{
784 struct tipc_msg *msg; 785 struct tipc_msg *msg;
@@ -815,7 +816,7 @@ exit:
815 * 816 *
816 * Port must be locked. 817 * Port must be locked.
817 */ 818 */
818int __tipc_disconnect(struct tipc_port *tp_ptr) 819int __tipc_port_disconnect(struct tipc_port *tp_ptr)
819{ 820{
820 if (tp_ptr->connected) { 821 if (tp_ptr->connected) {
821 tp_ptr->connected = 0; 822 tp_ptr->connected = 0;
@@ -828,10 +829,10 @@ int __tipc_disconnect(struct tipc_port *tp_ptr)
828} 829}
829 830
830/* 831/*
831 * tipc_disconnect(): Disconnect port form peer. 832 * tipc_port_disconnect(): Disconnect port form peer.
832 * This is a node local operation. 833 * This is a node local operation.
833 */ 834 */
834int tipc_disconnect(u32 ref) 835int tipc_port_disconnect(u32 ref)
835{ 836{
836 struct tipc_port *p_ptr; 837 struct tipc_port *p_ptr;
837 int res; 838 int res;
@@ -839,15 +840,15 @@ int tipc_disconnect(u32 ref)
839 p_ptr = tipc_port_lock(ref); 840 p_ptr = tipc_port_lock(ref);
840 if (!p_ptr) 841 if (!p_ptr)
841 return -EINVAL; 842 return -EINVAL;
842 res = __tipc_disconnect(p_ptr); 843 res = __tipc_port_disconnect(p_ptr);
843 tipc_port_unlock(p_ptr); 844 tipc_port_unlock(p_ptr);
844 return res; 845 return res;
845} 846}
846 847
847/* 848/*
848 * tipc_shutdown(): Send a SHUTDOWN msg to peer and disconnect 849 * tipc_port_shutdown(): Send a SHUTDOWN msg to peer and disconnect
849 */ 850 */
850int tipc_shutdown(u32 ref) 851int tipc_port_shutdown(u32 ref)
851{ 852{
852 struct tipc_port *p_ptr; 853 struct tipc_port *p_ptr;
853 struct sk_buff *buf = NULL; 854 struct sk_buff *buf = NULL;
@@ -859,13 +860,13 @@ int tipc_shutdown(u32 ref)
859 buf = port_build_peer_abort_msg(p_ptr, TIPC_CONN_SHUTDOWN); 860 buf = port_build_peer_abort_msg(p_ptr, TIPC_CONN_SHUTDOWN);
860 tipc_port_unlock(p_ptr); 861 tipc_port_unlock(p_ptr);
861 tipc_net_route_msg(buf); 862 tipc_net_route_msg(buf);
862 return tipc_disconnect(ref); 863 return tipc_port_disconnect(ref);
863} 864}
864 865
865/** 866/**
866 * tipc_port_recv_msg - receive message from lower layer and deliver to port user 867 * tipc_port_rcv - receive message from lower layer and deliver to port user
867 */ 868 */
868int tipc_port_recv_msg(struct sk_buff *buf) 869int tipc_port_rcv(struct sk_buff *buf)
869{ 870{
870 struct tipc_port *p_ptr; 871 struct tipc_port *p_ptr;
871 struct tipc_msg *msg = buf_msg(buf); 872 struct tipc_msg *msg = buf_msg(buf);
@@ -894,19 +895,19 @@ int tipc_port_recv_msg(struct sk_buff *buf)
894} 895}
895 896
896/* 897/*
897 * tipc_port_recv_sections(): Concatenate and deliver sectioned 898 * tipc_port_iovec_rcv: Concatenate and deliver sectioned
898 * message for this node. 899 * message for this node.
899 */ 900 */
900static int tipc_port_recv_sections(struct tipc_port *sender, 901static int tipc_port_iovec_rcv(struct tipc_port *sender,
901 struct iovec const *msg_sect, 902 struct iovec const *msg_sect,
902 unsigned int len) 903 unsigned int len)
903{ 904{
904 struct sk_buff *buf; 905 struct sk_buff *buf;
905 int res; 906 int res;
906 907
907 res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf); 908 res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf);
908 if (likely(buf)) 909 if (likely(buf))
909 tipc_port_recv_msg(buf); 910 tipc_port_rcv(buf);
910 return res; 911 return res;
911} 912}
912 913
@@ -927,10 +928,10 @@ int tipc_send(u32 ref, struct iovec const *msg_sect, unsigned int len)
927 if (!tipc_port_congested(p_ptr)) { 928 if (!tipc_port_congested(p_ptr)) {
928 destnode = port_peernode(p_ptr); 929 destnode = port_peernode(p_ptr);
929 if (likely(!in_own_node(destnode))) 930 if (likely(!in_own_node(destnode)))
930 res = tipc_link_send_sections_fast(p_ptr, msg_sect, 931 res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
931 len, destnode); 932 destnode);
932 else 933 else
933 res = tipc_port_recv_sections(p_ptr, msg_sect, len); 934 res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
934 935
935 if (likely(res != -ELINKCONG)) { 936 if (likely(res != -ELINKCONG)) {
936 p_ptr->congested = 0; 937 p_ptr->congested = 0;
@@ -974,13 +975,13 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
974 975
975 if (likely(destport || destnode)) { 976 if (likely(destport || destnode)) {
976 if (likely(in_own_node(destnode))) 977 if (likely(in_own_node(destnode)))
977 res = tipc_port_recv_sections(p_ptr, msg_sect, len); 978 res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
978 else if (tipc_own_addr) 979 else if (tipc_own_addr)
979 res = tipc_link_send_sections_fast(p_ptr, msg_sect, 980 res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
980 len, destnode); 981 destnode);
981 else 982 else
982 res = tipc_port_reject_sections(p_ptr, msg, msg_sect, 983 res = tipc_port_iovec_reject(p_ptr, msg, msg_sect,
983 len, TIPC_ERR_NO_NODE); 984 len, TIPC_ERR_NO_NODE);
984 if (likely(res != -ELINKCONG)) { 985 if (likely(res != -ELINKCONG)) {
985 if (res > 0) 986 if (res > 0)
986 p_ptr->sent++; 987 p_ptr->sent++;
@@ -991,8 +992,8 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
991 } 992 }
992 return -ELINKCONG; 993 return -ELINKCONG;
993 } 994 }
994 return tipc_port_reject_sections(p_ptr, msg, msg_sect, len, 995 return tipc_port_iovec_reject(p_ptr, msg, msg_sect, len,
995 TIPC_ERR_NO_NAME); 996 TIPC_ERR_NO_NAME);
996} 997}
997 998
998/** 999/**
@@ -1017,12 +1018,12 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
1017 msg_set_hdr_sz(msg, BASIC_H_SIZE); 1018 msg_set_hdr_sz(msg, BASIC_H_SIZE);
1018 1019
1019 if (in_own_node(dest->node)) 1020 if (in_own_node(dest->node))
1020 res = tipc_port_recv_sections(p_ptr, msg_sect, len); 1021 res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
1021 else if (tipc_own_addr) 1022 else if (tipc_own_addr)
1022 res = tipc_link_send_sections_fast(p_ptr, msg_sect, len, 1023 res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
1023 dest->node); 1024 dest->node);
1024 else 1025 else
1025 res = tipc_port_reject_sections(p_ptr, msg, msg_sect, len, 1026 res = tipc_port_iovec_reject(p_ptr, msg, msg_sect, len,
1026 TIPC_ERR_NO_NODE); 1027 TIPC_ERR_NO_NODE);
1027 if (likely(res != -ELINKCONG)) { 1028 if (likely(res != -ELINKCONG)) {
1028 if (res > 0) 1029 if (res > 0)