diff options
Diffstat (limited to 'net/socket.c')
| -rw-r--r-- | net/socket.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c index 4ca1526db756..45afa648364a 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -104,6 +104,12 @@ | |||
| 104 | #include <linux/route.h> | 104 | #include <linux/route.h> |
| 105 | #include <linux/sockios.h> | 105 | #include <linux/sockios.h> |
| 106 | #include <linux/atalk.h> | 106 | #include <linux/atalk.h> |
| 107 | #include <net/ll_poll.h> | ||
| 108 | |||
| 109 | #ifdef CONFIG_NET_LL_RX_POLL | ||
| 110 | unsigned int sysctl_net_ll_read __read_mostly; | ||
| 111 | unsigned int sysctl_net_ll_poll __read_mostly; | ||
| 112 | #endif | ||
| 107 | 113 | ||
| 108 | static int sock_no_open(struct inode *irrelevant, struct file *dontcare); | 114 | static int sock_no_open(struct inode *irrelevant, struct file *dontcare); |
| 109 | static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov, | 115 | static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov, |
| @@ -1142,13 +1148,24 @@ EXPORT_SYMBOL(sock_create_lite); | |||
| 1142 | /* No kernel lock held - perfect */ | 1148 | /* No kernel lock held - perfect */ |
| 1143 | static unsigned int sock_poll(struct file *file, poll_table *wait) | 1149 | static unsigned int sock_poll(struct file *file, poll_table *wait) |
| 1144 | { | 1150 | { |
| 1151 | unsigned int busy_flag = 0; | ||
| 1145 | struct socket *sock; | 1152 | struct socket *sock; |
| 1146 | 1153 | ||
| 1147 | /* | 1154 | /* |
| 1148 | * We can't return errors to poll, so it's either yes or no. | 1155 | * We can't return errors to poll, so it's either yes or no. |
| 1149 | */ | 1156 | */ |
| 1150 | sock = file->private_data; | 1157 | sock = file->private_data; |
| 1151 | return sock->ops->poll(file, sock, wait); | 1158 | |
| 1159 | if (sk_can_busy_loop(sock->sk)) { | ||
| 1160 | /* this socket can poll_ll so tell the system call */ | ||
| 1161 | busy_flag = POLL_BUSY_LOOP; | ||
| 1162 | |||
| 1163 | /* once, only if requested by syscall */ | ||
| 1164 | if (wait && (wait->_key & POLL_BUSY_LOOP)) | ||
| 1165 | sk_busy_loop(sock->sk, 1); | ||
| 1166 | } | ||
| 1167 | |||
| 1168 | return busy_flag | sock->ops->poll(file, sock, wait); | ||
| 1152 | } | 1169 | } |
| 1153 | 1170 | ||
| 1154 | static int sock_mmap(struct file *file, struct vm_area_struct *vma) | 1171 | static int sock_mmap(struct file *file, struct vm_area_struct *vma) |
| @@ -2635,7 +2652,9 @@ static int __init sock_init(void) | |||
| 2635 | */ | 2652 | */ |
| 2636 | 2653 | ||
| 2637 | #ifdef CONFIG_NETFILTER | 2654 | #ifdef CONFIG_NETFILTER |
| 2638 | netfilter_init(); | 2655 | err = netfilter_init(); |
| 2656 | if (err) | ||
| 2657 | goto out; | ||
| 2639 | #endif | 2658 | #endif |
| 2640 | 2659 | ||
| 2641 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING | 2660 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING |
