#define UNIX_GC_CANDIDATE 0
#define UNIX_GC_MAYBE_CYCLE 1
struct socket_wq peer_wq;
+ wait_queue_t peer_wake;
};
- #define unix_sk(__sk) ((struct unix_sock *)__sk)
+
+ static inline struct unix_sock *unix_sk(struct sock *sk)
+ {
+ return (struct unix_sock *)sk;
+ }
#define peer_wait peer_wq.wait
unsigned int limit)
{
if (sk_rcvqueues_full(sk, skb, limit))
+ {
+ #ifdef CONFIG_MTK_NET_LOGGING
+ printk(KERN_ERR "[mtk_net][sock]sk_add_backlog->sk_rcvqueues_full sk->sk_rcvbuf:%d,sk->sk_sndbuf:%d ",sk->sk_rcvbuf,sk->sk_sndbuf);
+ #endif
return -ENOBUFS;
+ }
+
+ /*
+ * If the skb was allocated from pfmemalloc reserves, only
+ * allow SOCK_MEMALLOC sockets to use it as this socket is
+ * helping free memory
+ */
+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
+ return -ENOMEM;
+
__sk_add_backlog(sk, skb);
sk->sk_backlog.len += skb->truesize;
return 0;