diff options
Diffstat (limited to 'net/tipc/node.h')
| -rw-r--r-- | net/tipc/node.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h index 3d18c66b7f78..02d5c20dc551 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
| @@ -64,7 +64,8 @@ enum { | |||
| 64 | TIPC_NOTIFY_LINK_UP = (1 << 6), | 64 | TIPC_NOTIFY_LINK_UP = (1 << 6), |
| 65 | TIPC_NOTIFY_LINK_DOWN = (1 << 7), | 65 | TIPC_NOTIFY_LINK_DOWN = (1 << 7), |
| 66 | TIPC_NAMED_MSG_EVT = (1 << 8), | 66 | TIPC_NAMED_MSG_EVT = (1 << 8), |
| 67 | TIPC_BCAST_MSG_EVT = (1 << 9) | 67 | TIPC_BCAST_MSG_EVT = (1 << 9), |
| 68 | TIPC_BCAST_RESET = (1 << 10) | ||
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| 70 | /** | 71 | /** |
| @@ -84,7 +85,7 @@ struct tipc_node_bclink { | |||
| 84 | u32 last_sent; | 85 | u32 last_sent; |
| 85 | u32 oos_state; | 86 | u32 oos_state; |
| 86 | u32 deferred_size; | 87 | u32 deferred_size; |
| 87 | struct sk_buff_head deferred_queue; | 88 | struct sk_buff_head deferdq; |
| 88 | struct sk_buff *reasm_buf; | 89 | struct sk_buff *reasm_buf; |
| 89 | int inputq_map; | 90 | int inputq_map; |
| 90 | bool recv_permitted; | 91 | bool recv_permitted; |
| @@ -93,6 +94,7 @@ struct tipc_node_bclink { | |||
| 93 | /** | 94 | /** |
| 94 | * struct tipc_node - TIPC node structure | 95 | * struct tipc_node - TIPC node structure |
| 95 | * @addr: network address of node | 96 | * @addr: network address of node |
| 97 | * @ref: reference counter to node object | ||
| 96 | * @lock: spinlock governing access to structure | 98 | * @lock: spinlock governing access to structure |
| 97 | * @net: the applicable net namespace | 99 | * @net: the applicable net namespace |
| 98 | * @hash: links to adjacent nodes in unsorted hash chain | 100 | * @hash: links to adjacent nodes in unsorted hash chain |
| @@ -106,6 +108,7 @@ struct tipc_node_bclink { | |||
| 106 | * @list: links to adjacent nodes in sorted list of cluster's nodes | 108 | * @list: links to adjacent nodes in sorted list of cluster's nodes |
| 107 | * @working_links: number of working links to node (both active and standby) | 109 | * @working_links: number of working links to node (both active and standby) |
| 108 | * @link_cnt: number of links to node | 110 | * @link_cnt: number of links to node |
| 111 | * @capabilities: bitmap, indicating peer node's functional capabilities | ||
| 109 | * @signature: node instance identifier | 112 | * @signature: node instance identifier |
| 110 | * @link_id: local and remote bearer ids of changing link, if any | 113 | * @link_id: local and remote bearer ids of changing link, if any |
| 111 | * @publ_list: list of publications | 114 | * @publ_list: list of publications |
| @@ -113,6 +116,7 @@ struct tipc_node_bclink { | |||
| 113 | */ | 116 | */ |
| 114 | struct tipc_node { | 117 | struct tipc_node { |
| 115 | u32 addr; | 118 | u32 addr; |
| 119 | struct kref kref; | ||
| 116 | spinlock_t lock; | 120 | spinlock_t lock; |
| 117 | struct net *net; | 121 | struct net *net; |
| 118 | struct hlist_node hash; | 122 | struct hlist_node hash; |
| @@ -125,7 +129,8 @@ struct tipc_node { | |||
| 125 | struct tipc_node_bclink bclink; | 129 | struct tipc_node_bclink bclink; |
| 126 | struct list_head list; | 130 | struct list_head list; |
| 127 | int link_cnt; | 131 | int link_cnt; |
| 128 | int working_links; | 132 | u16 working_links; |
| 133 | u16 capabilities; | ||
| 129 | u32 signature; | 134 | u32 signature; |
| 130 | u32 link_id; | 135 | u32 link_id; |
| 131 | struct list_head publ_list; | 136 | struct list_head publ_list; |
| @@ -134,6 +139,7 @@ struct tipc_node { | |||
| 134 | }; | 139 | }; |
| 135 | 140 | ||
| 136 | struct tipc_node *tipc_node_find(struct net *net, u32 addr); | 141 | struct tipc_node *tipc_node_find(struct net *net, u32 addr); |
| 142 | void tipc_node_put(struct tipc_node *node); | ||
| 137 | struct tipc_node *tipc_node_create(struct net *net, u32 addr); | 143 | struct tipc_node *tipc_node_create(struct net *net, u32 addr); |
| 138 | void tipc_node_stop(struct net *net); | 144 | void tipc_node_stop(struct net *net); |
| 139 | void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); | 145 | void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); |
| @@ -168,10 +174,12 @@ static inline uint tipc_node_get_mtu(struct net *net, u32 addr, u32 selector) | |||
| 168 | 174 | ||
| 169 | node = tipc_node_find(net, addr); | 175 | node = tipc_node_find(net, addr); |
| 170 | 176 | ||
| 171 | if (likely(node)) | 177 | if (likely(node)) { |
| 172 | mtu = node->act_mtus[selector & 1]; | 178 | mtu = node->act_mtus[selector & 1]; |
| 173 | else | 179 | tipc_node_put(node); |
| 180 | } else { | ||
| 174 | mtu = MAX_MSG_SIZE; | 181 | mtu = MAX_MSG_SIZE; |
| 182 | } | ||
| 175 | 183 | ||
| 176 | return mtu; | 184 | return mtu; |
| 177 | } | 185 | } |
