]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: Avoid recomputation of outgoing message length
authorAllan Stephens <Allan.Stephens@windriver.com>
Thu, 21 Apr 2011 15:42:07 +0000 (10:42 -0500)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Tue, 10 May 2011 20:03:57 +0000 (16:03 -0400)
commit9e243637e1c1a94186e8d7b8b9120a84e0ff970d
tree73d23b37b9e4ad965f893857aa618b0ed110bdf7
parentaec54d16e6f41a573fcb78f9521aadbf594e5367
tipc: Avoid recomputation of outgoing message length

Rework TIPC's message sending routines to take advantage of the total
amount of data value passed to it by the kernel socket infrastructure.
This change eliminates the need for TIPC to compute the size of outgoing
messages itself, as well as the check for an oversize message in
tipc_msg_build().  In addition, this change warrants an explanation:

   -     res = send_packet(NULL, sock, &my_msg, 0);
   +     res = send_packet(NULL, sock, &my_msg, bytes_to_send);

Previously, the final argument to send_packet() was ignored (since the
amount of data being sent was recalculated by a lower-level routine)
and we could just pass in a dummy value (0). Now that the
recalculation is being eliminated, the argument value being passed to
send_packet() is significant and we have to supply the actual amount
of data we want to send.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/link.c
net/tipc/link.h
net/tipc/msg.c
net/tipc/msg.h
net/tipc/port.c
net/tipc/port.h
net/tipc/socket.c
net/tipc/subscr.c