]> Git Repo - linux.git/blobdiff - net/unix/af_unix.c
efi/x86: add headroom to decompressor BSS to account for setup block
[linux.git] / net / unix / af_unix.c
index 321af97c7bbe586dd4c71269cd070ff6cffa5937..62c12cb5763e6d0ec4ef7daefd6836b6588b7185 100644 (file)
@@ -189,11 +189,17 @@ static inline int unix_may_send(struct sock *sk, struct sock *osk)
        return unix_peer(osk) == NULL || unix_our_peer(sk, osk);
 }
 
-static inline int unix_recvq_full(struct sock const *sk)
+static inline int unix_recvq_full(const struct sock *sk)
 {
        return skb_queue_len(&sk->sk_receive_queue) > sk->sk_max_ack_backlog;
 }
 
+static inline int unix_recvq_full_lockless(const struct sock *sk)
+{
+       return skb_queue_len_lockless(&sk->sk_receive_queue) >
+               READ_ONCE(sk->sk_max_ack_backlog);
+}
+
 struct sock *unix_peer_get(struct sock *s)
 {
        struct sock *peer;
@@ -1758,7 +1764,8 @@ restart_locked:
         * - unix_peer(sk) == sk by time of get but disconnected before lock
         */
        if (other != sk &&
-           unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
+           unlikely(unix_peer(other) != sk &&
+           unix_recvq_full_lockless(other))) {
                if (timeo) {
                        timeo = unix_wait_for_peer(other, timeo);
 
This page took 0.032411 seconds and 4 git commands to generate.