Lines Matching refs:node

45 static void tipc_node_delete(struct tipc_node *node);
73 struct tipc_node *node = container_of(kref, struct tipc_node, kref); in tipc_node_kref_release() local
75 tipc_node_delete(node); in tipc_node_kref_release()
78 void tipc_node_put(struct tipc_node *node) in tipc_node_put() argument
80 kref_put(&node->kref, tipc_node_kref_release); in tipc_node_put()
83 static void tipc_node_get(struct tipc_node *node) in tipc_node_get() argument
85 kref_get(&node->kref); in tipc_node_get()
94 struct tipc_node *node; in tipc_node_find() local
100 hlist_for_each_entry_rcu(node, &tn->node_htable[tipc_hashfn(addr)], in tipc_node_find()
102 if (node->addr == addr) { in tipc_node_find()
103 tipc_node_get(node); in tipc_node_find()
105 return node; in tipc_node_find()
149 static void tipc_node_delete(struct tipc_node *node) in tipc_node_delete() argument
151 list_del_rcu(&node->list); in tipc_node_delete()
152 hlist_del_rcu(&node->hash); in tipc_node_delete()
153 kfree_rcu(node, rcu); in tipc_node_delete()
159 struct tipc_node *node, *t_node; in tipc_node_stop() local
162 list_for_each_entry_safe(node, t_node, &tn->node_list, list) in tipc_node_stop()
163 tipc_node_put(node); in tipc_node_stop()
169 struct tipc_node *node; in tipc_node_add_conn() local
176 node = tipc_node_find(net, dnode); in tipc_node_add_conn()
177 if (!node) { in tipc_node_add_conn()
190 tipc_node_lock(node); in tipc_node_add_conn()
191 list_add_tail(&conn->list, &node->conn_sks); in tipc_node_add_conn()
192 tipc_node_unlock(node); in tipc_node_add_conn()
194 tipc_node_put(node); in tipc_node_add_conn()
200 struct tipc_node *node; in tipc_node_remove_conn() local
206 node = tipc_node_find(net, dnode); in tipc_node_remove_conn()
207 if (!node) in tipc_node_remove_conn()
210 tipc_node_lock(node); in tipc_node_remove_conn()
211 list_for_each_entry_safe(conn, safe, &node->conn_sks, list) { in tipc_node_remove_conn()
217 tipc_node_unlock(node); in tipc_node_remove_conn()
218 tipc_node_put(node); in tipc_node_remove_conn()
446 struct tipc_node *node = tipc_node_find(net, addr); in tipc_node_get_linkname() local
448 if (!node) in tipc_node_get_linkname()
454 tipc_node_lock(node); in tipc_node_get_linkname()
455 link = node->links[bearer_id]; in tipc_node_get_linkname()
461 tipc_node_unlock(node); in tipc_node_get_linkname()
462 tipc_node_put(node); in tipc_node_get_linkname()
466 void tipc_node_unlock(struct tipc_node *node) in tipc_node_unlock() argument
468 struct net *net = node->net; in tipc_node_unlock()
470 u32 flags = node->action_flags; in tipc_node_unlock()
473 struct sk_buff_head *inputq = node->inputq; in tipc_node_unlock()
477 node->action_flags = 0; in tipc_node_unlock()
478 spin_unlock_bh(&node->lock); in tipc_node_unlock()
484 addr = node->addr; in tipc_node_unlock()
485 link_id = node->link_id; in tipc_node_unlock()
486 namedq = node->namedq; in tipc_node_unlock()
487 publ_list = &node->publ_list; in tipc_node_unlock()
489 node->action_flags &= ~(TIPC_MSG_EVT | in tipc_node_unlock()
495 spin_unlock_bh(&node->lock); in tipc_node_unlock()
524 tipc_link_reset_all(node); in tipc_node_unlock()
528 static int __tipc_nl_add_node(struct tipc_nl_msg *msg, struct tipc_node *node) in __tipc_nl_add_node() argument
542 if (nla_put_u32(msg->skb, TIPC_NLA_NODE_ADDR, node->addr)) in __tipc_nl_add_node()
544 if (tipc_node_is_up(node)) in __tipc_nl_add_node()
568 struct tipc_node *node; in tipc_nl_node_dump() local
580 node = tipc_node_find(net, last_addr); in tipc_nl_node_dump()
581 if (!node) { in tipc_nl_node_dump()
593 tipc_node_put(node); in tipc_nl_node_dump()
596 list_for_each_entry_rcu(node, &tn->node_list, list) { in tipc_nl_node_dump()
598 if (node->addr == last_addr) in tipc_nl_node_dump()
604 tipc_node_lock(node); in tipc_nl_node_dump()
605 err = __tipc_nl_add_node(&msg, node); in tipc_nl_node_dump()
607 last_addr = node->addr; in tipc_nl_node_dump()
608 tipc_node_unlock(node); in tipc_nl_node_dump()
612 tipc_node_unlock(node); in tipc_nl_node_dump()