diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 82c05e9dd0ee..3f7a4ed71990 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -319,62 +319,62 @@ static void tipc_node_write_unlock(struct tipc_node *n) | |||
319 | struct tipc_node *tipc_node_create(struct net *net, u32 addr, u16 capabilities) | 319 | struct tipc_node *tipc_node_create(struct net *net, u32 addr, u16 capabilities) |
320 | { | 320 | { |
321 | struct tipc_net *tn = net_generic(net, tipc_net_id); | 321 | struct tipc_net *tn = net_generic(net, tipc_net_id); |
322 | struct tipc_node *n_ptr, *temp_node; | 322 | struct tipc_node *n, *temp_node; |
323 | int i; | 323 | int i; |
324 | 324 | ||
325 | spin_lock_bh(&tn->node_list_lock); | 325 | spin_lock_bh(&tn->node_list_lock); |
326 | n_ptr = tipc_node_find(net, addr); | 326 | n = tipc_node_find(net, addr); |
327 | if (n_ptr) | 327 | if (n) |
328 | goto exit; | 328 | goto exit; |
329 | n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC); | 329 | n = kzalloc(sizeof(*n), GFP_ATOMIC); |
330 | if (!n_ptr) { | 330 | if (!n) { |
331 | pr_warn("Node creation failed, no memory\n"); | 331 | pr_warn("Node creation failed, no memory\n"); |
332 | goto exit; | 332 | goto exit; |
333 | } | 333 | } |
334 | n_ptr->addr = addr; | 334 | n->addr = addr; |
335 | n_ptr->net = net; | 335 | n->net = net; |
336 | n_ptr->capabilities = capabilities; | 336 | n->capabilities = capabilities; |
337 | kref_init(&n_ptr->kref); | 337 | kref_init(&n->kref); |
338 | rwlock_init(&n_ptr->lock); | 338 | rwlock_init(&n->lock); |
339 | INIT_HLIST_NODE(&n_ptr->hash); | 339 | INIT_HLIST_NODE(&n->hash); |
340 | INIT_LIST_HEAD(&n_ptr->list); | 340 | INIT_LIST_HEAD(&n->list); |
341 | INIT_LIST_HEAD(&n_ptr->publ_list); | 341 | INIT_LIST_HEAD(&n->publ_list); |
342 | INIT_LIST_HEAD(&n_ptr->conn_sks); | 342 | INIT_LIST_HEAD(&n->conn_sks); |
343 | skb_queue_head_init(&n_ptr->bc_entry.namedq); | 343 | skb_queue_head_init(&n->bc_entry.namedq); |
344 | skb_queue_head_init(&n_ptr->bc_entry.inputq1); | 344 | skb_queue_head_init(&n->bc_entry.inputq1); |
345 | __skb_queue_head_init(&n_ptr->bc_entry.arrvq); | 345 | __skb_queue_head_init(&n->bc_entry.arrvq); |
346 | skb_queue_head_init(&n_ptr->bc_entry.inputq2); | 346 | skb_queue_head_init(&n->bc_entry.inputq2); |
347 | for (i = 0; i < MAX_BEARERS; i++) | 347 | for (i = 0; i < MAX_BEARERS; i++) |
348 | spin_lock_init(&n_ptr->links[i].lock); | 348 | spin_lock_init(&n->links[i].lock); |
349 | hlist_add_head_rcu(&n_ptr->hash, &tn->node_htable[tipc_hashfn(addr)]); | 349 | hlist_add_head_rcu(&n->hash, &tn->node_htable[tipc_hashfn(addr)]); |
350 | list_for_each_entry_rcu(temp_node, &tn->node_list, list) { | 350 | list_for_each_entry_rcu(temp_node, &tn->node_list, list) { |
351 | if (n_ptr->addr < temp_node->addr) | 351 | if (n->addr < temp_node->addr) |
352 | break; | 352 | break; |
353 | } | 353 | } |
354 | list_add_tail_rcu(&n_ptr->list, &temp_node->list); | 354 | list_add_tail_rcu(&n->list, &temp_node->list); |
355 | n_ptr->state = SELF_DOWN_PEER_LEAVING; | 355 | n->state = SELF_DOWN_PEER_LEAVING; |
356 | n_ptr->signature = INVALID_NODE_SIG; | 356 | n->signature = INVALID_NODE_SIG; |
357 | n_ptr->active_links[0] = INVALID_BEARER_ID; | 357 | n->active_links[0] = INVALID_BEARER_ID; |
358 | n_ptr->active_links[1] = INVALID_BEARER_ID; | 358 | n->active_links[1] = INVALID_BEARER_ID; |
359 | if (!tipc_link_bc_create(net, tipc_own_addr(net), n_ptr->addr, | 359 | if (!tipc_link_bc_create(net, tipc_own_addr(net), n->addr, |
360 | U16_MAX, | 360 | U16_MAX, |
361 | tipc_link_window(tipc_bc_sndlink(net)), | 361 | tipc_link_window(tipc_bc_sndlink(net)), |
362 | n_ptr->capabilities, | 362 | n->capabilities, |
363 | &n_ptr->bc_entry.inputq1, | 363 | &n->bc_entry.inputq1, |
364 | &n_ptr->bc_entry.namedq, | 364 | &n->bc_entry.namedq, |
365 | tipc_bc_sndlink(net), | 365 | tipc_bc_sndlink(net), |
366 | &n_ptr->bc_entry.link)) { | 366 | &n->bc_entry.link)) { |
367 | pr_warn("Broadcast rcv link creation failed, no memory\n"); | 367 | pr_warn("Broadcast rcv link creation failed, no memory\n"); |
368 | kfree(n_ptr); | 368 | kfree(n); |
369 | n_ptr = NULL; | 369 | n = NULL; |
370 | goto exit; | 370 | goto exit; |
371 | } | 371 | } |
372 | tipc_node_get(n_ptr); | 372 | tipc_node_get(n); |
373 | setup_timer(&n_ptr->timer, tipc_node_timeout, (unsigned long)n_ptr); | 373 | setup_timer(&n->timer, tipc_node_timeout, (unsigned long)n); |
374 | n_ptr->keepalive_intv = U32_MAX; | 374 | n->keepalive_intv = U32_MAX; |
375 | exit: | 375 | exit: |
376 | spin_unlock_bh(&tn->node_list_lock); | 376 | spin_unlock_bh(&tn->node_list_lock); |
377 | return n_ptr; | 377 | return n; |
378 | } | 378 | } |
379 | 379 | ||
380 | static void tipc_node_calculate_timer(struct tipc_node *n, struct tipc_link *l) | 380 | static void tipc_node_calculate_timer(struct tipc_node *n, struct tipc_link *l) |