diff options
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r-- | net/tipc/name_table.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index d5adb0456746..ddc2ad4c2d32 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -172,8 +172,6 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea | |||
172 | spin_lock_init(&nseq->lock); | 172 | spin_lock_init(&nseq->lock); |
173 | nseq->type = type; | 173 | nseq->type = type; |
174 | nseq->sseqs = sseq; | 174 | nseq->sseqs = sseq; |
175 | dbg("tipc_nameseq_create(): nseq = %p, type %u, ssseqs %p, ff: %u\n", | ||
176 | nseq, type, nseq->sseqs, nseq->first_free); | ||
177 | nseq->alloc = 1; | 175 | nseq->alloc = 1; |
178 | INIT_HLIST_NODE(&nseq->ns_list); | 176 | INIT_HLIST_NODE(&nseq->ns_list); |
179 | INIT_LIST_HEAD(&nseq->subscriptions); | 177 | INIT_LIST_HEAD(&nseq->subscriptions); |
@@ -251,8 +249,6 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
251 | int created_subseq = 0; | 249 | int created_subseq = 0; |
252 | 250 | ||
253 | sseq = nameseq_find_subseq(nseq, lower); | 251 | sseq = nameseq_find_subseq(nseq, lower); |
254 | dbg("nameseq_ins: for seq %p, {%u,%u}, found sseq %p\n", | ||
255 | nseq, type, lower, sseq); | ||
256 | if (sseq) { | 252 | if (sseq) { |
257 | 253 | ||
258 | /* Lower end overlaps existing entry => need an exact match */ | 254 | /* Lower end overlaps existing entry => need an exact match */ |
@@ -289,18 +285,15 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
289 | type, lower, upper); | 285 | type, lower, upper); |
290 | return NULL; | 286 | return NULL; |
291 | } | 287 | } |
292 | dbg("Allocated %u more sseqs\n", nseq->alloc); | ||
293 | memcpy(sseqs, nseq->sseqs, | 288 | memcpy(sseqs, nseq->sseqs, |
294 | nseq->alloc * sizeof(struct sub_seq)); | 289 | nseq->alloc * sizeof(struct sub_seq)); |
295 | kfree(nseq->sseqs); | 290 | kfree(nseq->sseqs); |
296 | nseq->sseqs = sseqs; | 291 | nseq->sseqs = sseqs; |
297 | nseq->alloc *= 2; | 292 | nseq->alloc *= 2; |
298 | } | 293 | } |
299 | dbg("Have %u sseqs for type %u\n", nseq->alloc, type); | ||
300 | 294 | ||
301 | /* Insert new sub-sequence */ | 295 | /* Insert new sub-sequence */ |
302 | 296 | ||
303 | dbg("ins in pos %u, ff = %u\n", inspos, nseq->first_free); | ||
304 | sseq = &nseq->sseqs[inspos]; | 297 | sseq = &nseq->sseqs[inspos]; |
305 | freesseq = &nseq->sseqs[nseq->first_free]; | 298 | freesseq = &nseq->sseqs[nseq->first_free]; |
306 | memmove(sseq + 1, sseq, (freesseq - sseq) * sizeof (*sseq)); | 299 | memmove(sseq + 1, sseq, (freesseq - sseq) * sizeof (*sseq)); |
@@ -310,17 +303,12 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
310 | sseq->upper = upper; | 303 | sseq->upper = upper; |
311 | created_subseq = 1; | 304 | created_subseq = 1; |
312 | } | 305 | } |
313 | dbg("inserting {%u,%u,%u} from <0x%x:%u> into sseq %p(%u,%u) of seq %p\n", | ||
314 | type, lower, upper, node, port, sseq, | ||
315 | sseq->lower, sseq->upper, nseq); | ||
316 | 306 | ||
317 | /* Insert a publication: */ | 307 | /* Insert a publication: */ |
318 | 308 | ||
319 | publ = publ_create(type, lower, upper, scope, node, port, key); | 309 | publ = publ_create(type, lower, upper, scope, node, port, key); |
320 | if (!publ) | 310 | if (!publ) |
321 | return NULL; | 311 | return NULL; |
322 | dbg("inserting publ %p, node=0x%x publ->node=0x%x, subscr->node=%p\n", | ||
323 | publ, node, publ->node, publ->subscr.node); | ||
324 | 312 | ||
325 | sseq->zone_list_size++; | 313 | sseq->zone_list_size++; |
326 | if (!sseq->zone_list) | 314 | if (!sseq->zone_list) |
@@ -355,7 +343,6 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
355 | * Any subscriptions waiting for notification? | 343 | * Any subscriptions waiting for notification? |
356 | */ | 344 | */ |
357 | list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { | 345 | list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { |
358 | dbg("calling report_overlap()\n"); | ||
359 | tipc_subscr_report_overlap(s, | 346 | tipc_subscr_report_overlap(s, |
360 | publ->lower, | 347 | publ->lower, |
361 | publ->upper, | 348 | publ->upper, |
@@ -393,9 +380,6 @@ static struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 i | |||
393 | if (!sseq) | 380 | if (!sseq) |
394 | return NULL; | 381 | return NULL; |
395 | 382 | ||
396 | dbg("tipc_nameseq_remove_publ: seq: %p, sseq %p, {%u,%u}, key %u\n", | ||
397 | nseq, sseq, nseq->type, inst, key); | ||
398 | |||
399 | /* Remove publication from zone scope list */ | 383 | /* Remove publication from zone scope list */ |
400 | 384 | ||
401 | prev = sseq->zone_list; | 385 | prev = sseq->zone_list; |
@@ -549,15 +533,10 @@ static struct name_seq *nametbl_find_seq(u32 type) | |||
549 | struct hlist_node *seq_node; | 533 | struct hlist_node *seq_node; |
550 | struct name_seq *ns; | 534 | struct name_seq *ns; |
551 | 535 | ||
552 | dbg("find_seq %u,(%u,0x%x) table = %p, hash[type] = %u\n", | ||
553 | type, htonl(type), type, table.types, hash(type)); | ||
554 | |||
555 | seq_head = &table.types[hash(type)]; | 536 | seq_head = &table.types[hash(type)]; |
556 | hlist_for_each_entry(ns, seq_node, seq_head, ns_list) { | 537 | hlist_for_each_entry(ns, seq_node, seq_head, ns_list) { |
557 | if (ns->type == type) { | 538 | if (ns->type == type) |
558 | dbg("found %p\n", ns); | ||
559 | return ns; | 539 | return ns; |
560 | } | ||
561 | } | 540 | } |
562 | 541 | ||
563 | return NULL; | 542 | return NULL; |
@@ -568,18 +547,14 @@ struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper, | |||
568 | { | 547 | { |
569 | struct name_seq *seq = nametbl_find_seq(type); | 548 | struct name_seq *seq = nametbl_find_seq(type); |
570 | 549 | ||
571 | dbg("tipc_nametbl_insert_publ: {%u,%u,%u} found %p\n", type, lower, upper, seq); | ||
572 | if (lower > upper) { | 550 | if (lower > upper) { |
573 | warn("Failed to publish illegal {%u,%u,%u}\n", | 551 | warn("Failed to publish illegal {%u,%u,%u}\n", |
574 | type, lower, upper); | 552 | type, lower, upper); |
575 | return NULL; | 553 | return NULL; |
576 | } | 554 | } |
577 | 555 | ||
578 | dbg("Publishing {%u,%u,%u} from 0x%x\n", type, lower, upper, node); | 556 | if (!seq) |
579 | if (!seq) { | ||
580 | seq = tipc_nameseq_create(type, &table.types[hash(type)]); | 557 | seq = tipc_nameseq_create(type, &table.types[hash(type)]); |
581 | dbg("tipc_nametbl_insert_publ: created %p\n", seq); | ||
582 | } | ||
583 | if (!seq) | 558 | if (!seq) |
584 | return NULL; | 559 | return NULL; |
585 | 560 | ||
@@ -596,7 +571,6 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower, | |||
596 | if (!seq) | 571 | if (!seq) |
597 | return NULL; | 572 | return NULL; |
598 | 573 | ||
599 | dbg("Withdrawing {%u,%u} from 0x%x\n", type, lower, node); | ||
600 | publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key); | 574 | publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key); |
601 | 575 | ||
602 | if (!seq->first_free && list_empty(&seq->subscriptions)) { | 576 | if (!seq->first_free && list_empty(&seq->subscriptions)) { |
@@ -792,7 +766,6 @@ int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key) | |||
792 | { | 766 | { |
793 | struct publication *publ; | 767 | struct publication *publ; |
794 | 768 | ||
795 | dbg("tipc_nametbl_withdraw: {%u,%u}, key=%u\n", type, lower, key); | ||
796 | write_lock_bh(&tipc_nametbl_lock); | 769 | write_lock_bh(&tipc_nametbl_lock); |
797 | publ = tipc_nametbl_remove_publ(type, lower, tipc_own_addr, ref, key); | 770 | publ = tipc_nametbl_remove_publ(type, lower, tipc_own_addr, ref, key); |
798 | if (likely(publ)) { | 771 | if (likely(publ)) { |
@@ -827,8 +800,6 @@ void tipc_nametbl_subscribe(struct subscription *s) | |||
827 | } | 800 | } |
828 | if (seq){ | 801 | if (seq){ |
829 | spin_lock_bh(&seq->lock); | 802 | spin_lock_bh(&seq->lock); |
830 | dbg("tipc_nametbl_subscribe:found %p for {%u,%u,%u}\n", | ||
831 | seq, type, s->seq.lower, s->seq.upper); | ||
832 | tipc_nameseq_subscribe(seq, s); | 803 | tipc_nameseq_subscribe(seq, s); |
833 | spin_unlock_bh(&seq->lock); | 804 | spin_unlock_bh(&seq->lock); |
834 | } else { | 805 | } else { |