diff options
| author | David S. Miller <davem@davemloft.net> | 2010-04-03 18:49:14 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-03 18:49:14 -0400 |
| commit | 87e8b821ed8db3dab03d96cd542e29666bf210aa (patch) | |
| tree | 0027060473aafbbb125655ba027319c8a1a665fc /net/tipc/net.c | |
| parent | 33cd9dfa3a13e3d8e41aef225a9f98169816723b (diff) | |
| parent | 5e11611a5d22252f3f9c169a3c9377eac0c32033 (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'net/tipc/net.c')
| -rw-r--r-- | net/tipc/net.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index 7906608bf510..f25b1cdb64eb 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
| @@ -116,7 +116,8 @@ | |||
| 116 | */ | 116 | */ |
| 117 | 117 | ||
| 118 | DEFINE_RWLOCK(tipc_net_lock); | 118 | DEFINE_RWLOCK(tipc_net_lock); |
| 119 | struct network tipc_net = { NULL }; | 119 | struct _zone *tipc_zones[256] = { NULL, }; |
| 120 | struct network tipc_net = { tipc_zones }; | ||
| 120 | 121 | ||
| 121 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) | 122 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) |
| 122 | { | 123 | { |
| @@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 dest) | |||
| 158 | } | 159 | } |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | static int net_init(void) | ||
| 162 | { | ||
| 163 | memset(&tipc_net, 0, sizeof(tipc_net)); | ||
| 164 | tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC); | ||
| 165 | if (!tipc_net.zones) { | ||
| 166 | return -ENOMEM; | ||
| 167 | } | ||
| 168 | return 0; | ||
| 169 | } | ||
| 170 | |||
| 171 | static void net_stop(void) | 162 | static void net_stop(void) |
| 172 | { | 163 | { |
| 173 | u32 z_num; | 164 | u32 z_num; |
| 174 | 165 | ||
| 175 | if (!tipc_net.zones) | 166 | for (z_num = 1; z_num <= tipc_max_zones; z_num++) |
| 176 | return; | ||
| 177 | |||
| 178 | for (z_num = 1; z_num <= tipc_max_zones; z_num++) { | ||
| 179 | tipc_zone_delete(tipc_net.zones[z_num]); | 167 | tipc_zone_delete(tipc_net.zones[z_num]); |
| 180 | } | ||
| 181 | kfree(tipc_net.zones); | ||
| 182 | tipc_net.zones = NULL; | ||
| 183 | } | 168 | } |
| 184 | 169 | ||
| 185 | static void net_route_named_msg(struct sk_buff *buf) | 170 | static void net_route_named_msg(struct sk_buff *buf) |
| @@ -282,9 +267,7 @@ int tipc_net_start(u32 addr) | |||
| 282 | tipc_named_reinit(); | 267 | tipc_named_reinit(); |
| 283 | tipc_port_reinit(); | 268 | tipc_port_reinit(); |
| 284 | 269 | ||
| 285 | if ((res = tipc_bearer_init()) || | 270 | if ((res = tipc_cltr_init()) || |
| 286 | (res = net_init()) || | ||
| 287 | (res = tipc_cltr_init()) || | ||
| 288 | (res = tipc_bclink_init())) { | 271 | (res = tipc_bclink_init())) { |
| 289 | return res; | 272 | return res; |
| 290 | } | 273 | } |
