name_table.c (404c3bc30cb1361e1b3533643326ab472d24a618) | name_table.c (2c53040f018b6c36a46eec75b9b937aaa5f78e6d) |
---|---|
1/* 2 * net/tipc/name_table.c: TIPC name table code 3 * 4 * Copyright (c) 2000-2006, Ericsson AB 5 * Copyright (c) 2004-2008, 2010-2011, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 177 unchanged lines hidden (view full) --- 186{ 187 if (!seq->first_free && list_empty(&seq->subscriptions)) { 188 hlist_del_init(&seq->ns_list); 189 kfree(seq->sseqs); 190 kfree(seq); 191 } 192} 193 | 1/* 2 * net/tipc/name_table.c: TIPC name table code 3 * 4 * Copyright (c) 2000-2006, Ericsson AB 5 * Copyright (c) 2004-2008, 2010-2011, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 177 unchanged lines hidden (view full) --- 186{ 187 if (!seq->first_free && list_empty(&seq->subscriptions)) { 188 hlist_del_init(&seq->ns_list); 189 kfree(seq->sseqs); 190 kfree(seq); 191 } 192} 193 |
194/* | 194/** |
195 * nameseq_find_subseq - find sub-sequence (if any) matching a name instance 196 * 197 * Very time-critical, so binary searches through sub-sequence array. 198 */ 199static struct sub_seq *nameseq_find_subseq(struct name_seq *nseq, 200 u32 instance) 201{ 202 struct sub_seq *sseqs = nseq->sseqs; --- 227 unchanged lines hidden (view full) --- 430 publ->node, 431 removed_subseq); 432 } 433 434 return publ; 435} 436 437/** | 195 * nameseq_find_subseq - find sub-sequence (if any) matching a name instance 196 * 197 * Very time-critical, so binary searches through sub-sequence array. 198 */ 199static struct sub_seq *nameseq_find_subseq(struct name_seq *nseq, 200 u32 instance) 201{ 202 struct sub_seq *sseqs = nseq->sseqs; --- 227 unchanged lines hidden (view full) --- 430 publ->node, 431 removed_subseq); 432 } 433 434 return publ; 435} 436 437/** |
438 * tipc_nameseq_subscribe: attach a subscription, and issue | 438 * tipc_nameseq_subscribe - attach a subscription, and issue |
439 * the prescribed number of events if there is any sub- 440 * sequence overlapping with the requested sequence 441 */ 442static void tipc_nameseq_subscribe(struct name_seq *nseq, 443 struct tipc_subscription *s) 444{ 445 struct sub_seq *sseq = nseq->sseqs; 446 --- 68 unchanged lines hidden (view full) --- 515 if (!seq) 516 return NULL; 517 518 publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key); 519 nameseq_delete_empty(seq); 520 return publ; 521} 522 | 439 * the prescribed number of events if there is any sub- 440 * sequence overlapping with the requested sequence 441 */ 442static void tipc_nameseq_subscribe(struct name_seq *nseq, 443 struct tipc_subscription *s) 444{ 445 struct sub_seq *sseq = nseq->sseqs; 446 --- 68 unchanged lines hidden (view full) --- 515 if (!seq) 516 return NULL; 517 518 publ = tipc_nameseq_remove_publ(seq, lower, node, ref, key); 519 nameseq_delete_empty(seq); 520 return publ; 521} 522 |
523/* | 523/** |
524 * tipc_nametbl_translate - perform name translation 525 * 526 * On entry, 'destnode' is the search domain used during translation. 527 * 528 * On exit: 529 * - if name translation is deferred to another node/cluster/zone, 530 * leaves 'destnode' unchanged (will be non-zero) and returns 0 531 * - if name translation is attempted and succeeds, sets 'destnode' --- 214 unchanged lines hidden (view full) --- 746 spin_unlock_bh(&seq->lock); 747 nameseq_delete_empty(seq); 748 } 749 write_unlock_bh(&tipc_nametbl_lock); 750} 751 752 753/** | 524 * tipc_nametbl_translate - perform name translation 525 * 526 * On entry, 'destnode' is the search domain used during translation. 527 * 528 * On exit: 529 * - if name translation is deferred to another node/cluster/zone, 530 * leaves 'destnode' unchanged (will be non-zero) and returns 0 531 * - if name translation is attempted and succeeds, sets 'destnode' --- 214 unchanged lines hidden (view full) --- 746 spin_unlock_bh(&seq->lock); 747 nameseq_delete_empty(seq); 748 } 749 write_unlock_bh(&tipc_nametbl_lock); 750} 751 752 753/** |
754 * subseq_list: print specified sub-sequence contents into the given buffer | 754 * subseq_list - print specified sub-sequence contents into the given buffer |
755 */ 756static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth, 757 u32 index) 758{ 759 char portIdStr[27]; 760 const char *scope_str[] = {"", " zone", " cluster", " node"}; 761 struct publication *publ; 762 struct name_info *info; --- 19 unchanged lines hidden (view full) --- 782 if (!list_is_last(&publ->zone_list, &info->zone_list)) 783 tipc_printf(buf, "\n%33s", " "); 784 }; 785 786 tipc_printf(buf, "\n"); 787} 788 789/** | 755 */ 756static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth, 757 u32 index) 758{ 759 char portIdStr[27]; 760 const char *scope_str[] = {"", " zone", " cluster", " node"}; 761 struct publication *publ; 762 struct name_info *info; --- 19 unchanged lines hidden (view full) --- 782 if (!list_is_last(&publ->zone_list, &info->zone_list)) 783 tipc_printf(buf, "\n%33s", " "); 784 }; 785 786 tipc_printf(buf, "\n"); 787} 788 789/** |
790 * nameseq_list: print specified name sequence contents into the given buffer | 790 * nameseq_list - print specified name sequence contents into the given buffer |
791 */ 792static void nameseq_list(struct name_seq *seq, struct print_buf *buf, u32 depth, 793 u32 type, u32 lowbound, u32 upbound, u32 index) 794{ 795 struct sub_seq *sseq; 796 char typearea[11]; 797 798 if (seq->first_free == 0) --- 151 unchanged lines hidden --- | 791 */ 792static void nameseq_list(struct name_seq *seq, struct print_buf *buf, u32 depth, 793 u32 type, u32 lowbound, u32 upbound, u32 index) 794{ 795 struct sub_seq *sseq; 796 char typearea[11]; 797 798 if (seq->first_free == 0) --- 151 unchanged lines hidden --- |