aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2017-12-19 22:12:52 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-20 14:00:25 -0500
commit986ffdfd08dbaae721e82720e6bfc2c307e732dd (patch)
tree0aa6bd09827ff4654e2b3f563cb0059945fd6194 /net
parent563e0bb0dc74b3ca888e24f8c08f0239fe4016b0 (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 'net')
-rw-r--r--net/ipv4/inet_connection_sock.c2
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_diag.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index f460fc04aa66..12410ec6f7f7 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -685,7 +685,7 @@ static void reqsk_timer_handler(struct timer_list *t)
685 int max_retries, thresh; 685 int max_retries, thresh;
686 u8 defer_accept; 686 u8 defer_accept;
687 687
688 if (sk_state_load(sk_listener) != TCP_LISTEN) 688 if (inet_sk_state_load(sk_listener) != TCP_LISTEN)
689 goto drop; 689 goto drop;
690 690
691 max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries; 691 max_retries = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_synack_retries;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index d408fb41c804..67d39b79c801 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -502,7 +502,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
502 502
503 sock_poll_wait(file, sk_sleep(sk), wait); 503 sock_poll_wait(file, sk_sleep(sk), wait);
504 504
505 state = sk_state_load(sk); 505 state = inet_sk_state_load(sk);
506 if (state == TCP_LISTEN) 506 if (state == TCP_LISTEN)
507 return inet_csk_listen_poll(sk); 507 return inet_csk_listen_poll(sk);
508 508
@@ -2916,7 +2916,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
2916 if (sk->sk_type != SOCK_STREAM) 2916 if (sk->sk_type != SOCK_STREAM)
2917 return; 2917 return;
2918 2918
2919 info->tcpi_state = sk_state_load(sk); 2919 info->tcpi_state = inet_sk_state_load(sk);
2920 2920
2921 /* Report meaningful fields for all TCP states, including listeners */ 2921 /* Report meaningful fields for all TCP states, including listeners */
2922 rate = READ_ONCE(sk->sk_pacing_rate); 2922 rate = READ_ONCE(sk->sk_pacing_rate);
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index abbf0edcf6c2..81148f7a2323 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -24,7 +24,7 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
24{ 24{
25 struct tcp_info *info = _info; 25 struct tcp_info *info = _info;
26 26
27 if (sk_state_load(sk) == TCP_LISTEN) { 27 if (inet_sk_state_load(sk) == TCP_LISTEN) {
28 r->idiag_rqueue = sk->sk_ack_backlog; 28 r->idiag_rqueue = sk->sk_ack_backlog;
29 r->idiag_wqueue = sk->sk_max_ack_backlog; 29 r->idiag_wqueue = sk->sk_max_ack_backlog;
30 } else if (sk->sk_type == SOCK_STREAM) { 30 } else if (sk->sk_type == SOCK_STREAM) {
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 94e28350f420..dd945b114215 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2281,7 +2281,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i)
2281 timer_expires = jiffies; 2281 timer_expires = jiffies;
2282 } 2282 }
2283 2283
2284 state = sk_state_load(sk); 2284 state = inet_sk_state_load(sk);
2285 if (state == TCP_LISTEN) 2285 if (state == TCP_LISTEN)
2286 rx_queue = sk->sk_ack_backlog; 2286 rx_queue = sk->sk_ack_backlog;
2287 else 2287 else
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7178476b3d2f..aa12a26a96c6 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1795,7 +1795,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
1795 timer_expires = jiffies; 1795 timer_expires = jiffies;
1796 } 1796 }
1797 1797
1798 state = sk_state_load(sp); 1798 state = inet_sk_state_load(sp);
1799 if (state == TCP_LISTEN) 1799 if (state == TCP_LISTEN)
1800 rx_queue = sp->sk_ack_backlog; 1800 rx_queue = sp->sk_ack_backlog;
1801 else 1801 else