summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-05-22 13:11:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-10 17:10:27 +0100
commit6bcc79a4e76072b89541a62eeb41e22b281a365f (patch)
tree39449b8f77a4162dfed0891596fe1a437a616b06 /io_uring
parent89b51e70e5e335ba5c00abad1bfd9d52acd8afce (diff)
downloadlinux-stable-6bcc79a4e76072b89541a62eeb41e22b281a365f.tar.gz
linux-stable-6bcc79a4e76072b89541a62eeb41e22b281a365f.tar.bz2
linux-stable-6bcc79a4e76072b89541a62eeb41e22b281a365f.zip
net: Declare MSG_SPLICE_PAGES internal sendmsg() flag
[ Upstream commit b841b901c452d92610f739a36e54978453528876 ] Declare MSG_SPLICE_PAGES, an internal sendmsg() flag, that hints to a network protocol that it should splice pages from the source iterator rather than copying the data if it can. This flag is added to a list that is cleared by sendmsg syscalls on entry. This is intended as a replacement for the ->sendpage() op, allowing a way to splice in several multipage folios in one go. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Willem de Bruijn <willemb@google.com> cc: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: a0002127cd74 ("udp: move udp->no_check6_tx to udp->udp_flags") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index 57c626cb4d1a..67f09a40bcb2 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -389,6 +389,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)
if (flags & MSG_WAITALL)
min_ret = iov_iter_count(&msg.msg_iter);
+ flags &= ~MSG_INTERNAL_SENDMSG_FLAGS;
msg.msg_flags = flags;
ret = sock_sendmsg(sock, &msg);
if (ret < min_ret) {
@@ -1137,6 +1138,7 @@ int io_send_zc(struct io_kiocb *req, unsigned int issue_flags)
msg_flags |= MSG_DONTWAIT;
if (msg_flags & MSG_WAITALL)
min_ret = iov_iter_count(&msg.msg_iter);
+ msg_flags &= ~MSG_INTERNAL_SENDMSG_FLAGS;
msg.msg_flags = msg_flags;
msg.msg_ubuf = &io_notif_to_data(zc->notif)->uarg;