diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index d884d268c704..01810a3f19df 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -281,7 +281,7 @@ struct sock { | |||
281 | int sk_rcvbuf; | 281 | int sk_rcvbuf; |
282 | 282 | ||
283 | struct sk_filter __rcu *sk_filter; | 283 | struct sk_filter __rcu *sk_filter; |
284 | struct socket_wq *sk_wq; | 284 | struct socket_wq __rcu *sk_wq; |
285 | 285 | ||
286 | #ifdef CONFIG_NET_DMA | 286 | #ifdef CONFIG_NET_DMA |
287 | struct sk_buff_head sk_async_wait_queue; | 287 | struct sk_buff_head sk_async_wait_queue; |
@@ -753,6 +753,8 @@ struct proto { | |||
753 | int level, | 753 | int level, |
754 | int optname, char __user *optval, | 754 | int optname, char __user *optval, |
755 | int __user *option); | 755 | int __user *option); |
756 | int (*compat_ioctl)(struct sock *sk, | ||
757 | unsigned int cmd, unsigned long arg); | ||
756 | #endif | 758 | #endif |
757 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 759 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
758 | struct msghdr *msg, size_t len); | 760 | struct msghdr *msg, size_t len); |
@@ -1189,7 +1191,7 @@ extern void sk_filter_release_rcu(struct rcu_head *rcu); | |||
1189 | static inline void sk_filter_release(struct sk_filter *fp) | 1191 | static inline void sk_filter_release(struct sk_filter *fp) |
1190 | { | 1192 | { |
1191 | if (atomic_dec_and_test(&fp->refcnt)) | 1193 | if (atomic_dec_and_test(&fp->refcnt)) |
1192 | call_rcu_bh(&fp->rcu, sk_filter_release_rcu); | 1194 | call_rcu(&fp->rcu, sk_filter_release_rcu); |
1193 | } | 1195 | } |
1194 | 1196 | ||
1195 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1197 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
@@ -1264,7 +1266,8 @@ static inline void sk_set_socket(struct sock *sk, struct socket *sock) | |||
1264 | 1266 | ||
1265 | static inline wait_queue_head_t *sk_sleep(struct sock *sk) | 1267 | static inline wait_queue_head_t *sk_sleep(struct sock *sk) |
1266 | { | 1268 | { |
1267 | return &sk->sk_wq->wait; | 1269 | BUILD_BUG_ON(offsetof(struct socket_wq, wait) != 0); |
1270 | return &rcu_dereference_raw(sk->sk_wq)->wait; | ||
1268 | } | 1271 | } |
1269 | /* Detach socket from process context. | 1272 | /* Detach socket from process context. |
1270 | * Announce socket dead, detach it from wait queue and inode. | 1273 | * Announce socket dead, detach it from wait queue and inode. |
@@ -1285,7 +1288,7 @@ static inline void sock_orphan(struct sock *sk) | |||
1285 | static inline void sock_graft(struct sock *sk, struct socket *parent) | 1288 | static inline void sock_graft(struct sock *sk, struct socket *parent) |
1286 | { | 1289 | { |
1287 | write_lock_bh(&sk->sk_callback_lock); | 1290 | write_lock_bh(&sk->sk_callback_lock); |
1288 | rcu_assign_pointer(sk->sk_wq, parent->wq); | 1291 | sk->sk_wq = parent->wq; |
1289 | parent->sk = sk; | 1292 | parent->sk = sk; |
1290 | sk_set_socket(sk, parent); | 1293 | sk_set_socket(sk, parent); |
1291 | security_sock_graft(sk, parent); | 1294 | security_sock_graft(sk, parent); |
@@ -1746,7 +1749,7 @@ void sock_net_set(struct sock *sk, struct net *net) | |||
1746 | 1749 | ||
1747 | /* | 1750 | /* |
1748 | * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace. | 1751 | * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace. |
1749 | * They should not hold a referrence to a namespace in order to allow | 1752 | * They should not hold a reference to a namespace in order to allow |
1750 | * to stop it. | 1753 | * to stop it. |
1751 | * Sockets after sk_change_net should be released using sk_release_kernel | 1754 | * Sockets after sk_change_net should be released using sk_release_kernel |
1752 | */ | 1755 | */ |