Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[firefly-linux-kernel-4.4.55.git] / include / net / tcp.h
index d49db0113a069d4b085ffb62d413d5983cfb2445..42c29bfbcee34d8d6ada5d18533850d82973f352 100644 (file)
@@ -273,6 +273,14 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
        return seq3 - seq2 >= seq1 - seq2;
 }
 
+static inline bool tcp_out_of_memory(struct sock *sk)
+{
+       if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
+           sk_memory_allocated(sk) > sk_prot_mem_limits(sk, 2))
+               return true;
+       return false;
+}
+
 static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
 {
        struct percpu_counter *ocp = sk->sk_prot->orphan_count;
@@ -283,13 +291,11 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
                if (orphans << shift > sysctl_tcp_max_orphans)
                        return true;
        }
-
-       if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
-           sk_memory_allocated(sk) > sk_prot_mem_limits(sk, 2))
-               return true;
        return false;
 }
 
+extern bool tcp_check_oom(struct sock *sk, int shift);
+
 /* syncookies: remember time of last synqueue overflow */
 static inline void tcp_synq_overflow(struct sock *sk)
 {