diff options
author | Ying Xue <ying.xue@windriver.com> | 2013-10-18 01:23:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-18 13:20:42 -0400 |
commit | 9446b87addd90a067b21c726aedd3c42694c1780 (patch) | |
tree | e87770cf1526e863e68feedac896e2133d79f607 /net/tipc/msg.c | |
parent | 5c0a0fc81f4dc786b42c4fc9c7c72ba635406ab5 (diff) |
tipc: remove iovec length parameter from all sending functions
tipc_msg_build() now copies message data from iovec to skb_buff
using memcpy_fromiovecend(), which doesn't need to be passed the
iovec length to perform the copying.
So we remove the parameter indicating iovec length in all
functions where TIPC messages are built and sent.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/msg.c')
-rw-r--r-- | net/tipc/msg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/tipc/msg.c b/net/tipc/msg.c index 1e76d91e5691..e525f8ce1dee 100644 --- a/net/tipc/msg.c +++ b/net/tipc/msg.c | |||
@@ -73,13 +73,12 @@ void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type, u32 hsize, | |||
73 | * Returns message data size or errno | 73 | * Returns message data size or errno |
74 | */ | 74 | */ |
75 | int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, | 75 | int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, |
76 | u32 num_sect, unsigned int total_len, int max_size, | 76 | unsigned int len, int max_size, struct sk_buff **buf) |
77 | struct sk_buff **buf) | ||
78 | { | 77 | { |
79 | int dsz, sz, hsz; | 78 | int dsz, sz, hsz; |
80 | unsigned char *to; | 79 | unsigned char *to; |
81 | 80 | ||
82 | dsz = total_len; | 81 | dsz = len; |
83 | hsz = msg_hdr_sz(hdr); | 82 | hsz = msg_hdr_sz(hdr); |
84 | sz = hsz + dsz; | 83 | sz = hsz + dsz; |
85 | msg_set_size(hdr, sz); | 84 | msg_set_size(hdr, sz); |
@@ -93,7 +92,7 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, | |||
93 | return -ENOMEM; | 92 | return -ENOMEM; |
94 | skb_copy_to_linear_data(*buf, hdr, hsz); | 93 | skb_copy_to_linear_data(*buf, hdr, hsz); |
95 | to = (*buf)->data + hsz; | 94 | to = (*buf)->data + hsz; |
96 | if (total_len && memcpy_fromiovecend(to, msg_sect, 0, dsz)) { | 95 | if (len && memcpy_fromiovecend(to, msg_sect, 0, dsz)) { |
97 | kfree_skb(*buf); | 96 | kfree_skb(*buf); |
98 | *buf = NULL; | 97 | *buf = NULL; |
99 | return -EFAULT; | 98 | return -EFAULT; |