aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/subscr.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/subscr.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/subscr.c')
-rw-r--r--net/tipc/subscr.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 80e219ba527d..5ff38b9f3194 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -118,14 +118,14 @@ static void subscr_send_event(struct subscription *sub,
118} 118}
119 119
120/** 120/**
121 * subscr_overlap - test for subscription overlap with the given values 121 * tipc_subscr_overlap - test for subscription overlap with the given values
122 * 122 *
123 * Returns 1 if there is overlap, otherwise 0. 123 * Returns 1 if there is overlap, otherwise 0.
124 */ 124 */
125 125
126int subscr_overlap(struct subscription *sub, 126int tipc_subscr_overlap(struct subscription *sub,
127 u32 found_lower, 127 u32 found_lower,
128 u32 found_upper) 128 u32 found_upper)
129 129
130{ 130{
131 if (found_lower < sub->seq.lower) 131 if (found_lower < sub->seq.lower)
@@ -138,22 +138,22 @@ int subscr_overlap(struct subscription *sub,
138} 138}
139 139
140/** 140/**
141 * subscr_report_overlap - issue event if there is subscription overlap 141 * tipc_subscr_report_overlap - issue event if there is subscription overlap
142 * 142 *
143 * Protected by nameseq.lock in name_table.c 143 * Protected by nameseq.lock in name_table.c
144 */ 144 */
145 145
146void subscr_report_overlap(struct subscription *sub, 146void tipc_subscr_report_overlap(struct subscription *sub,
147 u32 found_lower, 147 u32 found_lower,
148 u32 found_upper, 148 u32 found_upper,
149 u32 event, 149 u32 event,
150 u32 port_ref, 150 u32 port_ref,
151 u32 node, 151 u32 node,
152 int must) 152 int must)
153{ 153{
154 dbg("Rep overlap %u:%u,%u<->%u,%u\n", sub->seq.type, sub->seq.lower, 154 dbg("Rep overlap %u:%u,%u<->%u,%u\n", sub->seq.type, sub->seq.lower,
155 sub->seq.upper, found_lower, found_upper); 155 sub->seq.upper, found_lower, found_upper);
156 if (!subscr_overlap(sub, found_lower, found_upper)) 156 if (!tipc_subscr_overlap(sub, found_lower, found_upper))
157 return; 157 return;
158 if (!must && (sub->filter != TIPC_SUB_PORTS)) 158 if (!must && (sub->filter != TIPC_SUB_PORTS))
159 return; 159 return;
@@ -172,13 +172,13 @@ static void subscr_timeout(struct subscription *sub)
172 /* Validate subscriber reference (in case subscriber is terminating) */ 172 /* Validate subscriber reference (in case subscriber is terminating) */
173 173
174 subscriber_ref = sub->owner->ref; 174 subscriber_ref = sub->owner->ref;
175 subscriber = (struct subscriber *)ref_lock(subscriber_ref); 175 subscriber = (struct subscriber *)tipc_ref_lock(subscriber_ref);
176 if (subscriber == NULL) 176 if (subscriber == NULL)
177 return; 177 return;
178 178
179 /* Unlink subscription from name table */ 179 /* Unlink subscription from name table */
180 180
181 nametbl_unsubscribe(sub); 181 tipc_nametbl_unsubscribe(sub);
182 182
183 /* Notify subscriber of timeout, then unlink subscription */ 183 /* Notify subscriber of timeout, then unlink subscription */
184 184
@@ -192,7 +192,7 @@ static void subscr_timeout(struct subscription *sub)
192 192
193 /* Now destroy subscription */ 193 /* Now destroy subscription */
194 194
195 ref_unlock(subscriber_ref); 195 tipc_ref_unlock(subscriber_ref);
196 k_term_timer(&sub->timer); 196 k_term_timer(&sub->timer);
197 kfree(sub); 197 kfree(sub);
198 atomic_dec(&topsrv.subscription_count); 198 atomic_dec(&topsrv.subscription_count);
@@ -216,7 +216,7 @@ static void subscr_terminate(struct subscriber *subscriber)
216 216
217 /* Invalidate subscriber reference */ 217 /* Invalidate subscriber reference */
218 218
219 ref_discard(subscriber->ref); 219 tipc_ref_discard(subscriber->ref);
220 spin_unlock_bh(subscriber->lock); 220 spin_unlock_bh(subscriber->lock);
221 221
222 /* Destroy any existing subscriptions for subscriber */ 222 /* Destroy any existing subscriptions for subscriber */
@@ -227,7 +227,7 @@ static void subscr_terminate(struct subscriber *subscriber)
227 k_cancel_timer(&sub->timer); 227 k_cancel_timer(&sub->timer);
228 k_term_timer(&sub->timer); 228 k_term_timer(&sub->timer);
229 } 229 }
230 nametbl_unsubscribe(sub); 230 tipc_nametbl_unsubscribe(sub);
231 list_del(&sub->subscription_list); 231 list_del(&sub->subscription_list);
232 dbg("Term: Removed sub %u,%u,%u from subscriber %x list\n", 232 dbg("Term: Removed sub %u,%u,%u from subscriber %x list\n",
233 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber); 233 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
@@ -315,7 +315,7 @@ static void subscr_subscribe(struct tipc_subscr *s,
315 k_start_timer(&sub->timer, sub->timeout); 315 k_start_timer(&sub->timer, sub->timeout);
316 } 316 }
317 sub->owner = subscriber; 317 sub->owner = subscriber;
318 nametbl_subscribe(sub); 318 tipc_nametbl_subscribe(sub);
319} 319}
320 320
321/** 321/**
@@ -332,7 +332,7 @@ static void subscr_conn_shutdown_event(void *usr_handle,
332 struct subscriber *subscriber; 332 struct subscriber *subscriber;
333 spinlock_t *subscriber_lock; 333 spinlock_t *subscriber_lock;
334 334
335 subscriber = ref_lock((u32)(unsigned long)usr_handle); 335 subscriber = tipc_ref_lock((u32)(unsigned long)usr_handle);
336 if (subscriber == NULL) 336 if (subscriber == NULL)
337 return; 337 return;
338 338
@@ -354,7 +354,7 @@ static void subscr_conn_msg_event(void *usr_handle,
354 struct subscriber *subscriber; 354 struct subscriber *subscriber;
355 spinlock_t *subscriber_lock; 355 spinlock_t *subscriber_lock;
356 356
357 subscriber = ref_lock((u32)(unsigned long)usr_handle); 357 subscriber = tipc_ref_lock((u32)(unsigned long)usr_handle);
358 if (subscriber == NULL) 358 if (subscriber == NULL)
359 return; 359 return;
360 360
@@ -401,7 +401,7 @@ static void subscr_named_msg_event(void *usr_handle,
401 memset(subscriber, 0, sizeof(struct subscriber)); 401 memset(subscriber, 0, sizeof(struct subscriber));
402 INIT_LIST_HEAD(&subscriber->subscription_list); 402 INIT_LIST_HEAD(&subscriber->subscription_list);
403 INIT_LIST_HEAD(&subscriber->subscriber_list); 403 INIT_LIST_HEAD(&subscriber->subscriber_list);
404 subscriber->ref = ref_acquire(subscriber, &subscriber->lock); 404 subscriber->ref = tipc_ref_acquire(subscriber, &subscriber->lock);
405 if (subscriber->ref == 0) { 405 if (subscriber->ref == 0) {
406 warn("Failed to acquire subscriber reference\n"); 406 warn("Failed to acquire subscriber reference\n");
407 kfree(subscriber); 407 kfree(subscriber);
@@ -423,7 +423,7 @@ static void subscr_named_msg_event(void *usr_handle,
423 &subscriber->port_ref); 423 &subscriber->port_ref);
424 if (subscriber->port_ref == 0) { 424 if (subscriber->port_ref == 0) {
425 warn("Memory squeeze; failed to create subscription port\n"); 425 warn("Memory squeeze; failed to create subscription port\n");
426 ref_discard(subscriber->ref); 426 tipc_ref_discard(subscriber->ref);
427 kfree(subscriber); 427 kfree(subscriber);
428 return; 428 return;
429 } 429 }
@@ -432,7 +432,7 @@ static void subscr_named_msg_event(void *usr_handle,
432 432
433 /* Add subscriber to topology server's subscriber list */ 433 /* Add subscriber to topology server's subscriber list */
434 434
435 ref_lock(subscriber->ref); 435 tipc_ref_lock(subscriber->ref);
436 spin_lock_bh(&topsrv.lock); 436 spin_lock_bh(&topsrv.lock);
437 list_add(&subscriber->subscriber_list, &topsrv.subscriber_list); 437 list_add(&subscriber->subscriber_list, &topsrv.subscriber_list);
438 spin_unlock_bh(&topsrv.lock); 438 spin_unlock_bh(&topsrv.lock);
@@ -451,7 +451,7 @@ static void subscr_named_msg_event(void *usr_handle,
451 spin_unlock_bh(subscriber_lock); 451 spin_unlock_bh(subscriber_lock);
452} 452}
453 453
454int subscr_start(void) 454int tipc_subscr_start(void)
455{ 455{
456 struct tipc_name_seq seq = {TIPC_TOP_SRV, TIPC_TOP_SRV, TIPC_TOP_SRV}; 456 struct tipc_name_seq seq = {TIPC_TOP_SRV, TIPC_TOP_SRV, TIPC_TOP_SRV};
457 int res = -1; 457 int res = -1;
@@ -481,7 +481,7 @@ int subscr_start(void)
481 if (res) 481 if (res)
482 goto failed; 482 goto failed;
483 483
484 res = nametbl_publish_rsv(topsrv.setup_port, TIPC_NODE_SCOPE, &seq); 484 res = tipc_nametbl_publish_rsv(topsrv.setup_port, TIPC_NODE_SCOPE, &seq);
485 if (res) 485 if (res)
486 goto failed; 486 goto failed;
487 487
@@ -496,7 +496,7 @@ failed:
496 return res; 496 return res;
497} 497}
498 498
499void subscr_stop(void) 499void tipc_subscr_stop(void)
500{ 500{
501 struct subscriber *subscriber; 501 struct subscriber *subscriber;
502 struct subscriber *subscriber_temp; 502 struct subscriber *subscriber_temp;
@@ -507,7 +507,7 @@ void subscr_stop(void)
507 list_for_each_entry_safe(subscriber, subscriber_temp, 507 list_for_each_entry_safe(subscriber, subscriber_temp,
508 &topsrv.subscriber_list, 508 &topsrv.subscriber_list,
509 subscriber_list) { 509 subscriber_list) {
510 ref_lock(subscriber->ref); 510 tipc_ref_lock(subscriber->ref);
511 subscriber_lock = subscriber->lock; 511 subscriber_lock = subscriber->lock;
512 subscr_terminate(subscriber); 512 subscr_terminate(subscriber);
513 spin_unlock_bh(subscriber_lock); 513 spin_unlock_bh(subscriber_lock);
@@ -522,6 +522,6 @@ int tipc_ispublished(struct tipc_name const *name)
522{ 522{
523 u32 domain = 0; 523 u32 domain = 0;
524 524
525 return(nametbl_translate(name->type, name->instance,&domain) != 0); 525 return(tipc_nametbl_translate(name->type, name->instance,&domain) != 0);
526} 526}
527 527