Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336192
b: refs/heads/master
c: 64022d0
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 2, 2012
1 parent 9c92247 commit f21548a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f8933e960f98d27742727445061b0ece934e5cf
refs/heads/master: 64022d0b4e93ea432e95db55a72b8a1c5775f3c0
15 changes: 6 additions & 9 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ static int tcp_send_mss(struct sock *sk, int *size_goal, int flags)
return mss_now;
}

static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffset,
size_t psize, int flags)
static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
size_t size, int flags)
{
struct tcp_sock *tp = tcp_sk(sk);
int mss_now, size_goal;
Expand All @@ -858,12 +858,9 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
goto out_err;

while (psize > 0) {
while (size > 0) {
struct sk_buff *skb = tcp_write_queue_tail(sk);
struct page *page = pages[poffset / PAGE_SIZE];
int copy, i;
int offset = poffset % PAGE_SIZE;
int size = min_t(size_t, psize, PAGE_SIZE - offset);
bool can_coalesce;

if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) {
Expand Down Expand Up @@ -912,8 +909,8 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_PSH;

copied += copy;
poffset += copy;
if (!(psize -= copy))
offset += copy;
if (!(size -= copy))
goto out;

if (skb->len < size_goal || (flags & MSG_OOB))
Expand Down Expand Up @@ -960,7 +957,7 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset,
flags);

lock_sock(sk);
res = do_tcp_sendpages(sk, &page, offset, size, flags);
res = do_tcp_sendpages(sk, page, offset, size, flags);
release_sock(sk);
return res;
}
Expand Down

0 comments on commit f21548a

Please sign in to comment.