diff options
Diffstat (limited to 'include/linux/net.h')
| -rw-r--r-- | include/linux/net.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 5e8083cacc8b..dee0b11a8759 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -59,6 +59,7 @@ typedef enum { | |||
| 59 | #include <linux/wait.h> | 59 | #include <linux/wait.h> |
| 60 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | 60 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ |
| 61 | #include <linux/kmemcheck.h> | 61 | #include <linux/kmemcheck.h> |
| 62 | #include <linux/rcupdate.h> | ||
| 62 | 63 | ||
| 63 | struct poll_table_struct; | 64 | struct poll_table_struct; |
| 64 | struct pipe_inode_info; | 65 | struct pipe_inode_info; |
| @@ -116,16 +117,21 @@ enum sock_shutdown_cmd { | |||
| 116 | SHUT_RDWR = 2, | 117 | SHUT_RDWR = 2, |
| 117 | }; | 118 | }; |
| 118 | 119 | ||
| 120 | struct socket_wq { | ||
| 121 | wait_queue_head_t wait; | ||
| 122 | struct fasync_struct *fasync_list; | ||
| 123 | struct rcu_head rcu; | ||
| 124 | } ____cacheline_aligned_in_smp; | ||
| 125 | |||
| 119 | /** | 126 | /** |
| 120 | * struct socket - general BSD socket | 127 | * struct socket - general BSD socket |
| 121 | * @state: socket state (%SS_CONNECTED, etc) | 128 | * @state: socket state (%SS_CONNECTED, etc) |
| 122 | * @type: socket type (%SOCK_STREAM, etc) | 129 | * @type: socket type (%SOCK_STREAM, etc) |
| 123 | * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) | 130 | * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) |
| 124 | * @ops: protocol specific socket operations | 131 | * @ops: protocol specific socket operations |
| 125 | * @fasync_list: Asynchronous wake up list | ||
| 126 | * @file: File back pointer for gc | 132 | * @file: File back pointer for gc |
| 127 | * @sk: internal networking protocol agnostic socket representation | 133 | * @sk: internal networking protocol agnostic socket representation |
| 128 | * @wait: wait queue for several uses | 134 | * @wq: wait queue for several uses |
| 129 | */ | 135 | */ |
| 130 | struct socket { | 136 | struct socket { |
| 131 | socket_state state; | 137 | socket_state state; |
| @@ -135,11 +141,8 @@ struct socket { | |||
| 135 | kmemcheck_bitfield_end(type); | 141 | kmemcheck_bitfield_end(type); |
| 136 | 142 | ||
| 137 | unsigned long flags; | 143 | unsigned long flags; |
| 138 | /* | 144 | |
| 139 | * Please keep fasync_list & wait fields in the same cache line | 145 | struct socket_wq *wq; |
| 140 | */ | ||
| 141 | struct fasync_struct *fasync_list; | ||
| 142 | wait_queue_head_t wait; | ||
| 143 | 146 | ||
| 144 | struct file *file; | 147 | struct file *file; |
| 145 | struct sock *sk; | 148 | struct sock *sk; |
| @@ -174,18 +177,22 @@ struct proto_ops { | |||
| 174 | struct poll_table_struct *wait); | 177 | struct poll_table_struct *wait); |
| 175 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 178 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
| 176 | unsigned long arg); | 179 | unsigned long arg); |
| 180 | #ifdef CONFIG_COMPAT | ||
| 177 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | 181 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, |
| 178 | unsigned long arg); | 182 | unsigned long arg); |
| 183 | #endif | ||
| 179 | int (*listen) (struct socket *sock, int len); | 184 | int (*listen) (struct socket *sock, int len); |
| 180 | int (*shutdown) (struct socket *sock, int flags); | 185 | int (*shutdown) (struct socket *sock, int flags); |
| 181 | int (*setsockopt)(struct socket *sock, int level, | 186 | int (*setsockopt)(struct socket *sock, int level, |
| 182 | int optname, char __user *optval, unsigned int optlen); | 187 | int optname, char __user *optval, unsigned int optlen); |
| 183 | int (*getsockopt)(struct socket *sock, int level, | 188 | int (*getsockopt)(struct socket *sock, int level, |
| 184 | int optname, char __user *optval, int __user *optlen); | 189 | int optname, char __user *optval, int __user *optlen); |
| 190 | #ifdef CONFIG_COMPAT | ||
| 185 | int (*compat_setsockopt)(struct socket *sock, int level, | 191 | int (*compat_setsockopt)(struct socket *sock, int level, |
| 186 | int optname, char __user *optval, unsigned int optlen); | 192 | int optname, char __user *optval, unsigned int optlen); |
| 187 | int (*compat_getsockopt)(struct socket *sock, int level, | 193 | int (*compat_getsockopt)(struct socket *sock, int level, |
| 188 | int optname, char __user *optval, int __user *optlen); | 194 | int optname, char __user *optval, int __user *optlen); |
| 195 | #endif | ||
| 189 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 196 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
| 190 | struct msghdr *m, size_t total_len); | 197 | struct msghdr *m, size_t total_len); |
| 191 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 198 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
