aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.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/socket.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/socket.c')
-rw-r--r--net/tipc/socket.c188
1 files changed, 95 insertions, 93 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index aab4948f0aff..fb885977bd2a 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -60,8 +60,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf);
60static void wakeupdispatch(struct tipc_port *tport); 60static void wakeupdispatch(struct tipc_port *tport);
61static void tipc_data_ready(struct sock *sk, int len); 61static void tipc_data_ready(struct sock *sk, int len);
62static void tipc_write_space(struct sock *sk); 62static void tipc_write_space(struct sock *sk);
63static int release(struct socket *sock); 63static int tipc_release(struct socket *sock);
64static int accept(struct socket *sock, struct socket *new_sock, int flags); 64static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags);
65 65
66static const struct proto_ops packet_ops; 66static const struct proto_ops packet_ops;
67static const struct proto_ops stream_ops; 67static const struct proto_ops stream_ops;
@@ -256,7 +256,7 @@ int tipc_sock_create_local(int type, struct socket **res)
256 */ 256 */
257void tipc_sock_release_local(struct socket *sock) 257void tipc_sock_release_local(struct socket *sock)
258{ 258{
259 release(sock); 259 tipc_release(sock);
260 sock->ops = NULL; 260 sock->ops = NULL;
261 sock_release(sock); 261 sock_release(sock);
262} 262}
@@ -282,7 +282,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
282 if (ret < 0) 282 if (ret < 0)
283 return ret; 283 return ret;
284 284
285 ret = accept(sock, *newsock, flags); 285 ret = tipc_accept(sock, *newsock, flags);
286 if (ret < 0) { 286 if (ret < 0) {
287 sock_release(*newsock); 287 sock_release(*newsock);
288 return ret; 288 return ret;
@@ -292,7 +292,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
292} 292}
293 293
294/** 294/**
295 * release - destroy a TIPC socket 295 * tipc_release - destroy a TIPC socket
296 * @sock: socket to destroy 296 * @sock: socket to destroy
297 * 297 *
298 * This routine cleans up any messages that are still queued on the socket. 298 * This routine cleans up any messages that are still queued on the socket.
@@ -307,7 +307,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
307 * 307 *
308 * Returns 0 on success, errno otherwise 308 * Returns 0 on success, errno otherwise
309 */ 309 */
310static int release(struct socket *sock) 310static int tipc_release(struct socket *sock)
311{ 311{
312 struct sock *sk = sock->sk; 312 struct sock *sk = sock->sk;
313 struct tipc_port *tport; 313 struct tipc_port *tport;
@@ -338,7 +338,7 @@ static int release(struct socket *sock)
338 if ((sock->state == SS_CONNECTING) || 338 if ((sock->state == SS_CONNECTING) ||
339 (sock->state == SS_CONNECTED)) { 339 (sock->state == SS_CONNECTED)) {
340 sock->state = SS_DISCONNECTING; 340 sock->state = SS_DISCONNECTING;
341 tipc_disconnect(tport->ref); 341 tipc_port_disconnect(tport->ref);
342 } 342 }
343 tipc_reject_msg(buf, TIPC_ERR_NO_PORT); 343 tipc_reject_msg(buf, TIPC_ERR_NO_PORT);
344 } 344 }
@@ -364,7 +364,7 @@ static int release(struct socket *sock)
364} 364}
365 365
366/** 366/**
367 * bind - associate or disassocate TIPC name(s) with a socket 367 * tipc_bind - associate or disassocate TIPC name(s) with a socket
368 * @sock: socket structure 368 * @sock: socket structure
369 * @uaddr: socket address describing name(s) and desired operation 369 * @uaddr: socket address describing name(s) and desired operation
370 * @uaddr_len: size of socket address data structure 370 * @uaddr_len: size of socket address data structure
@@ -378,7 +378,8 @@ static int release(struct socket *sock)
378 * NOTE: This routine doesn't need to take the socket lock since it doesn't 378 * NOTE: This routine doesn't need to take the socket lock since it doesn't
379 * access any non-constant socket information. 379 * access any non-constant socket information.
380 */ 380 */
381static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len) 381static int tipc_bind(struct socket *sock, struct sockaddr *uaddr,
382 int uaddr_len)
382{ 383{
383 struct sock *sk = sock->sk; 384 struct sock *sk = sock->sk;
384 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr; 385 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
@@ -423,7 +424,7 @@ exit:
423} 424}
424 425
425/** 426/**
426 * get_name - get port ID of socket or peer socket 427 * tipc_getname - get port ID of socket or peer socket
427 * @sock: socket structure 428 * @sock: socket structure
428 * @uaddr: area for returned socket address 429 * @uaddr: area for returned socket address
429 * @uaddr_len: area for returned length of socket address 430 * @uaddr_len: area for returned length of socket address
@@ -435,8 +436,8 @@ exit:
435 * accesses socket information that is unchanging (or which changes in 436 * accesses socket information that is unchanging (or which changes in
436 * a completely predictable manner). 437 * a completely predictable manner).
437 */ 438 */
438static int get_name(struct socket *sock, struct sockaddr *uaddr, 439static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
439 int *uaddr_len, int peer) 440 int *uaddr_len, int peer)
440{ 441{
441 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr; 442 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
442 struct tipc_sock *tsock = tipc_sk(sock->sk); 443 struct tipc_sock *tsock = tipc_sk(sock->sk);
@@ -463,7 +464,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
463} 464}
464 465
465/** 466/**
466 * poll - read and possibly block on pollmask 467 * tipc_poll - read and possibly block on pollmask
467 * @file: file structure associated with the socket 468 * @file: file structure associated with the socket
468 * @sock: socket for which to calculate the poll bits 469 * @sock: socket for which to calculate the poll bits
469 * @wait: ??? 470 * @wait: ???
@@ -502,8 +503,8 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
502 * imply that the operation will succeed, merely that it should be performed 503 * imply that the operation will succeed, merely that it should be performed
503 * and will not block. 504 * and will not block.
504 */ 505 */
505static unsigned int poll(struct file *file, struct socket *sock, 506static unsigned int tipc_poll(struct file *file, struct socket *sock,
506 poll_table *wait) 507 poll_table *wait)
507{ 508{
508 struct sock *sk = sock->sk; 509 struct sock *sk = sock->sk;
509 u32 mask = 0; 510 u32 mask = 0;
@@ -590,7 +591,7 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
590} 591}
591 592
592/** 593/**
593 * send_msg - send message in connectionless manner 594 * tipc_sendmsg - send message in connectionless manner
594 * @iocb: if NULL, indicates that socket lock is already held 595 * @iocb: if NULL, indicates that socket lock is already held
595 * @sock: socket structure 596 * @sock: socket structure
596 * @m: message to send 597 * @m: message to send
@@ -603,8 +604,8 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
603 * 604 *
604 * Returns the number of bytes sent on success, or errno otherwise 605 * Returns the number of bytes sent on success, or errno otherwise
605 */ 606 */
606static int send_msg(struct kiocb *iocb, struct socket *sock, 607static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock,
607 struct msghdr *m, size_t total_len) 608 struct msghdr *m, size_t total_len)
608{ 609{
609 struct sock *sk = sock->sk; 610 struct sock *sk = sock->sk;
610 struct tipc_port *tport = tipc_sk_port(sk); 611 struct tipc_port *tport = tipc_sk_port(sk);
@@ -671,10 +672,10 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
671 res = dest_name_check(dest, m); 672 res = dest_name_check(dest, m);
672 if (res) 673 if (res)
673 break; 674 break;
674 res = tipc_multicast(tport->ref, 675 res = tipc_port_mcast_xmit(tport->ref,
675 &dest->addr.nameseq, 676 &dest->addr.nameseq,
676 m->msg_iov, 677 m->msg_iov,
677 total_len); 678 total_len);
678 } 679 }
679 if (likely(res != -ELINKCONG)) { 680 if (likely(res != -ELINKCONG)) {
680 if (needs_conn && (res >= 0)) 681 if (needs_conn && (res >= 0))
@@ -721,7 +722,7 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
721} 722}
722 723
723/** 724/**
724 * send_packet - send a connection-oriented message 725 * tipc_send_packet - send a connection-oriented message
725 * @iocb: if NULL, indicates that socket lock is already held 726 * @iocb: if NULL, indicates that socket lock is already held
726 * @sock: socket structure 727 * @sock: socket structure
727 * @m: message to send 728 * @m: message to send
@@ -731,8 +732,8 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
731 * 732 *
732 * Returns the number of bytes sent on success, or errno otherwise 733 * Returns the number of bytes sent on success, or errno otherwise
733 */ 734 */
734static int send_packet(struct kiocb *iocb, struct socket *sock, 735static int tipc_send_packet(struct kiocb *iocb, struct socket *sock,
735 struct msghdr *m, size_t total_len) 736 struct msghdr *m, size_t total_len)
736{ 737{
737 struct sock *sk = sock->sk; 738 struct sock *sk = sock->sk;
738 struct tipc_port *tport = tipc_sk_port(sk); 739 struct tipc_port *tport = tipc_sk_port(sk);
@@ -742,7 +743,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
742 743
743 /* Handle implied connection establishment */ 744 /* Handle implied connection establishment */
744 if (unlikely(dest)) 745 if (unlikely(dest))
745 return send_msg(iocb, sock, m, total_len); 746 return tipc_sendmsg(iocb, sock, m, total_len);
746 747
747 if (total_len > TIPC_MAX_USER_MSG_SIZE) 748 if (total_len > TIPC_MAX_USER_MSG_SIZE)
748 return -EMSGSIZE; 749 return -EMSGSIZE;
@@ -774,7 +775,7 @@ exit:
774} 775}
775 776
776/** 777/**
777 * send_stream - send stream-oriented data 778 * tipc_send_stream - send stream-oriented data
778 * @iocb: (unused) 779 * @iocb: (unused)
779 * @sock: socket structure 780 * @sock: socket structure
780 * @m: data to send 781 * @m: data to send
@@ -785,8 +786,8 @@ exit:
785 * Returns the number of bytes sent on success (or partial success), 786 * Returns the number of bytes sent on success (or partial success),
786 * or errno if no data sent 787 * or errno if no data sent
787 */ 788 */
788static int send_stream(struct kiocb *iocb, struct socket *sock, 789static int tipc_send_stream(struct kiocb *iocb, struct socket *sock,
789 struct msghdr *m, size_t total_len) 790 struct msghdr *m, size_t total_len)
790{ 791{
791 struct sock *sk = sock->sk; 792 struct sock *sk = sock->sk;
792 struct tipc_port *tport = tipc_sk_port(sk); 793 struct tipc_port *tport = tipc_sk_port(sk);
@@ -806,7 +807,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
806 /* Handle special cases where there is no connection */ 807 /* Handle special cases where there is no connection */
807 if (unlikely(sock->state != SS_CONNECTED)) { 808 if (unlikely(sock->state != SS_CONNECTED)) {
808 if (sock->state == SS_UNCONNECTED) 809 if (sock->state == SS_UNCONNECTED)
809 res = send_packet(NULL, sock, m, total_len); 810 res = tipc_send_packet(NULL, sock, m, total_len);
810 else 811 else
811 res = sock->state == SS_DISCONNECTING ? -EPIPE : -ENOTCONN; 812 res = sock->state == SS_DISCONNECTING ? -EPIPE : -ENOTCONN;
812 goto exit; 813 goto exit;
@@ -851,7 +852,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
851 bytes_to_send = curr_left; 852 bytes_to_send = curr_left;
852 my_iov.iov_base = curr_start; 853 my_iov.iov_base = curr_start;
853 my_iov.iov_len = bytes_to_send; 854 my_iov.iov_len = bytes_to_send;
854 res = send_packet(NULL, sock, &my_msg, bytes_to_send); 855 res = tipc_send_packet(NULL, sock, &my_msg,
856 bytes_to_send);
855 if (res < 0) { 857 if (res < 0) {
856 if (bytes_sent) 858 if (bytes_sent)
857 res = bytes_sent; 859 res = bytes_sent;
@@ -888,7 +890,7 @@ static int auto_connect(struct socket *sock, struct tipc_msg *msg)
888 if (!p_ptr) 890 if (!p_ptr)
889 return -EINVAL; 891 return -EINVAL;
890 892
891 __tipc_connect(tsock->p->ref, p_ptr, &tsock->peer_name); 893 __tipc_port_connect(tsock->p->ref, p_ptr, &tsock->peer_name);
892 894
893 if (msg_importance(msg) > TIPC_CRITICAL_IMPORTANCE) 895 if (msg_importance(msg) > TIPC_CRITICAL_IMPORTANCE)
894 return -EINVAL; 896 return -EINVAL;
@@ -1023,7 +1025,7 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
1023} 1025}
1024 1026
1025/** 1027/**
1026 * recv_msg - receive packet-oriented message 1028 * tipc_recvmsg - receive packet-oriented message
1027 * @iocb: (unused) 1029 * @iocb: (unused)
1028 * @m: descriptor for message info 1030 * @m: descriptor for message info
1029 * @buf_len: total size of user buffer area 1031 * @buf_len: total size of user buffer area
@@ -1034,8 +1036,8 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
1034 * 1036 *
1035 * Returns size of returned message data, errno otherwise 1037 * Returns size of returned message data, errno otherwise
1036 */ 1038 */
1037static int recv_msg(struct kiocb *iocb, struct socket *sock, 1039static int tipc_recvmsg(struct kiocb *iocb, struct socket *sock,
1038 struct msghdr *m, size_t buf_len, int flags) 1040 struct msghdr *m, size_t buf_len, int flags)
1039{ 1041{
1040 struct sock *sk = sock->sk; 1042 struct sock *sk = sock->sk;
1041 struct tipc_port *tport = tipc_sk_port(sk); 1043 struct tipc_port *tport = tipc_sk_port(sk);
@@ -1117,7 +1119,7 @@ exit:
1117} 1119}
1118 1120
1119/** 1121/**
1120 * recv_stream - receive stream-oriented data 1122 * tipc_recv_stream - receive stream-oriented data
1121 * @iocb: (unused) 1123 * @iocb: (unused)
1122 * @m: descriptor for message info 1124 * @m: descriptor for message info
1123 * @buf_len: total size of user buffer area 1125 * @buf_len: total size of user buffer area
@@ -1128,8 +1130,8 @@ exit:
1128 * 1130 *
1129 * Returns size of returned message data, errno otherwise 1131 * Returns size of returned message data, errno otherwise
1130 */ 1132 */
1131static int recv_stream(struct kiocb *iocb, struct socket *sock, 1133static int tipc_recv_stream(struct kiocb *iocb, struct socket *sock,
1132 struct msghdr *m, size_t buf_len, int flags) 1134 struct msghdr *m, size_t buf_len, int flags)
1133{ 1135{
1134 struct sock *sk = sock->sk; 1136 struct sock *sk = sock->sk;
1135 struct tipc_port *tport = tipc_sk_port(sk); 1137 struct tipc_port *tport = tipc_sk_port(sk);
@@ -1291,7 +1293,7 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf)
1291 if (msg_connected(msg) && tipc_port_peer_msg(tsock->p, msg)) { 1293 if (msg_connected(msg) && tipc_port_peer_msg(tsock->p, msg)) {
1292 if (unlikely(msg_errcode(msg))) { 1294 if (unlikely(msg_errcode(msg))) {
1293 sock->state = SS_DISCONNECTING; 1295 sock->state = SS_DISCONNECTING;
1294 __tipc_disconnect(tsock->p); 1296 __tipc_port_disconnect(tsock->p);
1295 } 1297 }
1296 retval = TIPC_OK; 1298 retval = TIPC_OK;
1297 } 1299 }
@@ -1506,7 +1508,7 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
1506} 1508}
1507 1509
1508/** 1510/**
1509 * connect - establish a connection to another TIPC port 1511 * tipc_connect - establish a connection to another TIPC port
1510 * @sock: socket structure 1512 * @sock: socket structure
1511 * @dest: socket address for destination port 1513 * @dest: socket address for destination port
1512 * @destlen: size of socket address data structure 1514 * @destlen: size of socket address data structure
@@ -1514,8 +1516,8 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
1514 * 1516 *
1515 * Returns 0 on success, errno otherwise 1517 * Returns 0 on success, errno otherwise
1516 */ 1518 */
1517static int connect(struct socket *sock, struct sockaddr *dest, int destlen, 1519static int tipc_connect(struct socket *sock, struct sockaddr *dest,
1518 int flags) 1520 int destlen, int flags)
1519{ 1521{
1520 struct sock *sk = sock->sk; 1522 struct sock *sk = sock->sk;
1521 struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest; 1523 struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
@@ -1556,7 +1558,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
1556 if (!timeout) 1558 if (!timeout)
1557 m.msg_flags = MSG_DONTWAIT; 1559 m.msg_flags = MSG_DONTWAIT;
1558 1560
1559 res = send_msg(NULL, sock, &m, 0); 1561 res = tipc_sendmsg(NULL, sock, &m, 0);
1560 if ((res < 0) && (res != -EWOULDBLOCK)) 1562 if ((res < 0) && (res != -EWOULDBLOCK))
1561 goto exit; 1563 goto exit;
1562 1564
@@ -1587,13 +1589,13 @@ exit:
1587} 1589}
1588 1590
1589/** 1591/**
1590 * listen - allow socket to listen for incoming connections 1592 * tipc_listen - allow socket to listen for incoming connections
1591 * @sock: socket structure 1593 * @sock: socket structure
1592 * @len: (unused) 1594 * @len: (unused)
1593 * 1595 *
1594 * Returns 0 on success, errno otherwise 1596 * Returns 0 on success, errno otherwise
1595 */ 1597 */
1596static int listen(struct socket *sock, int len) 1598static int tipc_listen(struct socket *sock, int len)
1597{ 1599{
1598 struct sock *sk = sock->sk; 1600 struct sock *sk = sock->sk;
1599 int res; 1601 int res;
@@ -1648,14 +1650,14 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)
1648} 1650}
1649 1651
1650/** 1652/**
1651 * accept - wait for connection request 1653 * tipc_accept - wait for connection request
1652 * @sock: listening socket 1654 * @sock: listening socket
1653 * @newsock: new socket that is to be connected 1655 * @newsock: new socket that is to be connected
1654 * @flags: file-related flags associated with socket 1656 * @flags: file-related flags associated with socket
1655 * 1657 *
1656 * Returns 0 on success, errno otherwise 1658 * Returns 0 on success, errno otherwise
1657 */ 1659 */
1658static int accept(struct socket *sock, struct socket *new_sock, int flags) 1660static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags)
1659{ 1661{
1660 struct sock *new_sk, *sk = sock->sk; 1662 struct sock *new_sk, *sk = sock->sk;
1661 struct sk_buff *buf; 1663 struct sk_buff *buf;
@@ -1702,7 +1704,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
1702 /* Connect new socket to it's peer */ 1704 /* Connect new socket to it's peer */
1703 new_tsock->peer_name.ref = msg_origport(msg); 1705 new_tsock->peer_name.ref = msg_origport(msg);
1704 new_tsock->peer_name.node = msg_orignode(msg); 1706 new_tsock->peer_name.node = msg_orignode(msg);
1705 tipc_connect(new_ref, &new_tsock->peer_name); 1707 tipc_port_connect(new_ref, &new_tsock->peer_name);
1706 new_sock->state = SS_CONNECTED; 1708 new_sock->state = SS_CONNECTED;
1707 1709
1708 tipc_set_portimportance(new_ref, msg_importance(msg)); 1710 tipc_set_portimportance(new_ref, msg_importance(msg));
@@ -1719,7 +1721,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
1719 struct msghdr m = {NULL,}; 1721 struct msghdr m = {NULL,};
1720 1722
1721 advance_rx_queue(sk); 1723 advance_rx_queue(sk);
1722 send_packet(NULL, new_sock, &m, 0); 1724 tipc_send_packet(NULL, new_sock, &m, 0);
1723 } else { 1725 } else {
1724 __skb_dequeue(&sk->sk_receive_queue); 1726 __skb_dequeue(&sk->sk_receive_queue);
1725 __skb_queue_head(&new_sk->sk_receive_queue, buf); 1727 __skb_queue_head(&new_sk->sk_receive_queue, buf);
@@ -1733,7 +1735,7 @@ exit:
1733} 1735}
1734 1736
1735/** 1737/**
1736 * shutdown - shutdown socket connection 1738 * tipc_shutdown - shutdown socket connection
1737 * @sock: socket structure 1739 * @sock: socket structure
1738 * @how: direction to close (must be SHUT_RDWR) 1740 * @how: direction to close (must be SHUT_RDWR)
1739 * 1741 *
@@ -1741,7 +1743,7 @@ exit:
1741 * 1743 *
1742 * Returns 0 on success, errno otherwise 1744 * Returns 0 on success, errno otherwise
1743 */ 1745 */
1744static int shutdown(struct socket *sock, int how) 1746static int tipc_shutdown(struct socket *sock, int how)
1745{ 1747{
1746 struct sock *sk = sock->sk; 1748 struct sock *sk = sock->sk;
1747 struct tipc_port *tport = tipc_sk_port(sk); 1749 struct tipc_port *tport = tipc_sk_port(sk);
@@ -1765,10 +1767,10 @@ restart:
1765 kfree_skb(buf); 1767 kfree_skb(buf);
1766 goto restart; 1768 goto restart;
1767 } 1769 }
1768 tipc_disconnect(tport->ref); 1770 tipc_port_disconnect(tport->ref);
1769 tipc_reject_msg(buf, TIPC_CONN_SHUTDOWN); 1771 tipc_reject_msg(buf, TIPC_CONN_SHUTDOWN);
1770 } else { 1772 } else {
1771 tipc_shutdown(tport->ref); 1773 tipc_port_shutdown(tport->ref);
1772 } 1774 }
1773 1775
1774 sock->state = SS_DISCONNECTING; 1776 sock->state = SS_DISCONNECTING;
@@ -1794,7 +1796,7 @@ restart:
1794} 1796}
1795 1797
1796/** 1798/**
1797 * setsockopt - set socket option 1799 * tipc_setsockopt - set socket option
1798 * @sock: socket structure 1800 * @sock: socket structure
1799 * @lvl: option level 1801 * @lvl: option level
1800 * @opt: option identifier 1802 * @opt: option identifier
@@ -1806,8 +1808,8 @@ restart:
1806 * 1808 *
1807 * Returns 0 on success, errno otherwise 1809 * Returns 0 on success, errno otherwise
1808 */ 1810 */
1809static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, 1811static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
1810 unsigned int ol) 1812 char __user *ov, unsigned int ol)
1811{ 1813{
1812 struct sock *sk = sock->sk; 1814 struct sock *sk = sock->sk;
1813 struct tipc_port *tport = tipc_sk_port(sk); 1815 struct tipc_port *tport = tipc_sk_port(sk);
@@ -1853,7 +1855,7 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
1853} 1855}
1854 1856
1855/** 1857/**
1856 * getsockopt - get socket option 1858 * tipc_getsockopt - get socket option
1857 * @sock: socket structure 1859 * @sock: socket structure
1858 * @lvl: option level 1860 * @lvl: option level
1859 * @opt: option identifier 1861 * @opt: option identifier
@@ -1865,8 +1867,8 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
1865 * 1867 *
1866 * Returns 0 on success, errno otherwise 1868 * Returns 0 on success, errno otherwise
1867 */ 1869 */
1868static int getsockopt(struct socket *sock, int lvl, int opt, char __user *ov, 1870static int tipc_getsockopt(struct socket *sock, int lvl, int opt,
1869 int __user *ol) 1871 char __user *ov, int __user *ol)
1870{ 1872{
1871 struct sock *sk = sock->sk; 1873 struct sock *sk = sock->sk;
1872 struct tipc_port *tport = tipc_sk_port(sk); 1874 struct tipc_port *tport = tipc_sk_port(sk);
@@ -1927,20 +1929,20 @@ static int getsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
1927static const struct proto_ops msg_ops = { 1929static const struct proto_ops msg_ops = {
1928 .owner = THIS_MODULE, 1930 .owner = THIS_MODULE,
1929 .family = AF_TIPC, 1931 .family = AF_TIPC,
1930 .release = release, 1932 .release = tipc_release,
1931 .bind = bind, 1933 .bind = tipc_bind,
1932 .connect = connect, 1934 .connect = tipc_connect,
1933 .socketpair = sock_no_socketpair, 1935 .socketpair = sock_no_socketpair,
1934 .accept = sock_no_accept, 1936 .accept = sock_no_accept,
1935 .getname = get_name, 1937 .getname = tipc_getname,
1936 .poll = poll, 1938 .poll = tipc_poll,
1937 .ioctl = sock_no_ioctl, 1939 .ioctl = sock_no_ioctl,
1938 .listen = sock_no_listen, 1940 .listen = sock_no_listen,
1939 .shutdown = shutdown, 1941 .shutdown = tipc_shutdown,
1940 .setsockopt = setsockopt, 1942 .setsockopt = tipc_setsockopt,
1941 .getsockopt = getsockopt, 1943 .getsockopt = tipc_getsockopt,
1942 .sendmsg = send_msg, 1944 .sendmsg = tipc_sendmsg,
1943 .recvmsg = recv_msg, 1945 .recvmsg = tipc_recvmsg,
1944 .mmap = sock_no_mmap, 1946 .mmap = sock_no_mmap,
1945 .sendpage = sock_no_sendpage 1947 .sendpage = sock_no_sendpage
1946}; 1948};
@@ -1948,20 +1950,20 @@ static const struct proto_ops msg_ops = {
1948static const struct proto_ops packet_ops = { 1950static const struct proto_ops packet_ops = {
1949 .owner = THIS_MODULE, 1951 .owner = THIS_MODULE,
1950 .family = AF_TIPC, 1952 .family = AF_TIPC,
1951 .release = release, 1953 .release = tipc_release,
1952 .bind = bind, 1954 .bind = tipc_bind,
1953 .connect = connect, 1955 .connect = tipc_connect,
1954 .socketpair = sock_no_socketpair, 1956 .socketpair = sock_no_socketpair,
1955 .accept = accept, 1957 .accept = tipc_accept,
1956 .getname = get_name, 1958 .getname = tipc_getname,
1957 .poll = poll, 1959 .poll = tipc_poll,
1958 .ioctl = sock_no_ioctl, 1960 .ioctl = sock_no_ioctl,
1959 .listen = listen, 1961 .listen = tipc_listen,
1960 .shutdown = shutdown, 1962 .shutdown = tipc_shutdown,
1961 .setsockopt = setsockopt, 1963 .setsockopt = tipc_setsockopt,
1962 .getsockopt = getsockopt, 1964 .getsockopt = tipc_getsockopt,
1963 .sendmsg = send_packet, 1965 .sendmsg = tipc_send_packet,
1964 .recvmsg = recv_msg, 1966 .recvmsg = tipc_recvmsg,
1965 .mmap = sock_no_mmap, 1967 .mmap = sock_no_mmap,
1966 .sendpage = sock_no_sendpage 1968 .sendpage = sock_no_sendpage
1967}; 1969};
@@ -1969,20 +1971,20 @@ static const struct proto_ops packet_ops = {
1969static const struct proto_ops stream_ops = { 1971static const struct proto_ops stream_ops = {
1970 .owner = THIS_MODULE, 1972 .owner = THIS_MODULE,
1971 .family = AF_TIPC, 1973 .family = AF_TIPC,
1972 .release = release, 1974 .release = tipc_release,
1973 .bind = bind, 1975 .bind = tipc_bind,
1974 .connect = connect, 1976 .connect = tipc_connect,
1975 .socketpair = sock_no_socketpair, 1977 .socketpair = sock_no_socketpair,
1976 .accept = accept, 1978 .accept = tipc_accept,
1977 .getname = get_name, 1979 .getname = tipc_getname,
1978 .poll = poll, 1980 .poll = tipc_poll,
1979 .ioctl = sock_no_ioctl, 1981 .ioctl = sock_no_ioctl,
1980 .listen = listen, 1982 .listen = tipc_listen,
1981 .shutdown = shutdown, 1983 .shutdown = tipc_shutdown,
1982 .setsockopt = setsockopt, 1984 .setsockopt = tipc_setsockopt,
1983 .getsockopt = getsockopt, 1985 .getsockopt = tipc_getsockopt,
1984 .sendmsg = send_stream, 1986 .sendmsg = tipc_send_stream,
1985 .recvmsg = recv_stream, 1987 .recvmsg = tipc_recv_stream,
1986 .mmap = sock_no_mmap, 1988 .mmap = sock_no_mmap,
1987 .sendpage = sock_no_sendpage 1989 .sendpage = sock_no_sendpage
1988}; 1990};