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>
This commit is contained in:
Yafang Shao
2017-12-20 11:12:52 +08:00
committed by David S. Miller
parent 563e0bb0dc
commit 986ffdfd08
7 changed files with 30 additions and 32 deletions

View File

@@ -2333,31 +2333,6 @@ static inline bool sk_listener(const struct sock *sk)
return (1 << sk->sk_state) & (TCPF_LISTEN | TCPF_NEW_SYN_RECV);
}
/**
* sk_state_load - read sk->sk_state for lockless contexts
* @sk: socket pointer
*
* Paired with sk_state_store(). Used in places we do not hold socket lock :
* tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ...
*/
static inline int sk_state_load(const struct sock *sk)
{
return smp_load_acquire(&sk->sk_state);
}
/**
* sk_state_store - update sk->sk_state
* @sk: socket pointer
* @newstate: new state
*
* Paired with sk_state_load(). Should be used in contexts where
* state change might impact lockless readers.
*/
static inline void sk_state_store(struct sock *sk, int newstate)
{
smp_store_release(&sk->sk_state, newstate);
}
void sock_enable_timestamp(struct sock *sk, int flag);
int sock_get_timestamp(struct sock *, struct timeval __user *);
int sock_get_timestampns(struct sock *, struct timespec __user *);