]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/tcp.h
Merge tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux
[karo-tx-linux.git] / include / net / tcp.h
index f33fecf4e282974e78fa7e64e75a4e5b70f74a9e..8ea19977ea530bffb57bebed734b977c95b603c5 100644 (file)
@@ -240,9 +240,6 @@ extern int sysctl_tcp_timestamps;
 extern int sysctl_tcp_window_scaling;
 extern int sysctl_tcp_sack;
 extern int sysctl_tcp_fin_timeout;
-extern int sysctl_tcp_keepalive_time;
-extern int sysctl_tcp_keepalive_probes;
-extern int sysctl_tcp_keepalive_intvl;
 extern int sysctl_tcp_syn_retries;
 extern int sysctl_tcp_synack_retries;
 extern int sysctl_tcp_retries1;
@@ -292,8 +289,9 @@ extern int tcp_memory_pressure;
 /* optimized version of sk_under_memory_pressure() for TCP sockets */
 static inline bool tcp_under_memory_pressure(const struct sock *sk)
 {
-       if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
-               return !!sk->sk_cgrp->memory_pressure;
+       if (mem_cgroup_sockets_enabled && sk->sk_memcg &&
+           mem_cgroup_under_socket_pressure(sk->sk_memcg))
+               return true;
 
        return tcp_memory_pressure;
 }
@@ -1225,17 +1223,23 @@ void tcp_enter_memory_pressure(struct sock *sk);
 
 static inline int keepalive_intvl_when(const struct tcp_sock *tp)
 {
-       return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl;
+       struct net *net = sock_net((struct sock *)tp);
+
+       return tp->keepalive_intvl ? : net->ipv4.sysctl_tcp_keepalive_intvl;
 }
 
 static inline int keepalive_time_when(const struct tcp_sock *tp)
 {
-       return tp->keepalive_time ? : sysctl_tcp_keepalive_time;
+       struct net *net = sock_net((struct sock *)tp);
+
+       return tp->keepalive_time ? : net->ipv4.sysctl_tcp_keepalive_time;
 }
 
 static inline int keepalive_probes(const struct tcp_sock *tp)
 {
-       return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes;
+       struct net *net = sock_net((struct sock *)tp);
+
+       return tp->keepalive_probes ? : net->ipv4.sysctl_tcp_keepalive_probes;
 }
 
 static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp)