diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-07-30 18:24:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-30 20:25:15 -0400 |
commit | 440d8963cd590ec9387d76a36e60c02da9ed944d (patch) | |
tree | 7d1135b020321fd3bd06f9bd6dbc1837380858f8 /net/tipc/link.h | |
parent | 9073fb8be3ee6f89492b8ea8f6d3902913a9fc91 (diff) |
tipc: clean up link creation
We simplify the link creation function tipc_link_create() and the way
the link struct it is connected to the node struct. In particular, we
remove the duplicate initialization of some fields which are anyway set
in tipc_link_reset().
Tested-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>
Diffstat (limited to 'net/tipc/link.h')
-rw-r--r-- | net/tipc/link.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h index 39b8c4c5121e..39ff8b6919a4 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
@@ -148,7 +148,7 @@ struct tipc_stats { | |||
148 | struct tipc_link { | 148 | struct tipc_link { |
149 | u32 addr; | 149 | u32 addr; |
150 | char name[TIPC_MAX_LINK_NAME]; | 150 | char name[TIPC_MAX_LINK_NAME]; |
151 | struct tipc_media_addr media_addr; | 151 | struct tipc_media_addr *media_addr; |
152 | struct tipc_node *owner; | 152 | struct tipc_node *owner; |
153 | 153 | ||
154 | /* Management and link supervision data */ | 154 | /* Management and link supervision data */ |
@@ -205,13 +205,10 @@ struct tipc_link { | |||
205 | struct tipc_stats stats; | 205 | struct tipc_stats stats; |
206 | }; | 206 | }; |
207 | 207 | ||
208 | struct tipc_port; | 208 | bool tipc_link_create(struct tipc_node *n, struct tipc_bearer *b, u32 session, |
209 | 209 | u32 ownnode, u32 peer, struct tipc_media_addr *maddr, | |
210 | struct tipc_link *tipc_link_create(struct tipc_node *n, | 210 | struct sk_buff_head *inputq, struct sk_buff_head *namedq, |
211 | struct tipc_bearer *b, | 211 | struct tipc_link **link); |
212 | const struct tipc_media_addr *maddr, | ||
213 | struct sk_buff_head *inputq, | ||
214 | struct sk_buff_head *namedq); | ||
215 | void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl, | 212 | void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl, |
216 | int mtyp, struct sk_buff_head *xmitq); | 213 | int mtyp, struct sk_buff_head *xmitq); |
217 | void tipc_link_build_bcast_sync_msg(struct tipc_link *l, | 214 | void tipc_link_build_bcast_sync_msg(struct tipc_link *l, |
@@ -246,13 +243,8 @@ int tipc_nl_link_get(struct sk_buff *skb, struct genl_info *info); | |||
246 | int tipc_nl_link_set(struct sk_buff *skb, struct genl_info *info); | 243 | int tipc_nl_link_set(struct sk_buff *skb, struct genl_info *info); |
247 | int tipc_nl_link_reset_stats(struct sk_buff *skb, struct genl_info *info); | 244 | int tipc_nl_link_reset_stats(struct sk_buff *skb, struct genl_info *info); |
248 | int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[]); | 245 | int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[]); |
249 | void link_prepare_wakeup(struct tipc_link *l); | ||
250 | int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq); | 246 | int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq); |
251 | int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb, | 247 | int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb, |
252 | struct sk_buff_head *xmitq); | 248 | struct sk_buff_head *xmitq); |
253 | static inline u32 link_own_addr(struct tipc_link *l) | ||
254 | { | ||
255 | return msg_prevnode(l->pmsg); | ||
256 | } | ||
257 | 249 | ||
258 | #endif | 250 | #endif |