• Home
  • Raw
  • Download

Lines Matching refs:c_ptr

47 static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
58 struct cluster *c_ptr; in tipc_cltr_create() local
61 c_ptr = kzalloc(sizeof(*c_ptr), GFP_ATOMIC); in tipc_cltr_create()
62 if (c_ptr == NULL) { in tipc_cltr_create()
67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); in tipc_cltr_create()
73 c_ptr->nodes = kcalloc(max_nodes + 1, sizeof(void*), GFP_ATOMIC); in tipc_cltr_create()
74 if (c_ptr->nodes == NULL) { in tipc_cltr_create()
76 kfree(c_ptr); in tipc_cltr_create()
81 tipc_local_nodes = c_ptr->nodes; in tipc_cltr_create()
82 c_ptr->highest_slave = LOWEST_SLAVE - 1; in tipc_cltr_create()
83 c_ptr->highest_node = 0; in tipc_cltr_create()
90 kfree(c_ptr->nodes); in tipc_cltr_create()
91 kfree(c_ptr); in tipc_cltr_create()
95 tipc_zone_attach_cluster(z_ptr, c_ptr); in tipc_cltr_create()
96 c_ptr->owner = z_ptr; in tipc_cltr_create()
97 return c_ptr; in tipc_cltr_create()
100 void tipc_cltr_delete(struct cluster *c_ptr) in tipc_cltr_delete() argument
104 if (!c_ptr) in tipc_cltr_delete()
106 for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) { in tipc_cltr_delete()
107 tipc_node_delete(c_ptr->nodes[n_num]); in tipc_cltr_delete()
109 for (n_num = LOWEST_SLAVE; n_num <= c_ptr->highest_slave; n_num++) { in tipc_cltr_delete()
110 tipc_node_delete(c_ptr->nodes[n_num]); in tipc_cltr_delete()
112 kfree(c_ptr->nodes); in tipc_cltr_delete()
113 kfree(c_ptr); in tipc_cltr_delete()
116 u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) in tipc_cltr_next_node() argument
121 if (!c_ptr) in tipc_cltr_next_node()
123 for (; n_num <= c_ptr->highest_node; n_num++) { in tipc_cltr_next_node()
124 n_ptr = c_ptr->nodes[n_num]; in tipc_cltr_next_node()
129 n_ptr = c_ptr->nodes[n_num]; in tipc_cltr_next_node()
136 void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr) in tipc_cltr_attach_node() argument
145 assert(c_ptr->nodes[n_num] == NULL); in tipc_cltr_attach_node()
146 c_ptr->nodes[n_num] = n_ptr; in tipc_cltr_attach_node()
147 if (n_num > c_ptr->highest_node) in tipc_cltr_attach_node()
148 c_ptr->highest_node = n_num; in tipc_cltr_attach_node()
157 u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) in tipc_cltr_select_router() argument
160 u32 ulim = c_ptr->highest_node; in tipc_cltr_select_router()
164 assert(!in_own_cluster(c_ptr->addr)); in tipc_cltr_select_router()
177 if (tipc_node_is_up(c_ptr->nodes[n_num])) in tipc_cltr_select_router()
183 if (tipc_node_is_up(c_ptr->nodes[n_num])) in tipc_cltr_select_router()
190 return tipc_node_select_router(c_ptr->nodes[n_num], ref); in tipc_cltr_select_router()
199 struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) in tipc_cltr_select_node() argument
205 assert(!in_own_cluster(c_ptr->addr)); in tipc_cltr_select_node()
206 if (!c_ptr->highest_node) in tipc_cltr_select_node()
210 while (mask > c_ptr->highest_node) { in tipc_cltr_select_node()
214 assert(start_entry <= c_ptr->highest_node); in tipc_cltr_select_node()
217 for (n_num = start_entry; n_num <= c_ptr->highest_node; n_num++) { in tipc_cltr_select_node()
218 if (tipc_node_has_active_links(c_ptr->nodes[n_num])) in tipc_cltr_select_node()
219 return c_ptr->nodes[n_num]; in tipc_cltr_select_node()
222 if (tipc_node_has_active_links(c_ptr->nodes[n_num])) in tipc_cltr_select_node()
223 return c_ptr->nodes[n_num]; in tipc_cltr_select_node()
246 void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, in tipc_cltr_bcast_new_route() argument
249 struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); in tipc_cltr_bcast_new_route()
256 tipc_cltr_multicast(c_ptr, buf, lower, upper); in tipc_cltr_bcast_new_route()
262 void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, in tipc_cltr_bcast_lost_route() argument
265 struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); in tipc_cltr_bcast_lost_route()
272 tipc_cltr_multicast(c_ptr, buf, lower, upper); in tipc_cltr_bcast_lost_route()
278 void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest) in tipc_cltr_send_slave_routes() argument
282 u32 highest = c_ptr->highest_slave; in tipc_cltr_send_slave_routes()
288 assert(in_own_cluster(c_ptr->addr)); in tipc_cltr_send_slave_routes()
292 c_ptr->addr); in tipc_cltr_send_slave_routes()
295 msg_set_remote_node(msg, c_ptr->addr); in tipc_cltr_send_slave_routes()
298 if (c_ptr->nodes[n_num] && in tipc_cltr_send_slave_routes()
299 tipc_node_has_active_links(c_ptr->nodes[n_num])) { in tipc_cltr_send_slave_routes()
313 void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest) in tipc_cltr_send_ext_routes() argument
317 u32 highest = c_ptr->highest_node; in tipc_cltr_send_ext_routes()
321 if (in_own_cluster(c_ptr->addr)) in tipc_cltr_send_ext_routes()
325 highest = c_ptr->highest_node; in tipc_cltr_send_ext_routes()
326 buf = tipc_cltr_prepare_routing_msg(highest + 1, c_ptr->addr); in tipc_cltr_send_ext_routes()
329 msg_set_remote_node(msg, c_ptr->addr); in tipc_cltr_send_ext_routes()
332 if (c_ptr->nodes[n_num] && in tipc_cltr_send_ext_routes()
333 tipc_node_has_active_links(c_ptr->nodes[n_num])) { in tipc_cltr_send_ext_routes()
347 void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest) in tipc_cltr_send_local_routes() argument
351 u32 highest = c_ptr->highest_node; in tipc_cltr_send_local_routes()
356 assert(in_own_cluster(c_ptr->addr)); in tipc_cltr_send_local_routes()
357 buf = tipc_cltr_prepare_routing_msg(highest, c_ptr->addr); in tipc_cltr_send_local_routes()
360 msg_set_remote_node(msg, c_ptr->addr); in tipc_cltr_send_local_routes()
363 if (c_ptr->nodes[n_num] && in tipc_cltr_send_local_routes()
364 tipc_node_has_active_links(c_ptr->nodes[n_num])) { in tipc_cltr_send_local_routes()
381 struct cluster *c_ptr; in tipc_cltr_recv_routing_table() local
391 c_ptr = tipc_cltr_find(rem_node); in tipc_cltr_recv_routing_table()
392 if (!c_ptr) { in tipc_cltr_recv_routing_table()
393 c_ptr = tipc_cltr_create(rem_node); in tipc_cltr_recv_routing_table()
394 if (!c_ptr) { in tipc_cltr_recv_routing_table()
413 n_ptr = c_ptr->nodes[n_num]; in tipc_cltr_recv_routing_table()
424 assert(in_own_cluster(c_ptr->addr)); in tipc_cltr_recv_routing_table()
429 n_ptr = c_ptr->nodes[slave_num]; in tipc_cltr_recv_routing_table()
440 assert(!in_own_cluster(c_ptr->addr) in tipc_cltr_recv_routing_table()
443 assert(in_own_cluster(c_ptr->addr) in tipc_cltr_recv_routing_table()
446 n_ptr = c_ptr->nodes[tipc_node(rem_node)]; in tipc_cltr_recv_routing_table()
454 assert(!in_own_cluster(c_ptr->addr) in tipc_cltr_recv_routing_table()
457 assert(in_own_cluster(c_ptr->addr) in tipc_cltr_recv_routing_table()
460 n_ptr = c_ptr->nodes[tipc_node(rem_node)]; in tipc_cltr_recv_routing_table()
470 void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router) in tipc_cltr_remove_as_router() argument
479 if (in_own_cluster(c_ptr->addr)) { in tipc_cltr_remove_as_router()
481 tstop = c_ptr->highest_slave; in tipc_cltr_remove_as_router()
484 tstop = c_ptr->highest_node; in tipc_cltr_remove_as_router()
488 if (c_ptr->nodes[n_num]) { in tipc_cltr_remove_as_router()
489 tipc_node_remove_router(c_ptr->nodes[n_num], router); in tipc_cltr_remove_as_router()
498 static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, in tipc_cltr_multicast() argument
511 assert(in_own_cluster(c_ptr->addr)); in tipc_cltr_multicast()
513 tstop = is_slave(upper) ? c_ptr->highest_slave : c_ptr->highest_node; in tipc_cltr_multicast()
517 n_ptr = c_ptr->nodes[n_num]; in tipc_cltr_multicast()
536 struct cluster *c_ptr; in tipc_cltr_broadcast() local
544 c_ptr = tipc_cltr_find(tipc_own_addr); in tipc_cltr_broadcast()
545 assert(in_own_cluster(c_ptr->addr)); /* For now */ in tipc_cltr_broadcast()
549 tstop = c_ptr->highest_node; in tipc_cltr_broadcast()
552 n_ptr = c_ptr->nodes[n_num]; in tipc_cltr_broadcast()
564 tstop = c_ptr->highest_slave; in tipc_cltr_broadcast()