diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 7f89e4ba18d1..62d35afcb3ac 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <linux/memcontrol.h> | 58 | #include <linux/memcontrol.h> |
59 | #include <linux/static_key.h> | 59 | #include <linux/static_key.h> |
60 | #include <linux/sched.h> | 60 | #include <linux/sched.h> |
61 | #include <linux/wait.h> | ||
61 | 62 | ||
62 | #include <linux/filter.h> | 63 | #include <linux/filter.h> |
63 | #include <linux/rculist_nulls.h> | 64 | #include <linux/rculist_nulls.h> |
@@ -1879,12 +1880,12 @@ static inline bool sk_has_allocations(const struct sock *sk) | |||
1879 | } | 1880 | } |
1880 | 1881 | ||
1881 | /** | 1882 | /** |
1882 | * wq_has_sleeper - check if there are any waiting processes | 1883 | * skwq_has_sleeper - check if there are any waiting processes |
1883 | * @wq: struct socket_wq | 1884 | * @wq: struct socket_wq |
1884 | * | 1885 | * |
1885 | * Returns true if socket_wq has waiting processes | 1886 | * Returns true if socket_wq has waiting processes |
1886 | * | 1887 | * |
1887 | * The purpose of the wq_has_sleeper and sock_poll_wait is to wrap the memory | 1888 | * The purpose of the skwq_has_sleeper and sock_poll_wait is to wrap the memory |
1888 | * barrier call. They were added due to the race found within the tcp code. | 1889 | * barrier call. They were added due to the race found within the tcp code. |
1889 | * | 1890 | * |
1890 | * Consider following tcp code paths: | 1891 | * Consider following tcp code paths: |
@@ -1910,15 +1911,9 @@ static inline bool sk_has_allocations(const struct sock *sk) | |||
1910 | * data on the socket. | 1911 | * data on the socket. |
1911 | * | 1912 | * |
1912 | */ | 1913 | */ |
1913 | static inline bool wq_has_sleeper(struct socket_wq *wq) | 1914 | static inline bool skwq_has_sleeper(struct socket_wq *wq) |
1914 | { | 1915 | { |
1915 | /* We need to be sure we are in sync with the | 1916 | return wq && wq_has_sleeper(&wq->wait); |
1916 | * add_wait_queue modifications to the wait queue. | ||
1917 | * | ||
1918 | * This memory barrier is paired in the sock_poll_wait. | ||
1919 | */ | ||
1920 | smp_mb(); | ||
1921 | return wq && waitqueue_active(&wq->wait); | ||
1922 | } | 1917 | } |
1923 | 1918 | ||
1924 | /** | 1919 | /** |