diff options
author | Ingo Molnar <mingo@kernel.org> | 2021-11-28 09:37:05 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2022-03-15 12:57:34 +0100 |
commit | 275c81da390e3cf15f5ff7bd09e88d3e7ccfdc0d (patch) | |
tree | 689e98e89436a0f843160ad5b3c91bc3e5f6706e | |
parent | 289578527470b8575a5dcbc3782d8d88c9c2b574 (diff) | |
download | tip-275c81da390e3cf15f5ff7bd09e88d3e7ccfdc0d.tar.gz |
headers/deps: net: Move the sk_dst_set/reset() APIs from <net/sock_api.h> to <net/sock_api_extra.h>
These APIs are only used in ~24 files.
Doing this decouples <net/sock_api.h> from <net/dst_api.h> entirely,
allowing a followup commit to remove the header dependency.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/net/sock_api.h | 36 | ||||
-rw-r--r-- | include/net/sock_api_extra.h | 36 |
2 files changed, 36 insertions, 36 deletions
diff --git a/include/net/sock_api.h b/include/net/sock_api.h index d78bd655ddff49..c5dc5cbc0d33e7 100644 --- a/include/net/sock_api.h +++ b/include/net/sock_api.h @@ -1289,42 +1289,6 @@ static inline void dst_negative_advice(struct sock *sk) __dst_negative_advice(sk); } -static inline void -__sk_dst_set(struct sock *sk, struct dst_entry *dst) -{ - struct dst_entry *old_dst; - - sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; - old_dst = rcu_dereference_protected(sk->sk_dst_cache, - lockdep_sock_is_held(sk)); - rcu_assign_pointer(sk->sk_dst_cache, dst); - dst_release(old_dst); -} - -static inline void -sk_dst_set(struct sock *sk, struct dst_entry *dst) -{ - struct dst_entry *old_dst; - - sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; - old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst); - dst_release(old_dst); -} - -static inline void -__sk_dst_reset(struct sock *sk) -{ - __sk_dst_set(sk, NULL); -} - -static inline void -sk_dst_reset(struct sock *sk) -{ - sk_dst_set(sk, NULL); -} - struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); diff --git a/include/net/sock_api_extra.h b/include/net/sock_api_extra.h index 349210c624f671..93c4b4a729b339 100644 --- a/include/net/sock_api_extra.h +++ b/include/net/sock_api_extra.h @@ -67,4 +67,40 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) sk, skb); } +static inline void +__sk_dst_set(struct sock *sk, struct dst_entry *dst) +{ + struct dst_entry *old_dst; + + sk_tx_queue_clear(sk); + sk->sk_dst_pending_confirm = 0; + old_dst = rcu_dereference_protected(sk->sk_dst_cache, + lockdep_sock_is_held(sk)); + rcu_assign_pointer(sk->sk_dst_cache, dst); + dst_release(old_dst); +} + +static inline void +sk_dst_set(struct sock *sk, struct dst_entry *dst) +{ + struct dst_entry *old_dst; + + sk_tx_queue_clear(sk); + sk->sk_dst_pending_confirm = 0; + old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst); + dst_release(old_dst); +} + +static inline void +__sk_dst_reset(struct sock *sk) +{ + __sk_dst_set(sk, NULL); +} + +static inline void +sk_dst_reset(struct sock *sk) +{ + sk_dst_set(sk, NULL); +} + #endif /* _SOCK_API_EXTRA_H */ |