diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-15 21:39:31 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 15:53:35 -0400 |
commit | 01e97e6517053d7c0b9af5248e944a9209909cf5 (patch) | |
tree | 30f57eededa62a390543b3a596d81006deb22384 /net/ipv4/tcp.c | |
parent | a2dd3793a1c3ac709f1d7b48ad7751563f4c654f (diff) |
new helper: msg_data_left()
convert open-coded instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 094a6822c71d..18e3a12eb1b2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1119,7 +1119,7 @@ int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) | |||
1119 | 1119 | ||
1120 | sg = !!(sk->sk_route_caps & NETIF_F_SG); | 1120 | sg = !!(sk->sk_route_caps & NETIF_F_SG); |
1121 | 1121 | ||
1122 | while (iov_iter_count(&msg->msg_iter)) { | 1122 | while (msg_data_left(msg)) { |
1123 | int copy = 0; | 1123 | int copy = 0; |
1124 | int max = size_goal; | 1124 | int max = size_goal; |
1125 | 1125 | ||
@@ -1163,8 +1163,8 @@ new_segment: | |||
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | /* Try to append data to the end of skb. */ | 1165 | /* Try to append data to the end of skb. */ |
1166 | if (copy > iov_iter_count(&msg->msg_iter)) | 1166 | if (copy > msg_data_left(msg)) |
1167 | copy = iov_iter_count(&msg->msg_iter); | 1167 | copy = msg_data_left(msg); |
1168 | 1168 | ||
1169 | /* Where to copy to? */ | 1169 | /* Where to copy to? */ |
1170 | if (skb_availroom(skb) > 0) { | 1170 | if (skb_availroom(skb) > 0) { |
@@ -1221,7 +1221,7 @@ new_segment: | |||
1221 | tcp_skb_pcount_set(skb, 0); | 1221 | tcp_skb_pcount_set(skb, 0); |
1222 | 1222 | ||
1223 | copied += copy; | 1223 | copied += copy; |
1224 | if (!iov_iter_count(&msg->msg_iter)) { | 1224 | if (!msg_data_left(msg)) { |
1225 | tcp_tx_timestamp(sk, skb); | 1225 | tcp_tx_timestamp(sk, skb); |
1226 | goto out; | 1226 | goto out; |
1227 | } | 1227 | } |