Commit b6f4f848 authored by Tim Hansen's avatar Tim Hansen Committed by David S. Miller

net/sock: Update sk rcu iterator macro.

Mark hlist node in sk rcu iterator as protected by the rcu.
hlist_next_rcu accomplishes this and silences the warnings
sparse throws.

Found with make C=1 net/ipv4/udp.o on linux-next tag
next-20171009.
Signed-off-by: default avatarTim Hansen <devtimhansen@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49ca1943
...@@ -737,10 +737,10 @@ static inline void sk_add_bind_node(struct sock *sk, ...@@ -737,10 +737,10 @@ static inline void sk_add_bind_node(struct sock *sk,
* *
*/ */
#define sk_for_each_entry_offset_rcu(tpos, pos, head, offset) \ #define sk_for_each_entry_offset_rcu(tpos, pos, head, offset) \
for (pos = rcu_dereference((head)->first); \ for (pos = rcu_dereference(hlist_first_rcu(head)); \
pos != NULL && \ pos != NULL && \
({ tpos = (typeof(*tpos) *)((void *)pos - offset); 1;}); \ ({ tpos = (typeof(*tpos) *)((void *)pos - offset); 1;}); \
pos = rcu_dereference(pos->next)) pos = rcu_dereference(hlist_next_rcu(pos)))
static inline struct user_namespace *sk_user_ns(struct sock *sk) static inline struct user_namespace *sk_user_ns(struct sock *sk)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment