diff options
Diffstat (limited to 'net/tipc/cluster.c')
-rw-r--r-- | net/tipc/cluster.c | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c index f0f7bac51d41..ab974ca19371 100644 --- a/net/tipc/cluster.c +++ b/net/tipc/cluster.c | |||
@@ -44,15 +44,15 @@ | |||
44 | #include "msg.h" | 44 | #include "msg.h" |
45 | #include "bearer.h" | 45 | #include "bearer.h" |
46 | 46 | ||
47 | void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, | 47 | void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, |
48 | u32 lower, u32 upper); | 48 | u32 lower, u32 upper); |
49 | struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest); | 49 | struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); |
50 | 50 | ||
51 | struct node **local_nodes = 0; | 51 | struct node **tipc_local_nodes = 0; |
52 | struct node_map cluster_bcast_nodes = {0,{0,}}; | 52 | struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; |
53 | u32 highest_allowed_slave = 0; | 53 | u32 tipc_highest_allowed_slave = 0; |
54 | 54 | ||
55 | struct cluster *cluster_create(u32 addr) | 55 | struct cluster *tipc_cltr_create(u32 addr) |
56 | { | 56 | { |
57 | struct _zone *z_ptr; | 57 | struct _zone *z_ptr; |
58 | struct cluster *c_ptr; | 58 | struct cluster *c_ptr; |
@@ -77,16 +77,16 @@ struct cluster *cluster_create(u32 addr) | |||
77 | } | 77 | } |
78 | memset(c_ptr->nodes, 0, alloc); | 78 | memset(c_ptr->nodes, 0, alloc); |
79 | if (in_own_cluster(addr)) | 79 | if (in_own_cluster(addr)) |
80 | local_nodes = c_ptr->nodes; | 80 | tipc_local_nodes = c_ptr->nodes; |
81 | c_ptr->highest_slave = LOWEST_SLAVE - 1; | 81 | c_ptr->highest_slave = LOWEST_SLAVE - 1; |
82 | c_ptr->highest_node = 0; | 82 | c_ptr->highest_node = 0; |
83 | 83 | ||
84 | z_ptr = zone_find(tipc_zone(addr)); | 84 | z_ptr = tipc_zone_find(tipc_zone(addr)); |
85 | if (z_ptr == NULL) { | 85 | if (z_ptr == NULL) { |
86 | z_ptr = zone_create(addr); | 86 | z_ptr = tipc_zone_create(addr); |
87 | } | 87 | } |
88 | if (z_ptr != NULL) { | 88 | if (z_ptr != NULL) { |
89 | zone_attach_cluster(z_ptr, c_ptr); | 89 | tipc_zone_attach_cluster(z_ptr, c_ptr); |
90 | c_ptr->owner = z_ptr; | 90 | c_ptr->owner = z_ptr; |
91 | } | 91 | } |
92 | else { | 92 | else { |
@@ -97,23 +97,23 @@ struct cluster *cluster_create(u32 addr) | |||
97 | return c_ptr; | 97 | return c_ptr; |
98 | } | 98 | } |
99 | 99 | ||
100 | void cluster_delete(struct cluster *c_ptr) | 100 | void tipc_cltr_delete(struct cluster *c_ptr) |
101 | { | 101 | { |
102 | u32 n_num; | 102 | u32 n_num; |
103 | 103 | ||
104 | if (!c_ptr) | 104 | if (!c_ptr) |
105 | return; | 105 | return; |
106 | for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) { | 106 | for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) { |
107 | node_delete(c_ptr->nodes[n_num]); | 107 | tipc_node_delete(c_ptr->nodes[n_num]); |
108 | } | 108 | } |
109 | for (n_num = LOWEST_SLAVE; n_num <= c_ptr->highest_slave; n_num++) { | 109 | for (n_num = LOWEST_SLAVE; n_num <= c_ptr->highest_slave; n_num++) { |
110 | node_delete(c_ptr->nodes[n_num]); | 110 | tipc_node_delete(c_ptr->nodes[n_num]); |
111 | } | 111 | } |
112 | kfree(c_ptr->nodes); | 112 | kfree(c_ptr->nodes); |
113 | kfree(c_ptr); | 113 | kfree(c_ptr); |
114 | } | 114 | } |
115 | 115 | ||
116 | u32 cluster_next_node(struct cluster *c_ptr, u32 addr) | 116 | u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) |
117 | { | 117 | { |
118 | struct node *n_ptr; | 118 | struct node *n_ptr; |
119 | u32 n_num = tipc_node(addr) + 1; | 119 | u32 n_num = tipc_node(addr) + 1; |
@@ -122,24 +122,24 @@ u32 cluster_next_node(struct cluster *c_ptr, u32 addr) | |||
122 | return addr; | 122 | return addr; |
123 | for (; n_num <= c_ptr->highest_node; n_num++) { | 123 | for (; n_num <= c_ptr->highest_node; n_num++) { |
124 | n_ptr = c_ptr->nodes[n_num]; | 124 | n_ptr = c_ptr->nodes[n_num]; |
125 | if (n_ptr && node_has_active_links(n_ptr)) | 125 | if (n_ptr && tipc_node_has_active_links(n_ptr)) |
126 | return n_ptr->addr; | 126 | return n_ptr->addr; |
127 | } | 127 | } |
128 | for (n_num = 1; n_num < tipc_node(addr); n_num++) { | 128 | for (n_num = 1; n_num < tipc_node(addr); n_num++) { |
129 | n_ptr = c_ptr->nodes[n_num]; | 129 | n_ptr = c_ptr->nodes[n_num]; |
130 | if (n_ptr && node_has_active_links(n_ptr)) | 130 | if (n_ptr && tipc_node_has_active_links(n_ptr)) |
131 | return n_ptr->addr; | 131 | return n_ptr->addr; |
132 | } | 132 | } |
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
136 | void cluster_attach_node(struct cluster *c_ptr, struct node *n_ptr) | 136 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) |
137 | { | 137 | { |
138 | u32 n_num = tipc_node(n_ptr->addr); | 138 | u32 n_num = tipc_node(n_ptr->addr); |
139 | u32 max_n_num = tipc_max_nodes; | 139 | u32 max_n_num = tipc_max_nodes; |
140 | 140 | ||
141 | if (in_own_cluster(n_ptr->addr)) | 141 | if (in_own_cluster(n_ptr->addr)) |
142 | max_n_num = highest_allowed_slave; | 142 | max_n_num = tipc_highest_allowed_slave; |
143 | assert(n_num > 0); | 143 | assert(n_num > 0); |
144 | assert(n_num <= max_n_num); | 144 | assert(n_num <= max_n_num); |
145 | assert(c_ptr->nodes[n_num] == 0); | 145 | assert(c_ptr->nodes[n_num] == 0); |
@@ -149,12 +149,12 @@ void cluster_attach_node(struct cluster *c_ptr, struct node *n_ptr) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | /** | 151 | /** |
152 | * cluster_select_router - select router to a cluster | 152 | * tipc_cltr_select_router - select router to a cluster |
153 | * | 153 | * |
154 | * Uses deterministic and fair algorithm. | 154 | * Uses deterministic and fair algorithm. |
155 | */ | 155 | */ |
156 | 156 | ||
157 | u32 cluster_select_router(struct cluster *c_ptr, u32 ref) | 157 | u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) |
158 | { | 158 | { |
159 | u32 n_num; | 159 | u32 n_num; |
160 | u32 ulim = c_ptr->highest_node; | 160 | u32 ulim = c_ptr->highest_node; |
@@ -174,29 +174,29 @@ u32 cluster_select_router(struct cluster *c_ptr, u32 ref) | |||
174 | 174 | ||
175 | /* Lookup upwards with wrap-around */ | 175 | /* Lookup upwards with wrap-around */ |
176 | do { | 176 | do { |
177 | if (node_is_up(c_ptr->nodes[n_num])) | 177 | if (tipc_node_is_up(c_ptr->nodes[n_num])) |
178 | break; | 178 | break; |
179 | } while (++n_num <= ulim); | 179 | } while (++n_num <= ulim); |
180 | if (n_num > ulim) { | 180 | if (n_num > ulim) { |
181 | n_num = 1; | 181 | n_num = 1; |
182 | do { | 182 | do { |
183 | if (node_is_up(c_ptr->nodes[n_num])) | 183 | if (tipc_node_is_up(c_ptr->nodes[n_num])) |
184 | break; | 184 | break; |
185 | } while (++n_num < tstart); | 185 | } while (++n_num < tstart); |
186 | if (n_num == tstart) | 186 | if (n_num == tstart) |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | assert(n_num <= ulim); | 189 | assert(n_num <= ulim); |
190 | return node_select_router(c_ptr->nodes[n_num], ref); | 190 | return tipc_node_select_router(c_ptr->nodes[n_num], ref); |
191 | } | 191 | } |
192 | 192 | ||
193 | /** | 193 | /** |
194 | * cluster_select_node - select destination node within a remote cluster | 194 | * tipc_cltr_select_node - select destination node within a remote cluster |
195 | * | 195 | * |
196 | * Uses deterministic and fair algorithm. | 196 | * Uses deterministic and fair algorithm. |
197 | */ | 197 | */ |
198 | 198 | ||
199 | struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) | 199 | struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) |
200 | { | 200 | { |
201 | u32 n_num; | 201 | u32 n_num; |
202 | u32 mask = tipc_max_nodes; | 202 | u32 mask = tipc_max_nodes; |
@@ -215,11 +215,11 @@ struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) | |||
215 | 215 | ||
216 | /* Lookup upwards with wrap-around */ | 216 | /* Lookup upwards with wrap-around */ |
217 | for (n_num = start_entry; n_num <= c_ptr->highest_node; n_num++) { | 217 | for (n_num = start_entry; n_num <= c_ptr->highest_node; n_num++) { |
218 | if (node_has_active_links(c_ptr->nodes[n_num])) | 218 | if (tipc_node_has_active_links(c_ptr->nodes[n_num])) |
219 | return c_ptr->nodes[n_num]; | 219 | return c_ptr->nodes[n_num]; |
220 | } | 220 | } |
221 | for (n_num = 1; n_num < start_entry; n_num++) { | 221 | for (n_num = 1; n_num < start_entry; n_num++) { |
222 | if (node_has_active_links(c_ptr->nodes[n_num])) | 222 | if (tipc_node_has_active_links(c_ptr->nodes[n_num])) |
223 | return c_ptr->nodes[n_num]; | 223 | return c_ptr->nodes[n_num]; |
224 | } | 224 | } |
225 | return 0; | 225 | return 0; |
@@ -229,7 +229,7 @@ struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) | |||
229 | * Routing table management: See description in node.c | 229 | * Routing table management: See description in node.c |
230 | */ | 230 | */ |
231 | 231 | ||
232 | struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest) | 232 | struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest) |
233 | { | 233 | { |
234 | u32 size = INT_H_SIZE + data_size; | 234 | u32 size = INT_H_SIZE + data_size; |
235 | struct sk_buff *buf = buf_acquire(size); | 235 | struct sk_buff *buf = buf_acquire(size); |
@@ -243,39 +243,39 @@ struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest) | |||
243 | return buf; | 243 | return buf; |
244 | } | 244 | } |
245 | 245 | ||
246 | void cluster_bcast_new_route(struct cluster *c_ptr, u32 dest, | 246 | void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, |
247 | u32 lower, u32 upper) | 247 | u32 lower, u32 upper) |
248 | { | 248 | { |
249 | struct sk_buff *buf = cluster_prepare_routing_msg(0, c_ptr->addr); | 249 | struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); |
250 | struct tipc_msg *msg; | 250 | struct tipc_msg *msg; |
251 | 251 | ||
252 | if (buf) { | 252 | if (buf) { |
253 | msg = buf_msg(buf); | 253 | msg = buf_msg(buf); |
254 | msg_set_remote_node(msg, dest); | 254 | msg_set_remote_node(msg, dest); |
255 | msg_set_type(msg, ROUTE_ADDITION); | 255 | msg_set_type(msg, ROUTE_ADDITION); |
256 | cluster_multicast(c_ptr, buf, lower, upper); | 256 | tipc_cltr_multicast(c_ptr, buf, lower, upper); |
257 | } else { | 257 | } else { |
258 | warn("Memory squeeze: broadcast of new route failed\n"); | 258 | warn("Memory squeeze: broadcast of new route failed\n"); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
262 | void cluster_bcast_lost_route(struct cluster *c_ptr, u32 dest, | 262 | void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, |
263 | u32 lower, u32 upper) | 263 | u32 lower, u32 upper) |
264 | { | 264 | { |
265 | struct sk_buff *buf = cluster_prepare_routing_msg(0, c_ptr->addr); | 265 | struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); |
266 | struct tipc_msg *msg; | 266 | struct tipc_msg *msg; |
267 | 267 | ||
268 | if (buf) { | 268 | if (buf) { |
269 | msg = buf_msg(buf); | 269 | msg = buf_msg(buf); |
270 | msg_set_remote_node(msg, dest); | 270 | msg_set_remote_node(msg, dest); |
271 | msg_set_type(msg, ROUTE_REMOVAL); | 271 | msg_set_type(msg, ROUTE_REMOVAL); |
272 | cluster_multicast(c_ptr, buf, lower, upper); | 272 | tipc_cltr_multicast(c_ptr, buf, lower, upper); |
273 | } else { | 273 | } else { |
274 | warn("Memory squeeze: broadcast of lost route failed\n"); | 274 | warn("Memory squeeze: broadcast of lost route failed\n"); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) | 278 | void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest) |
279 | { | 279 | { |
280 | struct sk_buff *buf; | 280 | struct sk_buff *buf; |
281 | struct tipc_msg *msg; | 281 | struct tipc_msg *msg; |
@@ -288,21 +288,21 @@ void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) | |||
288 | assert(in_own_cluster(c_ptr->addr)); | 288 | assert(in_own_cluster(c_ptr->addr)); |
289 | if (highest <= LOWEST_SLAVE) | 289 | if (highest <= LOWEST_SLAVE) |
290 | return; | 290 | return; |
291 | buf = cluster_prepare_routing_msg(highest - LOWEST_SLAVE + 1, | 291 | buf = tipc_cltr_prepare_routing_msg(highest - LOWEST_SLAVE + 1, |
292 | c_ptr->addr); | 292 | c_ptr->addr); |
293 | if (buf) { | 293 | if (buf) { |
294 | msg = buf_msg(buf); | 294 | msg = buf_msg(buf); |
295 | msg_set_remote_node(msg, c_ptr->addr); | 295 | msg_set_remote_node(msg, c_ptr->addr); |
296 | msg_set_type(msg, SLAVE_ROUTING_TABLE); | 296 | msg_set_type(msg, SLAVE_ROUTING_TABLE); |
297 | for (n_num = LOWEST_SLAVE; n_num <= highest; n_num++) { | 297 | for (n_num = LOWEST_SLAVE; n_num <= highest; n_num++) { |
298 | if (c_ptr->nodes[n_num] && | 298 | if (c_ptr->nodes[n_num] && |
299 | node_has_active_links(c_ptr->nodes[n_num])) { | 299 | tipc_node_has_active_links(c_ptr->nodes[n_num])) { |
300 | send = 1; | 300 | send = 1; |
301 | msg_set_dataoctet(msg, n_num); | 301 | msg_set_dataoctet(msg, n_num); |
302 | } | 302 | } |
303 | } | 303 | } |
304 | if (send) | 304 | if (send) |
305 | link_send(buf, dest, dest); | 305 | tipc_link_send(buf, dest, dest); |
306 | else | 306 | else |
307 | buf_discard(buf); | 307 | buf_discard(buf); |
308 | } else { | 308 | } else { |
@@ -310,7 +310,7 @@ void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) | |||
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) | 313 | void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest) |
314 | { | 314 | { |
315 | struct sk_buff *buf; | 315 | struct sk_buff *buf; |
316 | struct tipc_msg *msg; | 316 | struct tipc_msg *msg; |
@@ -323,20 +323,20 @@ void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) | |||
323 | assert(!is_slave(dest)); | 323 | assert(!is_slave(dest)); |
324 | assert(in_own_cluster(dest)); | 324 | assert(in_own_cluster(dest)); |
325 | highest = c_ptr->highest_node; | 325 | highest = c_ptr->highest_node; |
326 | buf = cluster_prepare_routing_msg(highest + 1, c_ptr->addr); | 326 | buf = tipc_cltr_prepare_routing_msg(highest + 1, c_ptr->addr); |
327 | if (buf) { | 327 | if (buf) { |
328 | msg = buf_msg(buf); | 328 | msg = buf_msg(buf); |
329 | msg_set_remote_node(msg, c_ptr->addr); | 329 | msg_set_remote_node(msg, c_ptr->addr); |
330 | msg_set_type(msg, EXT_ROUTING_TABLE); | 330 | msg_set_type(msg, EXT_ROUTING_TABLE); |
331 | for (n_num = 1; n_num <= highest; n_num++) { | 331 | for (n_num = 1; n_num <= highest; n_num++) { |
332 | if (c_ptr->nodes[n_num] && | 332 | if (c_ptr->nodes[n_num] && |
333 | node_has_active_links(c_ptr->nodes[n_num])) { | 333 | tipc_node_has_active_links(c_ptr->nodes[n_num])) { |
334 | send = 1; | 334 | send = 1; |
335 | msg_set_dataoctet(msg, n_num); | 335 | msg_set_dataoctet(msg, n_num); |
336 | } | 336 | } |
337 | } | 337 | } |
338 | if (send) | 338 | if (send) |
339 | link_send(buf, dest, dest); | 339 | tipc_link_send(buf, dest, dest); |
340 | else | 340 | else |
341 | buf_discard(buf); | 341 | buf_discard(buf); |
342 | } else { | 342 | } else { |
@@ -344,7 +344,7 @@ void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) | |||
344 | } | 344 | } |
345 | } | 345 | } |
346 | 346 | ||
347 | void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) | 347 | void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest) |
348 | { | 348 | { |
349 | struct sk_buff *buf; | 349 | struct sk_buff *buf; |
350 | struct tipc_msg *msg; | 350 | struct tipc_msg *msg; |
@@ -354,20 +354,20 @@ void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) | |||
354 | 354 | ||
355 | assert(is_slave(dest)); | 355 | assert(is_slave(dest)); |
356 | assert(in_own_cluster(c_ptr->addr)); | 356 | assert(in_own_cluster(c_ptr->addr)); |
357 | buf = cluster_prepare_routing_msg(highest, c_ptr->addr); | 357 | buf = tipc_cltr_prepare_routing_msg(highest, c_ptr->addr); |
358 | if (buf) { | 358 | if (buf) { |
359 | msg = buf_msg(buf); | 359 | msg = buf_msg(buf); |
360 | msg_set_remote_node(msg, c_ptr->addr); | 360 | msg_set_remote_node(msg, c_ptr->addr); |
361 | msg_set_type(msg, LOCAL_ROUTING_TABLE); | 361 | msg_set_type(msg, LOCAL_ROUTING_TABLE); |
362 | for (n_num = 1; n_num <= highest; n_num++) { | 362 | for (n_num = 1; n_num <= highest; n_num++) { |
363 | if (c_ptr->nodes[n_num] && | 363 | if (c_ptr->nodes[n_num] && |
364 | node_has_active_links(c_ptr->nodes[n_num])) { | 364 | tipc_node_has_active_links(c_ptr->nodes[n_num])) { |
365 | send = 1; | 365 | send = 1; |
366 | msg_set_dataoctet(msg, n_num); | 366 | msg_set_dataoctet(msg, n_num); |
367 | } | 367 | } |
368 | } | 368 | } |
369 | if (send) | 369 | if (send) |
370 | link_send(buf, dest, dest); | 370 | tipc_link_send(buf, dest, dest); |
371 | else | 371 | else |
372 | buf_discard(buf); | 372 | buf_discard(buf); |
373 | } else { | 373 | } else { |
@@ -375,7 +375,7 @@ void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) | |||
375 | } | 375 | } |
376 | } | 376 | } |
377 | 377 | ||
378 | void cluster_recv_routing_table(struct sk_buff *buf) | 378 | void tipc_cltr_recv_routing_table(struct sk_buff *buf) |
379 | { | 379 | { |
380 | struct tipc_msg *msg = buf_msg(buf); | 380 | struct tipc_msg *msg = buf_msg(buf); |
381 | struct cluster *c_ptr; | 381 | struct cluster *c_ptr; |
@@ -388,9 +388,9 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
388 | u32 c_num; | 388 | u32 c_num; |
389 | u32 n_num; | 389 | u32 n_num; |
390 | 390 | ||
391 | c_ptr = cluster_find(rem_node); | 391 | c_ptr = tipc_cltr_find(rem_node); |
392 | if (!c_ptr) { | 392 | if (!c_ptr) { |
393 | c_ptr = cluster_create(rem_node); | 393 | c_ptr = tipc_cltr_create(rem_node); |
394 | if (!c_ptr) { | 394 | if (!c_ptr) { |
395 | buf_discard(buf); | 395 | buf_discard(buf); |
396 | return; | 396 | return; |
@@ -412,10 +412,10 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
412 | u32 addr = tipc_addr(z_num, c_num, n_num); | 412 | u32 addr = tipc_addr(z_num, c_num, n_num); |
413 | n_ptr = c_ptr->nodes[n_num]; | 413 | n_ptr = c_ptr->nodes[n_num]; |
414 | if (!n_ptr) { | 414 | if (!n_ptr) { |
415 | n_ptr = node_create(addr); | 415 | n_ptr = tipc_node_create(addr); |
416 | } | 416 | } |
417 | if (n_ptr) | 417 | if (n_ptr) |
418 | node_add_router(n_ptr, router); | 418 | tipc_node_add_router(n_ptr, router); |
419 | } | 419 | } |
420 | } | 420 | } |
421 | break; | 421 | break; |
@@ -428,10 +428,10 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
428 | u32 addr = tipc_addr(z_num, c_num, slave_num); | 428 | u32 addr = tipc_addr(z_num, c_num, slave_num); |
429 | n_ptr = c_ptr->nodes[slave_num]; | 429 | n_ptr = c_ptr->nodes[slave_num]; |
430 | if (!n_ptr) { | 430 | if (!n_ptr) { |
431 | n_ptr = node_create(addr); | 431 | n_ptr = tipc_node_create(addr); |
432 | } | 432 | } |
433 | if (n_ptr) | 433 | if (n_ptr) |
434 | node_add_router(n_ptr, router); | 434 | tipc_node_add_router(n_ptr, router); |
435 | } | 435 | } |
436 | } | 436 | } |
437 | break; | 437 | break; |
@@ -445,9 +445,9 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
445 | } | 445 | } |
446 | n_ptr = c_ptr->nodes[tipc_node(rem_node)]; | 446 | n_ptr = c_ptr->nodes[tipc_node(rem_node)]; |
447 | if (!n_ptr) | 447 | if (!n_ptr) |
448 | n_ptr = node_create(rem_node); | 448 | n_ptr = tipc_node_create(rem_node); |
449 | if (n_ptr) | 449 | if (n_ptr) |
450 | node_add_router(n_ptr, router); | 450 | tipc_node_add_router(n_ptr, router); |
451 | break; | 451 | break; |
452 | case ROUTE_REMOVAL: | 452 | case ROUTE_REMOVAL: |
453 | if (!is_slave(tipc_own_addr)) { | 453 | if (!is_slave(tipc_own_addr)) { |
@@ -459,7 +459,7 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
459 | } | 459 | } |
460 | n_ptr = c_ptr->nodes[tipc_node(rem_node)]; | 460 | n_ptr = c_ptr->nodes[tipc_node(rem_node)]; |
461 | if (n_ptr) | 461 | if (n_ptr) |
462 | node_remove_router(n_ptr, router); | 462 | tipc_node_remove_router(n_ptr, router); |
463 | break; | 463 | break; |
464 | default: | 464 | default: |
465 | assert(!"Illegal routing manager message received\n"); | 465 | assert(!"Illegal routing manager message received\n"); |
@@ -467,7 +467,7 @@ void cluster_recv_routing_table(struct sk_buff *buf) | |||
467 | buf_discard(buf); | 467 | buf_discard(buf); |
468 | } | 468 | } |
469 | 469 | ||
470 | void cluster_remove_as_router(struct cluster *c_ptr, u32 router) | 470 | void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router) |
471 | { | 471 | { |
472 | u32 start_entry; | 472 | u32 start_entry; |
473 | u32 tstop; | 473 | u32 tstop; |
@@ -486,17 +486,17 @@ void cluster_remove_as_router(struct cluster *c_ptr, u32 router) | |||
486 | 486 | ||
487 | for (n_num = start_entry; n_num <= tstop; n_num++) { | 487 | for (n_num = start_entry; n_num <= tstop; n_num++) { |
488 | if (c_ptr->nodes[n_num]) { | 488 | if (c_ptr->nodes[n_num]) { |
489 | node_remove_router(c_ptr->nodes[n_num], router); | 489 | tipc_node_remove_router(c_ptr->nodes[n_num], router); |
490 | } | 490 | } |
491 | } | 491 | } |
492 | } | 492 | } |
493 | 493 | ||
494 | /** | 494 | /** |
495 | * cluster_multicast - multicast message to local nodes | 495 | * tipc_cltr_multicast - multicast message to local nodes |
496 | */ | 496 | */ |
497 | 497 | ||
498 | void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, | 498 | void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, |
499 | u32 lower, u32 upper) | 499 | u32 lower, u32 upper) |
500 | { | 500 | { |
501 | struct sk_buff *buf_copy; | 501 | struct sk_buff *buf_copy; |
502 | struct node *n_ptr; | 502 | struct node *n_ptr; |
@@ -505,9 +505,9 @@ void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
505 | 505 | ||
506 | assert(lower <= upper); | 506 | assert(lower <= upper); |
507 | assert(((lower >= 1) && (lower <= tipc_max_nodes)) || | 507 | assert(((lower >= 1) && (lower <= tipc_max_nodes)) || |
508 | ((lower >= LOWEST_SLAVE) && (lower <= highest_allowed_slave))); | 508 | ((lower >= LOWEST_SLAVE) && (lower <= tipc_highest_allowed_slave))); |
509 | assert(((upper >= 1) && (upper <= tipc_max_nodes)) || | 509 | assert(((upper >= 1) && (upper <= tipc_max_nodes)) || |
510 | ((upper >= LOWEST_SLAVE) && (upper <= highest_allowed_slave))); | 510 | ((upper >= LOWEST_SLAVE) && (upper <= tipc_highest_allowed_slave))); |
511 | assert(in_own_cluster(c_ptr->addr)); | 511 | assert(in_own_cluster(c_ptr->addr)); |
512 | 512 | ||
513 | tstop = is_slave(upper) ? c_ptr->highest_slave : c_ptr->highest_node; | 513 | tstop = is_slave(upper) ? c_ptr->highest_slave : c_ptr->highest_node; |
@@ -515,22 +515,22 @@ void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
515 | tstop = upper; | 515 | tstop = upper; |
516 | for (n_num = lower; n_num <= tstop; n_num++) { | 516 | for (n_num = lower; n_num <= tstop; n_num++) { |
517 | n_ptr = c_ptr->nodes[n_num]; | 517 | n_ptr = c_ptr->nodes[n_num]; |
518 | if (n_ptr && node_has_active_links(n_ptr)) { | 518 | if (n_ptr && tipc_node_has_active_links(n_ptr)) { |
519 | buf_copy = skb_copy(buf, GFP_ATOMIC); | 519 | buf_copy = skb_copy(buf, GFP_ATOMIC); |
520 | if (buf_copy == NULL) | 520 | if (buf_copy == NULL) |
521 | break; | 521 | break; |
522 | msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); | 522 | msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); |
523 | link_send(buf_copy, n_ptr->addr, n_ptr->addr); | 523 | tipc_link_send(buf_copy, n_ptr->addr, n_ptr->addr); |
524 | } | 524 | } |
525 | } | 525 | } |
526 | buf_discard(buf); | 526 | buf_discard(buf); |
527 | } | 527 | } |
528 | 528 | ||
529 | /** | 529 | /** |
530 | * cluster_broadcast - broadcast message to all nodes within cluster | 530 | * tipc_cltr_broadcast - broadcast message to all nodes within cluster |
531 | */ | 531 | */ |
532 | 532 | ||
533 | void cluster_broadcast(struct sk_buff *buf) | 533 | void tipc_cltr_broadcast(struct sk_buff *buf) |
534 | { | 534 | { |
535 | struct sk_buff *buf_copy; | 535 | struct sk_buff *buf_copy; |
536 | struct cluster *c_ptr; | 536 | struct cluster *c_ptr; |
@@ -541,7 +541,7 @@ void cluster_broadcast(struct sk_buff *buf) | |||
541 | u32 node_type; | 541 | u32 node_type; |
542 | 542 | ||
543 | if (tipc_mode == TIPC_NET_MODE) { | 543 | if (tipc_mode == TIPC_NET_MODE) { |
544 | c_ptr = cluster_find(tipc_own_addr); | 544 | c_ptr = tipc_cltr_find(tipc_own_addr); |
545 | assert(in_own_cluster(c_ptr->addr)); /* For now */ | 545 | assert(in_own_cluster(c_ptr->addr)); /* For now */ |
546 | 546 | ||
547 | /* Send to standard nodes, then repeat loop sending to slaves */ | 547 | /* Send to standard nodes, then repeat loop sending to slaves */ |
@@ -550,14 +550,14 @@ void cluster_broadcast(struct sk_buff *buf) | |||
550 | for (node_type = 1; node_type <= 2; node_type++) { | 550 | for (node_type = 1; node_type <= 2; node_type++) { |
551 | for (n_num = tstart; n_num <= tstop; n_num++) { | 551 | for (n_num = tstart; n_num <= tstop; n_num++) { |
552 | n_ptr = c_ptr->nodes[n_num]; | 552 | n_ptr = c_ptr->nodes[n_num]; |
553 | if (n_ptr && node_has_active_links(n_ptr)) { | 553 | if (n_ptr && tipc_node_has_active_links(n_ptr)) { |
554 | buf_copy = skb_copy(buf, GFP_ATOMIC); | 554 | buf_copy = skb_copy(buf, GFP_ATOMIC); |
555 | if (buf_copy == NULL) | 555 | if (buf_copy == NULL) |
556 | goto exit; | 556 | goto exit; |
557 | msg_set_destnode(buf_msg(buf_copy), | 557 | msg_set_destnode(buf_msg(buf_copy), |
558 | n_ptr->addr); | 558 | n_ptr->addr); |
559 | link_send(buf_copy, n_ptr->addr, | 559 | tipc_link_send(buf_copy, n_ptr->addr, |
560 | n_ptr->addr); | 560 | n_ptr->addr); |
561 | } | 561 | } |
562 | } | 562 | } |
563 | tstart = LOWEST_SLAVE; | 563 | tstart = LOWEST_SLAVE; |
@@ -568,9 +568,9 @@ exit: | |||
568 | buf_discard(buf); | 568 | buf_discard(buf); |
569 | } | 569 | } |
570 | 570 | ||
571 | int cluster_init(void) | 571 | int tipc_cltr_init(void) |
572 | { | 572 | { |
573 | highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves; | 573 | tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves; |
574 | return cluster_create(tipc_own_addr) ? TIPC_OK : -ENOMEM; | 574 | return tipc_cltr_create(tipc_own_addr) ? TIPC_OK : -ENOMEM; |
575 | } | 575 | } |
576 | 576 | ||