diff options
| author | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2004-06-20 13:45:03 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2004-06-20 13:45:03 -0300 |
| commit | 86adf644850fbbc3da6448e8e1a0e39fe755e8e9 (patch) | |
| tree | 84ee0d4383da8ac9c7eb88898e579a82d8dbfa08 /include/linux | |
| parent | 56a6f4d0679764b124298f80f113b67db22e6ff4 (diff) | |
[NET] move skb_can_coalesce to skbuff.h
This one also removes the duplicate can_coalesce in tcp.c and makes it
use skb_can_coalesce.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/skbuff.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f777878608ab..cc44268a6e83 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -993,6 +993,18 @@ static inline int skb_add_data(struct sk_buff *skb, return -EFAULT; } +static inline int skb_can_coalesce(struct sk_buff *skb, int i, + struct page *page, int off) +{ + if (i) { + struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; + + return page == frag->page && + off == frag->page_offset + frag->size; + } + return 0; +} + /** * skb_linearize - convert paged skb to linear one * @skb: buffer to linarize |
