Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279100
b: refs/heads/master
c: c47e9b9
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Dec 27, 2011
1 parent e8be419 commit da09e89
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 945af1c39df00a1e5873e38145432ba752ec49a0
refs/heads/master: c47e9b918844ab7bb139eada7b085c576ddf0afb
37 changes: 11 additions & 26 deletions trunk/net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ struct bclink {
struct tipc_node *retransmit_to;
};

static struct bcbearer bcast_bearer;
static struct bclink bcast_link;

static struct bcbearer *bcbearer = &bcast_bearer;
static struct bclink *bclink = &bcast_link;
static struct link *bcl = &bcast_link.link;

static struct bcbearer *bcbearer;
static struct bclink *bclink;
static struct link *bcl;
static DEFINE_SPINLOCK(bc_lock);

/* broadcast-capable node map */
Expand Down Expand Up @@ -752,25 +755,13 @@ int tipc_bclink_set_queue_limits(u32 limit)
return 0;
}

int tipc_bclink_init(void)
void tipc_bclink_init(void)
{
bcbearer = kzalloc(sizeof(*bcbearer), GFP_ATOMIC);
bclink = kzalloc(sizeof(*bclink), GFP_ATOMIC);
if (!bcbearer || !bclink) {
warn("Broadcast link creation failed, no memory\n");
kfree(bcbearer);
bcbearer = NULL;
kfree(bclink);
bclink = NULL;
return -ENOMEM;
}

INIT_LIST_HEAD(&bcbearer->bearer.cong_links);
bcbearer->bearer.media = &bcbearer->media;
bcbearer->media.send_msg = tipc_bcbearer_send;
sprintf(bcbearer->media.name, "tipc-broadcast");

bcl = &bclink->link;
INIT_LIST_HEAD(&bcl->waiting_ports);
bcl->next_out_no = 1;
spin_lock_init(&bclink->node.lock);
Expand All @@ -780,22 +771,16 @@ int tipc_bclink_init(void)
bcl->b_ptr = &bcbearer->bearer;
bcl->state = WORKING_WORKING;
strlcpy(bcl->name, tipc_bclink_name, TIPC_MAX_LINK_NAME);

return 0;
}

void tipc_bclink_stop(void)
{
spin_lock_bh(&bc_lock);
if (bcbearer) {
tipc_link_stop(bcl);
bcl = NULL;
kfree(bclink);
bclink = NULL;
kfree(bcbearer);
bcbearer = NULL;
}
tipc_link_stop(bcl);
spin_unlock_bh(&bc_lock);

memset(bclink, 0, sizeof(*bclink));
memset(bcbearer, 0, sizeof(*bcbearer));
}


Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/bcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m
void tipc_port_list_add(struct port_list *pl_ptr, u32 port);
void tipc_port_list_free(struct port_list *pl_ptr);

int tipc_bclink_init(void);
void tipc_bclink_init(void);
void tipc_bclink_stop(void);
struct tipc_node *tipc_bclink_retransmit_to(void);
void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
Expand Down
5 changes: 1 addition & 4 deletions trunk/net/tipc/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ void tipc_net_route_msg(struct sk_buff *buf)
int tipc_net_start(u32 addr)
{
char addr_string[16];
int res;

if (tipc_mode != TIPC_NODE_MODE)
return -ENOPROTOOPT;
Expand All @@ -187,9 +186,7 @@ int tipc_net_start(u32 addr)
tipc_named_reinit();
tipc_port_reinit();

res = tipc_bclink_init();
if (res)
return res;
tipc_bclink_init();

tipc_k_signal((Handler)tipc_subscr_start, 0);
tipc_k_signal((Handler)tipc_cfg_init, 0);
Expand Down

0 comments on commit da09e89

Please sign in to comment.