Lines Matching refs:node
75 static void tipc_node_delete(struct tipc_node *node);
105 struct tipc_node *node = container_of(kref, struct tipc_node, kref); in tipc_node_kref_release() local
107 tipc_node_delete(node); in tipc_node_kref_release()
110 void tipc_node_put(struct tipc_node *node) in tipc_node_put() argument
112 kref_put(&node->kref, tipc_node_kref_release); in tipc_node_put()
115 static void tipc_node_get(struct tipc_node *node) in tipc_node_get() argument
117 kref_get(&node->kref); in tipc_node_get()
126 struct tipc_node *node; in tipc_node_find() local
132 hlist_for_each_entry_rcu(node, &tn->node_htable[tipc_hashfn(addr)], in tipc_node_find()
134 if (node->addr == addr) { in tipc_node_find()
135 tipc_node_get(node); in tipc_node_find()
137 return node; in tipc_node_find()
215 static void tipc_node_delete(struct tipc_node *node) in tipc_node_delete() argument
217 list_del_rcu(&node->list); in tipc_node_delete()
218 hlist_del_rcu(&node->hash); in tipc_node_delete()
219 kfree(node->bc_entry.link); in tipc_node_delete()
220 kfree_rcu(node, rcu); in tipc_node_delete()
226 struct tipc_node *node, *t_node; in tipc_node_stop() local
229 list_for_each_entry_safe(node, t_node, &tn->node_list, list) { in tipc_node_stop()
230 if (del_timer(&node->timer)) in tipc_node_stop()
231 tipc_node_put(node); in tipc_node_stop()
232 tipc_node_put(node); in tipc_node_stop()
239 struct tipc_node *node; in tipc_node_add_conn() local
246 node = tipc_node_find(net, dnode); in tipc_node_add_conn()
247 if (!node) { in tipc_node_add_conn()
260 tipc_node_lock(node); in tipc_node_add_conn()
261 list_add_tail(&conn->list, &node->conn_sks); in tipc_node_add_conn()
262 tipc_node_unlock(node); in tipc_node_add_conn()
264 tipc_node_put(node); in tipc_node_add_conn()
270 struct tipc_node *node; in tipc_node_remove_conn() local
276 node = tipc_node_find(net, dnode); in tipc_node_remove_conn()
277 if (!node) in tipc_node_remove_conn()
280 tipc_node_lock(node); in tipc_node_remove_conn()
281 list_for_each_entry_safe(conn, safe, &node->conn_sks, list) { in tipc_node_remove_conn()
287 tipc_node_unlock(node); in tipc_node_remove_conn()
288 tipc_node_put(node); in tipc_node_remove_conn()
908 struct tipc_node *node = tipc_node_find(net, addr); in tipc_node_get_linkname() local
910 if (!node) in tipc_node_get_linkname()
916 tipc_node_lock(node); in tipc_node_get_linkname()
917 link = node->links[bearer_id].link; in tipc_node_get_linkname()
923 tipc_node_unlock(node); in tipc_node_get_linkname()
924 tipc_node_put(node); in tipc_node_get_linkname()
928 void tipc_node_unlock(struct tipc_node *node) in tipc_node_unlock() argument
930 struct net *net = node->net; in tipc_node_unlock()
932 u32 flags = node->action_flags; in tipc_node_unlock()
937 spin_unlock_bh(&node->lock); in tipc_node_unlock()
941 addr = node->addr; in tipc_node_unlock()
942 link_id = node->link_id; in tipc_node_unlock()
943 publ_list = &node->publ_list; in tipc_node_unlock()
945 node->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP | in tipc_node_unlock()
948 spin_unlock_bh(&node->lock); in tipc_node_unlock()
967 static int __tipc_nl_add_node(struct tipc_nl_msg *msg, struct tipc_node *node) in __tipc_nl_add_node() argument
981 if (nla_put_u32(msg->skb, TIPC_NLA_NODE_ADDR, node->addr)) in __tipc_nl_add_node()
983 if (tipc_node_is_up(node)) in __tipc_nl_add_node()
1351 struct tipc_node *node; in tipc_nl_node_dump() local
1363 node = tipc_node_find(net, last_addr); in tipc_nl_node_dump()
1364 if (!node) { in tipc_nl_node_dump()
1376 tipc_node_put(node); in tipc_nl_node_dump()
1379 list_for_each_entry_rcu(node, &tn->node_list, list) { in tipc_nl_node_dump()
1381 if (node->addr == last_addr) in tipc_nl_node_dump()
1387 tipc_node_lock(node); in tipc_nl_node_dump()
1388 err = __tipc_nl_add_node(&msg, node); in tipc_nl_node_dump()
1390 last_addr = node->addr; in tipc_nl_node_dump()
1391 tipc_node_unlock(node); in tipc_nl_node_dump()
1395 tipc_node_unlock(node); in tipc_nl_node_dump()