Lines Matching defs:node
34 struct o2nm_node *node = NULL;
40 node = o2nm_single_cluster->cl_nodes[node_num];
41 if (node)
42 config_item_get(&node->nd_item);
45 return node;
73 struct o2nm_node *node, *ret = NULL;
79 node = rb_entry(parent, struct o2nm_node, nd_ip_node);
81 cmp = memcmp(&ip_needle, &node->nd_ipv4_address,
88 ret = node;
103 struct o2nm_node *node = NULL;
110 node = o2nm_node_ip_tree_lookup(cluster, addr, NULL, NULL);
111 if (node)
112 config_item_get(&node->nd_item);
116 return node;
120 void o2nm_node_put(struct o2nm_node *node)
122 config_item_put(&node->nd_item);
126 void o2nm_node_get(struct o2nm_node *node)
128 config_item_get(&node->nd_item);
143 /* node configfs bits */
160 struct o2nm_node *node = to_o2nm_node(item);
161 kfree(node);
169 static struct o2nm_cluster *to_o2nm_cluster_from_node(struct o2nm_node *node)
173 if (node->nd_item.ci_parent)
174 return to_o2nm_cluster(node->nd_item.ci_parent->ci_parent);
188 struct o2nm_node *node = to_o2nm_node(item);
202 * node number and try to use our address and port attributes
203 * to connect to this node.. make sure that they've been set
204 * before writing the node attribute? */
205 if (!test_bit(O2NM_NODE_ATTR_ADDRESS, &node->nd_set_attributes) ||
206 !test_bit(O2NM_NODE_ATTR_PORT, &node->nd_set_attributes))
210 cluster = to_o2nm_cluster_from_node(node);
220 &node->nd_set_attributes))
223 cluster->cl_nodes[tmp] = node;
224 node->nd_num = tmp;
243 struct o2nm_node *node = to_o2nm_node(item);
256 if (test_and_set_bit(O2NM_NODE_ATTR_PORT, &node->nd_set_attributes))
258 node->nd_ipv4_port = htons(tmp);
272 struct o2nm_node *node = to_o2nm_node(item);
291 cluster = to_o2nm_cluster_from_node(node);
302 &node->nd_set_attributes))
305 rb_link_node(&node->nd_ip_node, parent, p);
306 rb_insert_color(&node->nd_ip_node, &cluster->cl_node_ip_tree);
314 memcpy(&node->nd_ipv4_address, &ipv4_addr, sizeof(ipv4_addr));
327 struct o2nm_node *node = to_o2nm_node(item);
337 tmp = !!tmp; /* boolean of whether this node wants to be local */
341 if (!test_bit(O2NM_NODE_ATTR_ADDRESS, &node->nd_set_attributes) ||
342 !test_bit(O2NM_NODE_ATTR_NUM, &node->nd_set_attributes) ||
343 !test_bit(O2NM_NODE_ATTR_PORT, &node->nd_set_attributes))
347 cluster = to_o2nm_cluster_from_node(node);
353 /* the only failure case is trying to set a new local node
356 cluster->cl_local_node != node->nd_num) {
361 /* bring up the rx thread if we're setting the new local node. */
363 ret = o2net_start_listening(node);
369 cluster->cl_local_node == node->nd_num) {
370 o2net_stop_listening(node);
374 node->nd_local = tmp;
375 if (node->nd_local) {
377 cluster->cl_local_node = node->nd_num;
410 /* node set */
586 struct o2nm_node *node = NULL;
591 node = kzalloc(sizeof(struct o2nm_node), GFP_KERNEL);
592 if (node == NULL)
595 strcpy(node->nd_name, name); /* use item.ci_namebuf instead? */
596 config_item_init_type_name(&node->nd_item, name, &o2nm_node_type);
597 spin_lock_init(&node->nd_lock);
599 mlog(ML_CLUSTER, "o2nm: Registering node %s\n", name);
601 return &node->nd_item;
607 struct o2nm_node *node = to_o2nm_node(item);
610 if (cluster->cl_nodes[node->nd_num] == node) {
611 o2net_disconnect_node(node);
614 (cluster->cl_local_node == node->nd_num)) {
617 o2net_stop_listening(node);
621 /* XXX call into net to stop this node from trading messages */
626 if (node->nd_ipv4_address)
627 rb_erase(&node->nd_ip_node, &cluster->cl_node_ip_tree);
629 /* nd_num might be 0 if the node number hasn't been set.. */
630 if (cluster->cl_nodes[node->nd_num] == node) {
631 cluster->cl_nodes[node->nd_num] = NULL;
632 clear_bit(node->nd_num, cluster->cl_nodes_bitmap);
636 mlog(ML_CLUSTER, "o2nm: Unregistered node %s\n",
637 config_item_name(&node->nd_item));
709 config_group_init_type_name(&ns->ns_group, "node",