aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/name_distr.c
diff options
context:
space:
mode:
authorPer Liden <per.liden@ericsson.com>2006-01-17 18:38:21 -0500
committerPer Liden <per.liden@ericsson.com>2006-01-17 18:45:16 -0500
commit4323add67792ced172d0d93b8b2e6187023115f1 (patch)
tree13224010f6f18029fb710a1e0b48392aea90b486 /net/tipc/name_distr.c
parent1e63e681e06d438fdc542d40924a4f155d461bbd (diff)
[TIPC] Avoid polluting the global namespace
This patch adds a tipc_ prefix to all externally visible symbols. Signed-off-by: Per Liden <per.liden@ericsson.com>
Diffstat (limited to 'net/tipc/name_distr.c')
-rw-r--r--net/tipc/name_distr.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 41cbaf1a4a73..830f90999041 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -114,10 +114,10 @@ static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
114} 114}
115 115
116/** 116/**
117 * named_publish - tell other nodes about a new publication by this node 117 * tipc_named_publish - tell other nodes about a new publication by this node
118 */ 118 */
119 119
120void named_publish(struct publication *publ) 120void tipc_named_publish(struct publication *publ)
121{ 121{
122 struct sk_buff *buf; 122 struct sk_buff *buf;
123 struct distr_item *item; 123 struct distr_item *item;
@@ -133,15 +133,15 @@ void named_publish(struct publication *publ)
133 133
134 item = (struct distr_item *)msg_data(buf_msg(buf)); 134 item = (struct distr_item *)msg_data(buf_msg(buf));
135 publ_to_item(item, publ); 135 publ_to_item(item, publ);
136 dbg("named_withdraw: broadcasting publish msg\n"); 136 dbg("tipc_named_withdraw: broadcasting publish msg\n");
137 cluster_broadcast(buf); 137 tipc_cltr_broadcast(buf);
138} 138}
139 139
140/** 140/**
141 * named_withdraw - tell other nodes about a withdrawn publication by this node 141 * tipc_named_withdraw - tell other nodes about a withdrawn publication by this node
142 */ 142 */
143 143
144void named_withdraw(struct publication *publ) 144void tipc_named_withdraw(struct publication *publ)
145{ 145{
146 struct sk_buff *buf; 146 struct sk_buff *buf;
147 struct distr_item *item; 147 struct distr_item *item;
@@ -157,15 +157,15 @@ void named_withdraw(struct publication *publ)
157 157
158 item = (struct distr_item *)msg_data(buf_msg(buf)); 158 item = (struct distr_item *)msg_data(buf_msg(buf));
159 publ_to_item(item, publ); 159 publ_to_item(item, publ);
160 dbg("named_withdraw: broadcasting withdraw msg\n"); 160 dbg("tipc_named_withdraw: broadcasting withdraw msg\n");
161 cluster_broadcast(buf); 161 tipc_cltr_broadcast(buf);
162} 162}
163 163
164/** 164/**
165 * named_node_up - tell specified node about all publications by this node 165 * tipc_named_node_up - tell specified node about all publications by this node
166 */ 166 */
167 167
168void named_node_up(unsigned long node) 168void tipc_named_node_up(unsigned long node)
169{ 169{
170 struct publication *publ; 170 struct publication *publ;
171 struct distr_item *item = 0; 171 struct distr_item *item = 0;
@@ -175,7 +175,7 @@ void named_node_up(unsigned long node)
175 u32 max_item_buf; 175 u32 max_item_buf;
176 176
177 assert(in_own_cluster(node)); 177 assert(in_own_cluster(node));
178 read_lock_bh(&nametbl_lock); 178 read_lock_bh(&tipc_nametbl_lock);
179 max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE; 179 max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
180 max_item_buf *= ITEM_SIZE; 180 max_item_buf *= ITEM_SIZE;
181 rest = publ_cnt * ITEM_SIZE; 181 rest = publ_cnt * ITEM_SIZE;
@@ -196,15 +196,15 @@ void named_node_up(unsigned long node)
196 left -= ITEM_SIZE; 196 left -= ITEM_SIZE;
197 if (!left) { 197 if (!left) {
198 msg_set_link_selector(buf_msg(buf), node); 198 msg_set_link_selector(buf_msg(buf), node);
199 dbg("named_node_up: sending publish msg to " 199 dbg("tipc_named_node_up: sending publish msg to "
200 "<%u.%u.%u>\n", tipc_zone(node), 200 "<%u.%u.%u>\n", tipc_zone(node),
201 tipc_cluster(node), tipc_node(node)); 201 tipc_cluster(node), tipc_node(node));
202 link_send(buf, node, node); 202 tipc_link_send(buf, node, node);
203 buf = 0; 203 buf = 0;
204 } 204 }
205 } 205 }
206exit: 206exit:
207 read_unlock_bh(&nametbl_lock); 207 read_unlock_bh(&tipc_nametbl_lock);
208} 208}
209 209
210/** 210/**
@@ -221,73 +221,73 @@ exit:
221static void node_is_down(struct publication *publ) 221static void node_is_down(struct publication *publ)
222{ 222{
223 struct publication *p; 223 struct publication *p;
224 write_lock_bh(&nametbl_lock); 224 write_lock_bh(&tipc_nametbl_lock);
225 dbg("node_is_down: withdrawing %u, %u, %u\n", 225 dbg("node_is_down: withdrawing %u, %u, %u\n",
226 publ->type, publ->lower, publ->upper); 226 publ->type, publ->lower, publ->upper);
227 publ->key += 1222345; 227 publ->key += 1222345;
228 p = nametbl_remove_publ(publ->type, publ->lower, 228 p = tipc_nametbl_remove_publ(publ->type, publ->lower,
229 publ->node, publ->ref, publ->key); 229 publ->node, publ->ref, publ->key);
230 assert(p == publ); 230 assert(p == publ);
231 write_unlock_bh(&nametbl_lock); 231 write_unlock_bh(&tipc_nametbl_lock);
232 if (publ) 232 if (publ)
233 kfree(publ); 233 kfree(publ);
234} 234}
235 235
236/** 236/**
237 * named_recv - process name table update message sent by another node 237 * tipc_named_recv - process name table update message sent by another node
238 */ 238 */
239 239
240void named_recv(struct sk_buff *buf) 240void tipc_named_recv(struct sk_buff *buf)
241{ 241{
242 struct publication *publ; 242 struct publication *publ;
243 struct tipc_msg *msg = buf_msg(buf); 243 struct tipc_msg *msg = buf_msg(buf);
244 struct distr_item *item = (struct distr_item *)msg_data(msg); 244 struct distr_item *item = (struct distr_item *)msg_data(msg);
245 u32 count = msg_data_sz(msg) / ITEM_SIZE; 245 u32 count = msg_data_sz(msg) / ITEM_SIZE;
246 246
247 write_lock_bh(&nametbl_lock); 247 write_lock_bh(&tipc_nametbl_lock);
248 while (count--) { 248 while (count--) {
249 if (msg_type(msg) == PUBLICATION) { 249 if (msg_type(msg) == PUBLICATION) {
250 dbg("named_recv: got publication for %u, %u, %u\n", 250 dbg("tipc_named_recv: got publication for %u, %u, %u\n",
251 ntohl(item->type), ntohl(item->lower), 251 ntohl(item->type), ntohl(item->lower),
252 ntohl(item->upper)); 252 ntohl(item->upper));
253 publ = nametbl_insert_publ(ntohl(item->type), 253 publ = tipc_nametbl_insert_publ(ntohl(item->type),
254 ntohl(item->lower), 254 ntohl(item->lower),
255 ntohl(item->upper), 255 ntohl(item->upper),
256 TIPC_CLUSTER_SCOPE, 256 TIPC_CLUSTER_SCOPE,
257 msg_orignode(msg), 257 msg_orignode(msg),
258 ntohl(item->ref), 258 ntohl(item->ref),
259 ntohl(item->key)); 259 ntohl(item->key));
260 if (publ) { 260 if (publ) {
261 nodesub_subscribe(&publ->subscr, 261 tipc_nodesub_subscribe(&publ->subscr,
262 msg_orignode(msg), 262 msg_orignode(msg),
263 publ, 263 publ,
264 (net_ev_handler)node_is_down); 264 (net_ev_handler)node_is_down);
265 } 265 }
266 } else if (msg_type(msg) == WITHDRAWAL) { 266 } else if (msg_type(msg) == WITHDRAWAL) {
267 dbg("named_recv: got withdrawl for %u, %u, %u\n", 267 dbg("tipc_named_recv: got withdrawl for %u, %u, %u\n",
268 ntohl(item->type), ntohl(item->lower), 268 ntohl(item->type), ntohl(item->lower),
269 ntohl(item->upper)); 269 ntohl(item->upper));
270 publ = nametbl_remove_publ(ntohl(item->type), 270 publ = tipc_nametbl_remove_publ(ntohl(item->type),
271 ntohl(item->lower), 271 ntohl(item->lower),
272 msg_orignode(msg), 272 msg_orignode(msg),
273 ntohl(item->ref), 273 ntohl(item->ref),
274 ntohl(item->key)); 274 ntohl(item->key));
275 275
276 if (publ) { 276 if (publ) {
277 nodesub_unsubscribe(&publ->subscr); 277 tipc_nodesub_unsubscribe(&publ->subscr);
278 kfree(publ); 278 kfree(publ);
279 } 279 }
280 } else { 280 } else {
281 warn("named_recv: unknown msg\n"); 281 warn("tipc_named_recv: unknown msg\n");
282 } 282 }
283 item++; 283 item++;
284 } 284 }
285 write_unlock_bh(&nametbl_lock); 285 write_unlock_bh(&tipc_nametbl_lock);
286 buf_discard(buf); 286 buf_discard(buf);
287} 287}
288 288
289/** 289/**
290 * named_reinit - re-initialize local publication list 290 * tipc_named_reinit - re-initialize local publication list
291 * 291 *
292 * This routine is called whenever TIPC networking is (re)enabled. 292 * This routine is called whenever TIPC networking is (re)enabled.
293 * All existing publications by this node that have "cluster" or "zone" scope 293 * All existing publications by this node that have "cluster" or "zone" scope
@@ -295,15 +295,15 @@ void named_recv(struct sk_buff *buf)
295 * (If the node's address is unchanged, the update loop terminates immediately.) 295 * (If the node's address is unchanged, the update loop terminates immediately.)
296 */ 296 */
297 297
298void named_reinit(void) 298void tipc_named_reinit(void)
299{ 299{
300 struct publication *publ; 300 struct publication *publ;
301 301
302 write_lock_bh(&nametbl_lock); 302 write_lock_bh(&tipc_nametbl_lock);
303 list_for_each_entry(publ, &publ_root, local_list) { 303 list_for_each_entry(publ, &publ_root, local_list) {
304 if (publ->node == tipc_own_addr) 304 if (publ->node == tipc_own_addr)
305 break; 305 break;
306 publ->node = tipc_own_addr; 306 publ->node = tipc_own_addr;
307 } 307 }
308 write_unlock_bh(&nametbl_lock); 308 write_unlock_bh(&tipc_nametbl_lock);
309} 309}