skmsg.c (e700ac213a0f793fb4f83098413303e3dd080892) skmsg.c (fb4e0a5e73d4bb5ab69b7905abd2ec3b580e9b59)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2017 - 2018 Covalent IO, Inc. http://covalent.io */
3
4#include <linux/skmsg.h>
5#include <linux/skbuff.h>
6#include <linux/scatterlist.h>
7
8#include <net/sock.h>

--- 460 unchanged lines hidden (view full) ---

469 }
470 msg_rx = sk_psock_peek_msg(psock);
471 }
472
473 return copied;
474}
475EXPORT_SYMBOL_GPL(sk_msg_recvmsg);
476
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2017 - 2018 Covalent IO, Inc. http://covalent.io */
3
4#include <linux/skmsg.h>
5#include <linux/skbuff.h>
6#include <linux/scatterlist.h>
7
8#include <net/sock.h>

--- 460 unchanged lines hidden (view full) ---

469 }
470 msg_rx = sk_psock_peek_msg(psock);
471 }
472
473 return copied;
474}
475EXPORT_SYMBOL_GPL(sk_msg_recvmsg);
476
477bool sk_msg_is_readable(struct sock *sk)
478{
479 struct sk_psock *psock;
480 bool empty = true;
481
482 rcu_read_lock();
483 psock = sk_psock(sk);
484 if (likely(psock))
485 empty = list_empty(&psock->ingress_msg);
486 rcu_read_unlock();
487 return !empty;
488}
489EXPORT_SYMBOL_GPL(sk_msg_is_readable);
490
477static struct sk_msg *sk_psock_create_ingress_msg(struct sock *sk,
478 struct sk_buff *skb)
479{
480 struct sk_msg *msg;
481
482 if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
483 return NULL;
484

--- 699 unchanged lines hidden ---
491static struct sk_msg *sk_psock_create_ingress_msg(struct sock *sk,
492 struct sk_buff *skb)
493{
494 struct sk_msg *msg;
495
496 if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
497 return NULL;
498

--- 699 unchanged lines hidden ---