diff options
author | Eric Dumazet <edumazet@google.com> | 2012-04-23 13:48:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-24 00:18:02 -0400 |
commit | 38ba0a65faf451dd46c7860b4fade84c0b8e444f (patch) | |
tree | 30689f565d6ff6a0b046e0c8b05a5aa7544144dd | |
parent | 783c175f902b1ae011f12de45770e7912638ea1a (diff) |
net: skb_can_coalesce returns a boolean
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 6 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f25795ca6753..4a656b51825e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1963,8 +1963,8 @@ static inline int skb_add_data(struct sk_buff *skb, | |||
1963 | return -EFAULT; | 1963 | return -EFAULT; |
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | static inline int skb_can_coalesce(struct sk_buff *skb, int i, | 1966 | static inline bool skb_can_coalesce(struct sk_buff *skb, int i, |
1967 | const struct page *page, int off) | 1967 | const struct page *page, int off) |
1968 | { | 1968 | { |
1969 | if (i) { | 1969 | if (i) { |
1970 | const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; | 1970 | const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; |
@@ -1972,7 +1972,7 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i, | |||
1972 | return page == skb_frag_page(frag) && | 1972 | return page == skb_frag_page(frag) && |
1973 | off == frag->page_offset + skb_frag_size(frag); | 1973 | off == frag->page_offset + skb_frag_size(frag); |
1974 | } | 1974 | } |
1975 | return 0; | 1975 | return false; |
1976 | } | 1976 | } |
1977 | 1977 | ||
1978 | static inline int __skb_linearize(struct sk_buff *skb) | 1978 | static inline int __skb_linearize(struct sk_buff *skb) |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index bcc4eab5f251..de6a238f0e1d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -848,9 +848,10 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse | |||
848 | while (psize > 0) { | 848 | while (psize > 0) { |
849 | struct sk_buff *skb = tcp_write_queue_tail(sk); | 849 | struct sk_buff *skb = tcp_write_queue_tail(sk); |
850 | struct page *page = pages[poffset / PAGE_SIZE]; | 850 | struct page *page = pages[poffset / PAGE_SIZE]; |
851 | int copy, i, can_coalesce; | 851 | int copy, i; |
852 | int offset = poffset % PAGE_SIZE; | 852 | int offset = poffset % PAGE_SIZE; |
853 | int size = min_t(size_t, psize, PAGE_SIZE - offset); | 853 | int size = min_t(size_t, psize, PAGE_SIZE - offset); |
854 | bool can_coalesce; | ||
854 | 855 | ||
855 | if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) { | 856 | if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) { |
856 | new_segment: | 857 | new_segment: |