Lines Matching full:cluster
18 * cluster active at a time. Changing this will require trickling
19 * cluster references throughout where nodes are looked up */
49 struct o2nm_cluster *cluster = o2nm_single_cluster; in o2nm_configured_node_map() local
51 BUG_ON(bytes < (sizeof(cluster->cl_nodes_bitmap))); in o2nm_configured_node_map()
53 if (cluster == NULL) in o2nm_configured_node_map()
56 read_lock(&cluster->cl_nodes_lock); in o2nm_configured_node_map()
57 bitmap_copy(map, cluster->cl_nodes_bitmap, O2NM_MAX_NODES); in o2nm_configured_node_map()
58 read_unlock(&cluster->cl_nodes_lock); in o2nm_configured_node_map()
64 static struct o2nm_node *o2nm_node_ip_tree_lookup(struct o2nm_cluster *cluster, in o2nm_node_ip_tree_lookup() argument
69 struct rb_node **p = &cluster->cl_node_ip_tree.rb_node; in o2nm_node_ip_tree_lookup()
102 struct o2nm_cluster *cluster = o2nm_single_cluster; in o2nm_get_node_by_ip() local
104 if (cluster == NULL) in o2nm_get_node_by_ip()
107 read_lock(&cluster->cl_nodes_lock); in o2nm_get_node_by_ip()
108 node = o2nm_node_ip_tree_lookup(cluster, addr, NULL, NULL); in o2nm_get_node_by_ip()
111 read_unlock(&cluster->cl_nodes_lock); in o2nm_get_node_by_ip()
187 struct o2nm_cluster *cluster; in o2nm_node_num_store() local
208 cluster = to_o2nm_cluster_from_node(node); in o2nm_node_num_store()
209 if (!cluster) { in o2nm_node_num_store()
214 write_lock(&cluster->cl_nodes_lock); in o2nm_node_num_store()
215 if (cluster->cl_nodes[tmp]) in o2nm_node_num_store()
221 cluster->cl_nodes[tmp] = node; in o2nm_node_num_store()
223 set_bit(tmp, cluster->cl_nodes_bitmap); in o2nm_node_num_store()
225 write_unlock(&cluster->cl_nodes_lock); in o2nm_node_num_store()
271 struct o2nm_cluster *cluster; in o2nm_node_ipv4_address_store() local
289 cluster = to_o2nm_cluster_from_node(node); in o2nm_node_ipv4_address_store()
290 if (!cluster) { in o2nm_node_ipv4_address_store()
296 write_lock(&cluster->cl_nodes_lock); in o2nm_node_ipv4_address_store()
297 if (o2nm_node_ip_tree_lookup(cluster, ipv4_addr, &p, &parent)) in o2nm_node_ipv4_address_store()
304 rb_insert_color(&node->nd_ip_node, &cluster->cl_node_ip_tree); in o2nm_node_ipv4_address_store()
306 write_unlock(&cluster->cl_nodes_lock); in o2nm_node_ipv4_address_store()
326 struct o2nm_cluster *cluster; in o2nm_node_local_store() local
345 cluster = to_o2nm_cluster_from_node(node); in o2nm_node_local_store()
346 if (!cluster) { in o2nm_node_local_store()
353 if (tmp && tmp == cluster->cl_has_local && in o2nm_node_local_store()
354 cluster->cl_local_node != node->nd_num) { in o2nm_node_local_store()
360 if (tmp && !cluster->cl_has_local) { in o2nm_node_local_store()
366 if (!tmp && cluster->cl_has_local && in o2nm_node_local_store()
367 cluster->cl_local_node == node->nd_num) { in o2nm_node_local_store()
369 cluster->cl_local_node = O2NM_INVALID_NODE_NUM; in o2nm_node_local_store()
374 cluster->cl_has_local = tmp; in o2nm_node_local_store()
375 cluster->cl_local_node = node->nd_num; in o2nm_node_local_store()
453 struct o2nm_cluster *cluster = to_o2nm_cluster(item); in o2nm_cluster_idle_timeout_ms_store() local
460 if (cluster->cl_idle_timeout_ms != val in o2nm_cluster_idle_timeout_ms_store()
468 } else if (val <= cluster->cl_keepalive_delay_ms) { in o2nm_cluster_idle_timeout_ms_store()
473 cluster->cl_idle_timeout_ms = val; in o2nm_cluster_idle_timeout_ms_store()
490 struct o2nm_cluster *cluster = to_o2nm_cluster(item); in o2nm_cluster_keepalive_delay_ms_store() local
497 if (cluster->cl_keepalive_delay_ms != val in o2nm_cluster_keepalive_delay_ms_store()
505 } else if (val >= cluster->cl_idle_timeout_ms) { in o2nm_cluster_keepalive_delay_ms_store()
510 cluster->cl_keepalive_delay_ms = val; in o2nm_cluster_keepalive_delay_ms_store()
534 struct o2nm_cluster *cluster = to_o2nm_cluster(item); in o2nm_cluster_fence_method_show() local
537 if (cluster) in o2nm_cluster_fence_method_show()
539 o2nm_fence_method_desc[cluster->cl_fence_method]); in o2nm_cluster_fence_method_show()
606 struct o2nm_cluster *cluster = to_o2nm_cluster(group->cg_item.ci_parent); in o2nm_node_group_drop_item() local
608 if (cluster->cl_nodes[node->nd_num] == node) { in o2nm_node_group_drop_item()
611 if (cluster->cl_has_local && in o2nm_node_group_drop_item()
612 (cluster->cl_local_node == node->nd_num)) { in o2nm_node_group_drop_item()
613 cluster->cl_has_local = 0; in o2nm_node_group_drop_item()
614 cluster->cl_local_node = O2NM_INVALID_NODE_NUM; in o2nm_node_group_drop_item()
621 write_lock(&cluster->cl_nodes_lock); in o2nm_node_group_drop_item()
625 rb_erase(&node->nd_ip_node, &cluster->cl_node_ip_tree); in o2nm_node_group_drop_item()
628 if (cluster->cl_nodes[node->nd_num] == node) { in o2nm_node_group_drop_item()
629 cluster->cl_nodes[node->nd_num] = NULL; in o2nm_node_group_drop_item()
630 clear_bit(node->nd_num, cluster->cl_nodes_bitmap); in o2nm_node_group_drop_item()
632 write_unlock(&cluster->cl_nodes_lock); in o2nm_node_group_drop_item()
650 /* cluster */
654 struct o2nm_cluster *cluster = to_o2nm_cluster(item); in o2nm_cluster_release() local
656 kfree(cluster); in o2nm_cluster_release()
669 /* cluster set */
688 struct o2nm_cluster *cluster = NULL; in o2nm_cluster_group_make_group() local
697 cluster = kzalloc(sizeof(struct o2nm_cluster), GFP_KERNEL); in o2nm_cluster_group_make_group()
700 if (cluster == NULL || ns == NULL || o2hb_group == NULL) in o2nm_cluster_group_make_group()
703 config_group_init_type_name(&cluster->cl_group, name, in o2nm_cluster_group_make_group()
705 configfs_add_default_group(&ns->ns_group, &cluster->cl_group); in o2nm_cluster_group_make_group()
709 configfs_add_default_group(o2hb_group, &cluster->cl_group); in o2nm_cluster_group_make_group()
711 rwlock_init(&cluster->cl_nodes_lock); in o2nm_cluster_group_make_group()
712 cluster->cl_node_ip_tree = RB_ROOT; in o2nm_cluster_group_make_group()
713 cluster->cl_reconnect_delay_ms = O2NET_RECONNECT_DELAY_MS_DEFAULT; in o2nm_cluster_group_make_group()
714 cluster->cl_idle_timeout_ms = O2NET_IDLE_TIMEOUT_MS_DEFAULT; in o2nm_cluster_group_make_group()
715 cluster->cl_keepalive_delay_ms = O2NET_KEEPALIVE_DELAY_MS_DEFAULT; in o2nm_cluster_group_make_group()
716 cluster->cl_fence_method = O2NM_FENCE_RESET; in o2nm_cluster_group_make_group()
718 ret = &cluster->cl_group; in o2nm_cluster_group_make_group()
719 o2nm_single_cluster = cluster; in o2nm_cluster_group_make_group()
723 kfree(cluster); in o2nm_cluster_group_make_group()
734 struct o2nm_cluster *cluster = to_o2nm_cluster(item); in o2nm_cluster_group_drop_item() local
736 BUG_ON(o2nm_single_cluster != cluster); in o2nm_cluster_group_drop_item()
739 configfs_remove_default_groups(&cluster->cl_group); in o2nm_cluster_group_drop_item()
757 .ci_namebuf = "cluster",
864 MODULE_DESCRIPTION("OCFS2 cluster management");