diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-01-12 05:01:12 -0500 |
commit | 1f16f116b01c110db20ab808562c8b8bc3ee3d6e (patch) | |
tree | 44db563f64cf5f8d62af8f99a61e2b248c44ea3a /include/net/sock.h | |
parent | 03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2 (diff) | |
parent | f9eccf24615672896dc13251410c3f2f33a14f95 (diff) |
Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull in fixes from Daniel Lezcano:
- Fix the vt8500 timer leading to a system lock up when dealing with too
small delta (Roman Volkov)
- Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST
(Daniel Lezcano)
- Prevent to compile timers using the 'iomem' API when the architecture has
not HAS_IOMEM set (Richard Weinberger)
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 7f89e4ba18d1..14d3c0734007 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -254,7 +254,6 @@ struct cg_proto; | |||
254 | * @sk_wq: sock wait queue and async head | 254 | * @sk_wq: sock wait queue and async head |
255 | * @sk_rx_dst: receive input route used by early demux | 255 | * @sk_rx_dst: receive input route used by early demux |
256 | * @sk_dst_cache: destination cache | 256 | * @sk_dst_cache: destination cache |
257 | * @sk_dst_lock: destination cache lock | ||
258 | * @sk_policy: flow policy | 257 | * @sk_policy: flow policy |
259 | * @sk_receive_queue: incoming packets | 258 | * @sk_receive_queue: incoming packets |
260 | * @sk_wmem_alloc: transmit queue bytes committed | 259 | * @sk_wmem_alloc: transmit queue bytes committed |
@@ -384,14 +383,16 @@ struct sock { | |||
384 | int sk_rcvbuf; | 383 | int sk_rcvbuf; |
385 | 384 | ||
386 | struct sk_filter __rcu *sk_filter; | 385 | struct sk_filter __rcu *sk_filter; |
387 | struct socket_wq __rcu *sk_wq; | 386 | union { |
388 | 387 | struct socket_wq __rcu *sk_wq; | |
388 | struct socket_wq *sk_wq_raw; | ||
389 | }; | ||
389 | #ifdef CONFIG_XFRM | 390 | #ifdef CONFIG_XFRM |
390 | struct xfrm_policy *sk_policy[2]; | 391 | struct xfrm_policy __rcu *sk_policy[2]; |
391 | #endif | 392 | #endif |
392 | struct dst_entry *sk_rx_dst; | 393 | struct dst_entry *sk_rx_dst; |
393 | struct dst_entry __rcu *sk_dst_cache; | 394 | struct dst_entry __rcu *sk_dst_cache; |
394 | spinlock_t sk_dst_lock; | 395 | /* Note: 32bit hole on 64bit arches */ |
395 | atomic_t sk_wmem_alloc; | 396 | atomic_t sk_wmem_alloc; |
396 | atomic_t sk_omem_alloc; | 397 | atomic_t sk_omem_alloc; |
397 | int sk_sndbuf; | 398 | int sk_sndbuf; |
@@ -403,6 +404,7 @@ struct sock { | |||
403 | sk_userlocks : 4, | 404 | sk_userlocks : 4, |
404 | sk_protocol : 8, | 405 | sk_protocol : 8, |
405 | sk_type : 16; | 406 | sk_type : 16; |
407 | #define SK_PROTOCOL_MAX U8_MAX | ||
406 | kmemcheck_bitfield_end(flags); | 408 | kmemcheck_bitfield_end(flags); |
407 | int sk_wmem_queued; | 409 | int sk_wmem_queued; |
408 | gfp_t sk_allocation; | 410 | gfp_t sk_allocation; |
@@ -739,6 +741,8 @@ enum sock_flags { | |||
739 | SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ | 741 | SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ |
740 | }; | 742 | }; |
741 | 743 | ||
744 | #define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) | ||
745 | |||
742 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 746 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
743 | { | 747 | { |
744 | nsk->sk_flags = osk->sk_flags; | 748 | nsk->sk_flags = osk->sk_flags; |
@@ -813,7 +817,7 @@ void sk_stream_write_space(struct sock *sk); | |||
813 | static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) | 817 | static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) |
814 | { | 818 | { |
815 | /* dont let skb dst not refcounted, we are going to leave rcu lock */ | 819 | /* dont let skb dst not refcounted, we are going to leave rcu lock */ |
816 | skb_dst_force(skb); | 820 | skb_dst_force_safe(skb); |
817 | 821 | ||
818 | if (!sk->sk_backlog.tail) | 822 | if (!sk->sk_backlog.tail) |
819 | sk->sk_backlog.head = skb; | 823 | sk->sk_backlog.head = skb; |
@@ -2005,10 +2009,27 @@ static inline unsigned long sock_wspace(struct sock *sk) | |||
2005 | return amt; | 2009 | return amt; |
2006 | } | 2010 | } |
2007 | 2011 | ||
2008 | static inline void sk_wake_async(struct sock *sk, int how, int band) | 2012 | /* Note: |
2013 | * We use sk->sk_wq_raw, from contexts knowing this | ||
2014 | * pointer is not NULL and cannot disappear/change. | ||
2015 | */ | ||
2016 | static inline void sk_set_bit(int nr, struct sock *sk) | ||
2017 | { | ||
2018 | set_bit(nr, &sk->sk_wq_raw->flags); | ||
2019 | } | ||
2020 | |||
2021 | static inline void sk_clear_bit(int nr, struct sock *sk) | ||
2022 | { | ||
2023 | clear_bit(nr, &sk->sk_wq_raw->flags); | ||
2024 | } | ||
2025 | |||
2026 | static inline void sk_wake_async(const struct sock *sk, int how, int band) | ||
2009 | { | 2027 | { |
2010 | if (sock_flag(sk, SOCK_FASYNC)) | 2028 | if (sock_flag(sk, SOCK_FASYNC)) { |
2011 | sock_wake_async(sk->sk_socket, how, band); | 2029 | rcu_read_lock(); |
2030 | sock_wake_async(rcu_dereference(sk->sk_wq), how, band); | ||
2031 | rcu_read_unlock(); | ||
2032 | } | ||
2012 | } | 2033 | } |
2013 | 2034 | ||
2014 | /* Since sk_{r,w}mem_alloc sums skb->truesize, even a small frame might | 2035 | /* Since sk_{r,w}mem_alloc sums skb->truesize, even a small frame might |