diff options
Diffstat (limited to 'net/tipc/socket.c')
| -rw-r--r-- | net/tipc/socket.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 1ea64f09cc45..66e889ba48fd 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -40,9 +40,9 @@ | |||
| 40 | #include <linux/socket.h> | 40 | #include <linux/socket.h> |
| 41 | #include <linux/errno.h> | 41 | #include <linux/errno.h> |
| 42 | #include <linux/mm.h> | 42 | #include <linux/mm.h> |
| 43 | #include <linux/slab.h> | ||
| 44 | #include <linux/poll.h> | 43 | #include <linux/poll.h> |
| 45 | #include <linux/fcntl.h> | 44 | #include <linux/fcntl.h> |
| 45 | #include <linux/gfp.h> | ||
| 46 | #include <asm/string.h> | 46 | #include <asm/string.h> |
| 47 | #include <asm/atomic.h> | 47 | #include <asm/atomic.h> |
| 48 | #include <net/sock.h> | 48 | #include <net/sock.h> |
| @@ -446,7 +446,7 @@ static unsigned int poll(struct file *file, struct socket *sock, | |||
| 446 | struct sock *sk = sock->sk; | 446 | struct sock *sk = sock->sk; |
| 447 | u32 mask; | 447 | u32 mask; |
| 448 | 448 | ||
| 449 | poll_wait(file, sk->sk_sleep, wait); | 449 | poll_wait(file, sk_sleep(sk), wait); |
| 450 | 450 | ||
| 451 | if (!skb_queue_empty(&sk->sk_receive_queue) || | 451 | if (!skb_queue_empty(&sk->sk_receive_queue) || |
| 452 | (sock->state == SS_UNCONNECTED) || | 452 | (sock->state == SS_UNCONNECTED) || |
| @@ -591,7 +591,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, | |||
| 591 | break; | 591 | break; |
| 592 | } | 592 | } |
| 593 | release_sock(sk); | 593 | release_sock(sk); |
| 594 | res = wait_event_interruptible(*sk->sk_sleep, | 594 | res = wait_event_interruptible(*sk_sleep(sk), |
| 595 | !tport->congested); | 595 | !tport->congested); |
| 596 | lock_sock(sk); | 596 | lock_sock(sk); |
| 597 | if (res) | 597 | if (res) |
| @@ -650,7 +650,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, | |||
| 650 | break; | 650 | break; |
| 651 | } | 651 | } |
| 652 | release_sock(sk); | 652 | release_sock(sk); |
| 653 | res = wait_event_interruptible(*sk->sk_sleep, | 653 | res = wait_event_interruptible(*sk_sleep(sk), |
| 654 | (!tport->congested || !tport->connected)); | 654 | (!tport->congested || !tport->connected)); |
| 655 | lock_sock(sk); | 655 | lock_sock(sk); |
| 656 | if (res) | 656 | if (res) |
| @@ -931,7 +931,7 @@ restart: | |||
| 931 | goto exit; | 931 | goto exit; |
| 932 | } | 932 | } |
| 933 | release_sock(sk); | 933 | release_sock(sk); |
| 934 | res = wait_event_interruptible(*sk->sk_sleep, | 934 | res = wait_event_interruptible(*sk_sleep(sk), |
| 935 | (!skb_queue_empty(&sk->sk_receive_queue) || | 935 | (!skb_queue_empty(&sk->sk_receive_queue) || |
| 936 | (sock->state == SS_DISCONNECTING))); | 936 | (sock->state == SS_DISCONNECTING))); |
| 937 | lock_sock(sk); | 937 | lock_sock(sk); |
| @@ -1064,7 +1064,7 @@ restart: | |||
| 1064 | goto exit; | 1064 | goto exit; |
| 1065 | } | 1065 | } |
| 1066 | release_sock(sk); | 1066 | release_sock(sk); |
| 1067 | res = wait_event_interruptible(*sk->sk_sleep, | 1067 | res = wait_event_interruptible(*sk_sleep(sk), |
| 1068 | (!skb_queue_empty(&sk->sk_receive_queue) || | 1068 | (!skb_queue_empty(&sk->sk_receive_queue) || |
| 1069 | (sock->state == SS_DISCONNECTING))); | 1069 | (sock->state == SS_DISCONNECTING))); |
| 1070 | lock_sock(sk); | 1070 | lock_sock(sk); |
| @@ -1271,8 +1271,8 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf) | |||
| 1271 | tipc_disconnect_port(tipc_sk_port(sk)); | 1271 | tipc_disconnect_port(tipc_sk_port(sk)); |
| 1272 | } | 1272 | } |
| 1273 | 1273 | ||
| 1274 | if (waitqueue_active(sk->sk_sleep)) | 1274 | if (waitqueue_active(sk_sleep(sk))) |
| 1275 | wake_up_interruptible(sk->sk_sleep); | 1275 | wake_up_interruptible(sk_sleep(sk)); |
| 1276 | return TIPC_OK; | 1276 | return TIPC_OK; |
| 1277 | } | 1277 | } |
| 1278 | 1278 | ||
| @@ -1322,8 +1322,10 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf) | |||
| 1322 | if (!sock_owned_by_user(sk)) { | 1322 | if (!sock_owned_by_user(sk)) { |
| 1323 | res = filter_rcv(sk, buf); | 1323 | res = filter_rcv(sk, buf); |
| 1324 | } else { | 1324 | } else { |
| 1325 | sk_add_backlog(sk, buf); | 1325 | if (sk_add_backlog(sk, buf)) |
| 1326 | res = TIPC_OK; | 1326 | res = TIPC_ERR_OVERLOAD; |
| 1327 | else | ||
| 1328 | res = TIPC_OK; | ||
| 1327 | } | 1329 | } |
| 1328 | bh_unlock_sock(sk); | 1330 | bh_unlock_sock(sk); |
| 1329 | 1331 | ||
| @@ -1341,8 +1343,8 @@ static void wakeupdispatch(struct tipc_port *tport) | |||
| 1341 | { | 1343 | { |
| 1342 | struct sock *sk = (struct sock *)tport->usr_handle; | 1344 | struct sock *sk = (struct sock *)tport->usr_handle; |
| 1343 | 1345 | ||
| 1344 | if (waitqueue_active(sk->sk_sleep)) | 1346 | if (waitqueue_active(sk_sleep(sk))) |
| 1345 | wake_up_interruptible(sk->sk_sleep); | 1347 | wake_up_interruptible(sk_sleep(sk)); |
| 1346 | } | 1348 | } |
| 1347 | 1349 | ||
| 1348 | /** | 1350 | /** |
| @@ -1424,7 +1426,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, | |||
| 1424 | /* Wait until an 'ACK' or 'RST' arrives, or a timeout occurs */ | 1426 | /* Wait until an 'ACK' or 'RST' arrives, or a timeout occurs */ |
| 1425 | 1427 | ||
| 1426 | release_sock(sk); | 1428 | release_sock(sk); |
| 1427 | res = wait_event_interruptible_timeout(*sk->sk_sleep, | 1429 | res = wait_event_interruptible_timeout(*sk_sleep(sk), |
| 1428 | (!skb_queue_empty(&sk->sk_receive_queue) || | 1430 | (!skb_queue_empty(&sk->sk_receive_queue) || |
| 1429 | (sock->state != SS_CONNECTING)), | 1431 | (sock->state != SS_CONNECTING)), |
| 1430 | sk->sk_rcvtimeo); | 1432 | sk->sk_rcvtimeo); |
| @@ -1519,7 +1521,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) | |||
| 1519 | goto exit; | 1521 | goto exit; |
| 1520 | } | 1522 | } |
| 1521 | release_sock(sk); | 1523 | release_sock(sk); |
| 1522 | res = wait_event_interruptible(*sk->sk_sleep, | 1524 | res = wait_event_interruptible(*sk_sleep(sk), |
| 1523 | (!skb_queue_empty(&sk->sk_receive_queue))); | 1525 | (!skb_queue_empty(&sk->sk_receive_queue))); |
| 1524 | lock_sock(sk); | 1526 | lock_sock(sk); |
| 1525 | if (res) | 1527 | if (res) |
| @@ -1630,8 +1632,8 @@ restart: | |||
| 1630 | /* Discard any unreceived messages; wake up sleeping tasks */ | 1632 | /* Discard any unreceived messages; wake up sleeping tasks */ |
| 1631 | 1633 | ||
| 1632 | discard_rx_queue(sk); | 1634 | discard_rx_queue(sk); |
| 1633 | if (waitqueue_active(sk->sk_sleep)) | 1635 | if (waitqueue_active(sk_sleep(sk))) |
| 1634 | wake_up_interruptible(sk->sk_sleep); | 1636 | wake_up_interruptible(sk_sleep(sk)); |
| 1635 | res = 0; | 1637 | res = 0; |
| 1636 | break; | 1638 | break; |
| 1637 | 1639 | ||
