Skip to content

Commit f4362a2

Browse files
author
Al Viro
committed
switch tcp_sock->ucopy from iovec (ucopy.iov) to msghdr (ucopy.msg)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent f69e6d1 commit f4362a2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

include/linux/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct tcp_sock {
162162
struct {
163163
struct sk_buff_head prequeue;
164164
struct task_struct *task;
165-
struct iovec *iov;
165+
struct msghdr *msg;
166166
int memory;
167167
int len;
168168
} ucopy;

net/ipv4/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
17291729
if (!user_recv && !(flags & (MSG_TRUNC | MSG_PEEK))) {
17301730
user_recv = current;
17311731
tp->ucopy.task = user_recv;
1732-
tp->ucopy.iov = msg->msg_iov;
1732+
tp->ucopy.msg = msg;
17331733
}
17341734

17351735
tp->ucopy.len = len;

net/ipv4/tcp_input.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,7 +4421,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
44214421
__set_current_state(TASK_RUNNING);
44224422

44234423
local_bh_enable();
4424-
if (!skb_copy_datagram_iovec(skb, 0, tp->ucopy.iov, chunk)) {
4424+
if (!skb_copy_datagram_msg(skb, 0, tp->ucopy.msg, chunk)) {
44254425
tp->ucopy.len -= chunk;
44264426
tp->copied_seq += chunk;
44274427
eaten = (chunk == skb->len);
@@ -4941,10 +4941,9 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen)
49414941

49424942
local_bh_enable();
49434943
if (skb_csum_unnecessary(skb))
4944-
err = skb_copy_datagram_iovec(skb, hlen, tp->ucopy.iov, chunk);
4944+
err = skb_copy_datagram_msg(skb, hlen, tp->ucopy.msg, chunk);
49454945
else
4946-
err = skb_copy_and_csum_datagram_iovec(skb, hlen,
4947-
tp->ucopy.iov);
4946+
err = skb_copy_and_csum_datagram_msg(skb, hlen, tp->ucopy.msg);
49484947

49494948
if (!err) {
49504949
tp->ucopy.len -= chunk;

0 commit comments

Comments
 (0)