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/tipc/msg.h | |
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/tipc/msg.h')
-rw-r--r-- | net/tipc/msg.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index 62d549063604..aec7ce7af875 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h | |||
@@ -786,15 +786,16 @@ static inline int msg_build(struct tipc_msg *hdr, | |||
786 | *buf = buf_acquire(sz); | 786 | *buf = buf_acquire(sz); |
787 | if (!(*buf)) | 787 | if (!(*buf)) |
788 | return -ENOMEM; | 788 | return -ENOMEM; |
789 | memcpy((*buf)->data, (unchar *)hdr, hsz); | 789 | skb_copy_to_linear_data(*buf, hdr, hsz); |
790 | for (res = 1, cnt = 0; res && (cnt < num_sect); cnt++) { | 790 | for (res = 1, cnt = 0; res && (cnt < num_sect); cnt++) { |
791 | if (likely(usrmem)) | 791 | if (likely(usrmem)) |
792 | res = !copy_from_user((*buf)->data + pos, | 792 | res = !copy_from_user((*buf)->data + pos, |
793 | msg_sect[cnt].iov_base, | 793 | msg_sect[cnt].iov_base, |
794 | msg_sect[cnt].iov_len); | 794 | msg_sect[cnt].iov_len); |
795 | else | 795 | else |
796 | memcpy((*buf)->data + pos, msg_sect[cnt].iov_base, | 796 | skb_copy_to_linear_data_offset(*buf, pos, |
797 | msg_sect[cnt].iov_len); | 797 | msg_sect[cnt].iov_base, |
798 | msg_sect[cnt].iov_len); | ||
798 | pos += msg_sect[cnt].iov_len; | 799 | pos += msg_sect[cnt].iov_len; |
799 | } | 800 | } |
800 | if (likely(res)) | 801 | if (likely(res)) |