aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-18 17:00:24 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-19 03:10:46 -0400
commit9e903e085262ffbf1fc44a17ac06058aca03524a (patch)
tree4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/xen-netback
parentdd767856a36e00b631d65ebc4bb81b19915532d6 (diff)
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize all references to skb frags size. Define accessors : skb_frag_size() to fetch frag size, and skb_frag_size_{set|add|sub}() to manipulate it. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r--drivers/net/xen-netback/netback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 8d70b44fcd8a..d5508957200e 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -334,7 +334,7 @@ unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
334 count++; 334 count++;
335 335
336 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 336 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
337 unsigned long size = skb_shinfo(skb)->frags[i].size; 337 unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
338 unsigned long bytes; 338 unsigned long bytes;
339 while (size > 0) { 339 while (size > 0) {
340 BUG_ON(copy_off > MAX_BUFFER_OFFSET); 340 BUG_ON(copy_off > MAX_BUFFER_OFFSET);
@@ -526,7 +526,7 @@ static int netbk_gop_skb(struct sk_buff *skb,
526 for (i = 0; i < nr_frags; i++) { 526 for (i = 0; i < nr_frags; i++) {
527 netbk_gop_frag_copy(vif, skb, npo, 527 netbk_gop_frag_copy(vif, skb, npo,
528 skb_frag_page(&skb_shinfo(skb)->frags[i]), 528 skb_frag_page(&skb_shinfo(skb)->frags[i]),
529 skb_shinfo(skb)->frags[i].size, 529 skb_frag_size(&skb_shinfo(skb)->frags[i]),
530 skb_shinfo(skb)->frags[i].page_offset, 530 skb_shinfo(skb)->frags[i].page_offset,
531 &head); 531 &head);
532 } 532 }