linux/net/tipc
Jon Paul Maloy c5898636c4 tipc: reduce usage of context info in socket and link
The most common usage of namespace information is when we fetch the
own node addess from the net structure. This leads to a lot of
passing around of a parameter of type 'struct net *' between
functions just to make them able to obtain this address.

However, in many cases this is unnecessary. The own node address
is readily available as a member of both struct tipc_sock and
tipc_link, and can be fetched from there instead.
The fact that the vast majority of functions in socket.c and link.c
anyway are maintaining a pointer to their respective base structures
makes this option even more compelling.

In this commit, we introduce the inline functions tsk_own_node()
and link_own_node() to make it easy for functions to fetch the node
address from those structs instead of having to pass along and
dereference the namespace struct.

In particular, we make calls to the msg_xx() functions in msg.{h,c}
context independent by directly passing them the own node address
as parameter when needed. Those functions should be regarded as
leaves in the code dependency tree, and it is hence desirable to
keep them namspace unaware.

Apart from a potential positive effect on cache behavior, these
changes make it easier to introduce the changes that will follow
later in this series.

Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-05 16:00:01 -08:00
..
addr.c tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
addr.h tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
bcast.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
bcast.h tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
bearer.c tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
bearer.h tipc: make tipc broadcast link support net namespace 2015-01-12 16:24:33 -05:00
config.c tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
config.h tipc: involve namespace infrastructure 2015-01-12 16:24:32 -05:00
core.c tipc: make tipc random value aware of net namespace 2015-01-12 16:24:33 -05:00
core.h tipc: make tipc random value aware of net namespace 2015-01-12 16:24:33 -05:00
discover.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
discover.h tipc: involve namespace infrastructure 2015-01-12 16:24:32 -05:00
eth_media.c tipc: improve and extend media address conversion functions 2014-05-14 15:19:48 -04:00
ib_media.c tipc: improve and extend media address conversion functions 2014-05-14 15:19:48 -04:00
Kconfig tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
link.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
link.h tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
log.c tipc: remove print_buf and deprecated log buffer code 2012-07-13 19:34:43 -04:00
Makefile tipc: remove node subscription infrastructure 2014-11-26 12:30:16 -05:00
msg.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
msg.h tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
name_distr.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
name_distr.h tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
name_table.c tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
name_table.h tipc: name tipc name table support net namespace 2015-01-12 16:24:33 -05:00
net.c tipc: make tipc node address support net namespace 2015-01-12 16:24:33 -05:00
net.h tipc: make tipc node table aware of net namespace 2015-01-12 16:24:32 -05:00
netlink.c tipc: make netlink support net namespace 2015-01-12 16:24:34 -05:00
netlink.h tipc: cleanup core.c and core.h files 2015-01-12 16:24:31 -05:00
node.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
node.h tipc: make tipc node table aware of net namespace 2015-01-12 16:24:32 -05:00
server.c tipc: make subscriber server support net namespace 2015-01-12 16:24:33 -05:00
server.h tipc: make subscriber server support net namespace 2015-01-12 16:24:33 -05:00
socket.c tipc: reduce usage of context info in socket and link 2015-02-05 16:00:01 -08:00
socket.h tipc: make subscriber server support net namespace 2015-01-12 16:24:33 -05:00
subscr.c tipc: make subscriber server support net namespace 2015-01-12 16:24:33 -05:00
subscr.h tipc: make subscriber server support net namespace 2015-01-12 16:24:33 -05:00
sysctl.c tipc: add name distributor resiliency queue 2014-09-01 17:51:48 -07:00