aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h25
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 */
2343static 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 */
2356static inline void sk_state_store(struct sock *sk, int newstate)
2357{
2358 smp_store_release(&sk->sk_state, newstate);
2359}
2360
2361void sock_enable_timestamp(struct sock *sk, int flag); 2336void sock_enable_timestamp(struct sock *sk, int flag);
2362int sock_get_timestamp(struct sock *, struct timeval __user *); 2337int sock_get_timestamp(struct sock *, struct timeval __user *);
2363int sock_get_timestampns(struct sock *, struct timespec __user *); 2338int sock_get_timestampns(struct sock *, struct timespec __user *);