aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-08-23 03:13:46 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-23 03:13:46 -0400
commit21dc330157454046dd7c494961277d76e1c957fe (patch)
tree4f030efa8d82f7eb9676acd4cfc74921a6d29972 /net/core/skbuff.c
parent2d4833aae65589ba4317dd325fe20c8b25c14173 (diff)
net: Rename skb_has_frags to skb_has_frag_list
SKBs can be "fragmented" in two ways, via a page array (called skb_shinfo(skb)->frags[]) and via a list of SKBs (called skb_shinfo(skb)->frag_list). Since skb_has_frags() tests the latter, it's name is confusing since it sounds more like it's testing the former. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 99ef721f773d..e2535fb4985d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -340,7 +340,7 @@ static void skb_release_data(struct sk_buff *skb)
340 put_page(skb_shinfo(skb)->frags[i].page); 340 put_page(skb_shinfo(skb)->frags[i].page);
341 } 341 }
342 342
343 if (skb_has_frags(skb)) 343 if (skb_has_frag_list(skb))
344 skb_drop_fraglist(skb); 344 skb_drop_fraglist(skb);
345 345
346 kfree(skb->head); 346 kfree(skb->head);
@@ -759,7 +759,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
759 skb_shinfo(n)->nr_frags = i; 759 skb_shinfo(n)->nr_frags = i;
760 } 760 }
761 761
762 if (skb_has_frags(skb)) { 762 if (skb_has_frag_list(skb)) {
763 skb_shinfo(n)->frag_list = skb_shinfo(skb)->frag_list; 763 skb_shinfo(n)->frag_list = skb_shinfo(skb)->frag_list;
764 skb_clone_fraglist(n); 764 skb_clone_fraglist(n);
765 } 765 }
@@ -822,7 +822,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
822 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) 822 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
823 get_page(skb_shinfo(skb)->frags[i].page); 823 get_page(skb_shinfo(skb)->frags[i].page);
824 824
825 if (skb_has_frags(skb)) 825 if (skb_has_frag_list(skb))
826 skb_clone_fraglist(skb); 826 skb_clone_fraglist(skb);
827 827
828 skb_release_data(skb); 828 skb_release_data(skb);
@@ -1099,7 +1099,7 @@ drop_pages:
1099 for (; i < nfrags; i++) 1099 for (; i < nfrags; i++)
1100 put_page(skb_shinfo(skb)->frags[i].page); 1100 put_page(skb_shinfo(skb)->frags[i].page);
1101 1101
1102 if (skb_has_frags(skb)) 1102 if (skb_has_frag_list(skb))
1103 skb_drop_fraglist(skb); 1103 skb_drop_fraglist(skb);
1104 goto done; 1104 goto done;
1105 } 1105 }
@@ -1194,7 +1194,7 @@ unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta)
1194 /* Optimization: no fragments, no reasons to preestimate 1194 /* Optimization: no fragments, no reasons to preestimate
1195 * size of pulled pages. Superb. 1195 * size of pulled pages. Superb.
1196 */ 1196 */
1197 if (!skb_has_frags(skb)) 1197 if (!skb_has_frag_list(skb))
1198 goto pull_pages; 1198 goto pull_pages;
1199 1199
1200 /* Estimate size of pulled pages. */ 1200 /* Estimate size of pulled pages. */
@@ -2323,7 +2323,7 @@ next_skb:
2323 st->frag_data = NULL; 2323 st->frag_data = NULL;
2324 } 2324 }
2325 2325
2326 if (st->root_skb == st->cur_skb && skb_has_frags(st->root_skb)) { 2326 if (st->root_skb == st->cur_skb && skb_has_frag_list(st->root_skb)) {
2327 st->cur_skb = skb_shinfo(st->root_skb)->frag_list; 2327 st->cur_skb = skb_shinfo(st->root_skb)->frag_list;
2328 st->frag_idx = 0; 2328 st->frag_idx = 0;
2329 goto next_skb; 2329 goto next_skb;
@@ -2889,7 +2889,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
2889 return -ENOMEM; 2889 return -ENOMEM;
2890 2890
2891 /* Easy case. Most of packets will go this way. */ 2891 /* Easy case. Most of packets will go this way. */
2892 if (!skb_has_frags(skb)) { 2892 if (!skb_has_frag_list(skb)) {
2893 /* A little of trouble, not enough of space for trailer. 2893 /* A little of trouble, not enough of space for trailer.
2894 * This should not happen, when stack is tuned to generate 2894 * This should not happen, when stack is tuned to generate
2895 * good frames. OK, on miss we reallocate and reserve even more 2895 * good frames. OK, on miss we reallocate and reserve even more
@@ -2924,7 +2924,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
2924 2924
2925 if (skb1->next == NULL && tailbits) { 2925 if (skb1->next == NULL && tailbits) {
2926 if (skb_shinfo(skb1)->nr_frags || 2926 if (skb_shinfo(skb1)->nr_frags ||
2927 skb_has_frags(skb1) || 2927 skb_has_frag_list(skb1) ||
2928 skb_tailroom(skb1) < tailbits) 2928 skb_tailroom(skb1) < tailbits)
2929 ntail = tailbits + 128; 2929 ntail = tailbits + 128;
2930 } 2930 }
@@ -2933,7 +2933,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
2933 skb_cloned(skb1) || 2933 skb_cloned(skb1) ||
2934 ntail || 2934 ntail ||
2935 skb_shinfo(skb1)->nr_frags || 2935 skb_shinfo(skb1)->nr_frags ||
2936 skb_has_frags(skb1)) { 2936 skb_has_frag_list(skb1)) {
2937 struct sk_buff *skb2; 2937 struct sk_buff *skb2;
2938 2938
2939 /* Fuck, we are miserable poor guys... */ 2939 /* Fuck, we are miserable poor guys... */