diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2007-03-31 10:55:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:29 -0400 |
commit | 27d7ff46a3498d3debc6ba68fb8014c702b81170 (patch) | |
tree | b5a0c617cf8339524d3b1f1633e08eae7b94cf86 /net/core | |
parent | 3dbad80ac7632f243b824d469301abb97ec634a1 (diff) |
[SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}
To clearly state the intent of copying to linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/netpoll.c | 2 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 57a82445c465..1fb30c3528bc 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -293,7 +293,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
293 | if (!skb) | 293 | if (!skb) |
294 | return; | 294 | return; |
295 | 295 | ||
296 | memcpy(skb->data, msg, len); | 296 | skb_copy_to_linear_data(skb, msg, len); |
297 | skb->len += len; | 297 | skb->len += len; |
298 | 298 | ||
299 | skb_push(skb, sizeof(*udph)); | 299 | skb_push(skb, sizeof(*udph)); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 17c6bb5927b6..331d3efa82fa 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1129,7 +1129,7 @@ int skb_store_bits(const struct sk_buff *skb, int offset, void *from, int len) | |||
1129 | if ((copy = start - offset) > 0) { | 1129 | if ((copy = start - offset) > 0) { |
1130 | if (copy > len) | 1130 | if (copy > len) |
1131 | copy = len; | 1131 | copy = len; |
1132 | memcpy(skb->data + offset, from, copy); | 1132 | skb_copy_to_linear_data_offset(skb, offset, from, copy); |
1133 | if ((len -= copy) == 0) | 1133 | if ((len -= copy) == 0) |
1134 | return 0; | 1134 | return 0; |
1135 | offset += copy; | 1135 | offset += copy; |