diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2017-12-19 22:12:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-20 14:00:25 -0500 |
commit | 986ffdfd08dbaae721e82720e6bfc2c307e732dd (patch) | |
tree | 0aa6bd09827ff4654e2b3f563cb0059945fd6194 /include/net/sock.h | |
parent | 563e0bb0dc74b3ca888e24f8c08f0239fe4016b0 (diff) |
net: sock: replace sk_state_load with inet_sk_state_load and remove sk_state_store
sk_state_load is only used by AF_INET/AF_INET6, so rename it to
inet_sk_state_load and move it into inet_sock.h.
sk_state_store is removed as it is not used any more.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 0a32f3ce381c..6c1db823f8b9 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -2333,31 +2333,6 @@ static inline bool sk_listener(const struct sock *sk) | |||
2333 | return (1 << sk->sk_state) & (TCPF_LISTEN | TCPF_NEW_SYN_RECV); | 2333 | return (1 << sk->sk_state) & (TCPF_LISTEN | TCPF_NEW_SYN_RECV); |
2334 | } | 2334 | } |
2335 | 2335 | ||
2336 | /** | ||
2337 | * sk_state_load - read sk->sk_state for lockless contexts | ||
2338 | * @sk: socket pointer | ||
2339 | * | ||
2340 | * Paired with sk_state_store(). Used in places we do not hold socket lock : | ||
2341 | * tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ... | ||
2342 | */ | ||
2343 | static inline int sk_state_load(const struct sock *sk) | ||
2344 | { | ||
2345 | return smp_load_acquire(&sk->sk_state); | ||
2346 | } | ||
2347 | |||
2348 | /** | ||
2349 | * sk_state_store - update sk->sk_state | ||
2350 | * @sk: socket pointer | ||
2351 | * @newstate: new state | ||
2352 | * | ||
2353 | * Paired with sk_state_load(). Should be used in contexts where | ||
2354 | * state change might impact lockless readers. | ||
2355 | */ | ||
2356 | static inline void sk_state_store(struct sock *sk, int newstate) | ||
2357 | { | ||
2358 | smp_store_release(&sk->sk_state, newstate); | ||
2359 | } | ||
2360 | |||
2361 | void sock_enable_timestamp(struct sock *sk, int flag); | 2336 | void sock_enable_timestamp(struct sock *sk, int flag); |
2362 | int sock_get_timestamp(struct sock *, struct timeval __user *); | 2337 | int sock_get_timestamp(struct sock *, struct timeval __user *); |
2363 | int sock_get_timestampns(struct sock *, struct timespec __user *); | 2338 | int sock_get_timestampns(struct sock *, struct timespec __user *); |