Commit 38ba0a65 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: skb_can_coalesce returns a boolean

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 783c175f
...@@ -1963,7 +1963,7 @@ static inline int skb_add_data(struct sk_buff *skb, ...@@ -1963,7 +1963,7 @@ static inline int skb_add_data(struct sk_buff *skb,
return -EFAULT; return -EFAULT;
} }
static inline int skb_can_coalesce(struct sk_buff *skb, int i, static inline bool skb_can_coalesce(struct sk_buff *skb, int i,
const struct page *page, int off) const struct page *page, int off)
{ {
if (i) { if (i) {
...@@ -1972,7 +1972,7 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i, ...@@ -1972,7 +1972,7 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
return page == skb_frag_page(frag) && return page == skb_frag_page(frag) &&
off == frag->page_offset + skb_frag_size(frag); off == frag->page_offset + skb_frag_size(frag);
} }
return 0; return false;
} }
static inline int __skb_linearize(struct sk_buff *skb) static inline int __skb_linearize(struct sk_buff *skb)
......
...@@ -848,9 +848,10 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse ...@@ -848,9 +848,10 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
while (psize > 0) { while (psize > 0) {
struct sk_buff *skb = tcp_write_queue_tail(sk); struct sk_buff *skb = tcp_write_queue_tail(sk);
struct page *page = pages[poffset / PAGE_SIZE]; struct page *page = pages[poffset / PAGE_SIZE];
int copy, i, can_coalesce; int copy, i;
int offset = poffset % PAGE_SIZE; int offset = poffset % PAGE_SIZE;
int size = min_t(size_t, psize, PAGE_SIZE - offset); int size = min_t(size_t, psize, PAGE_SIZE - offset);
bool can_coalesce;
if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) { if (!tcp_send_head(sk) || (copy = size_goal - skb->len) <= 0) {
new_segment: new_segment:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment