diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2010-12-09 12:17:25 -0500 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-12-09 12:17:25 -0500 |
| commit | d834a9dcecae834cd6b2bc5e50e1907738d9cf6a (patch) | |
| tree | 0589d753465d3fe359ba451ba6cb7798df03aaa2 /net/tipc/name_table.c | |
| parent | a38c5380ef9f088be9f49b6e4c5d80af8b1b5cd4 (diff) | |
| parent | f658bcfb2607bf0808966a69cf74135ce98e5c2d (diff) | |
Merge branch 'x86/amd-nb' into x86/apic-cleanups
Reason: apic cleanup series depends on x86/apic, x86/amd-nb x86/platform
Conflicts:
arch/x86/include/asm/io_apic.h
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'net/tipc/name_table.c')
| -rw-r--r-- | net/tipc/name_table.c | 67 |
1 files changed, 18 insertions, 49 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 8ba79620db3f..3a8de4334da1 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
| @@ -116,7 +116,7 @@ DEFINE_RWLOCK(tipc_nametbl_lock); | |||
| 116 | 116 | ||
| 117 | static int hash(int x) | 117 | static int hash(int x) |
| 118 | { | 118 | { |
| 119 | return(x & (tipc_nametbl_size - 1)); | 119 | return x & (tipc_nametbl_size - 1); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | /** | 122 | /** |
| @@ -613,8 +613,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower, | |||
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | /* | 615 | /* |
| 616 | * tipc_nametbl_translate(): Translate tipc_name -> tipc_portid. | 616 | * tipc_nametbl_translate - translate name to port id |
| 617 | * Very time-critical. | ||
| 618 | * | 617 | * |
| 619 | * Note: on entry 'destnode' is the search domain used during translation; | 618 | * Note: on entry 'destnode' is the search domain used during translation; |
| 620 | * on exit it passes back the node address of the matching port (if any) | 619 | * on exit it passes back the node address of the matching port (if any) |
| @@ -685,7 +684,6 @@ found: | |||
| 685 | } | 684 | } |
| 686 | spin_unlock_bh(&seq->lock); | 685 | spin_unlock_bh(&seq->lock); |
| 687 | not_found: | 686 | not_found: |
| 688 | *destnode = 0; | ||
| 689 | read_unlock_bh(&tipc_nametbl_lock); | 687 | read_unlock_bh(&tipc_nametbl_lock); |
| 690 | return 0; | 688 | return 0; |
| 691 | } | 689 | } |
| @@ -877,7 +875,7 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth, | |||
| 877 | u32 index) | 875 | u32 index) |
| 878 | { | 876 | { |
| 879 | char portIdStr[27]; | 877 | char portIdStr[27]; |
| 880 | char *scopeStr; | 878 | const char *scope_str[] = {"", " zone", " cluster", " node"}; |
| 881 | struct publication *publ = sseq->zone_list; | 879 | struct publication *publ = sseq->zone_list; |
| 882 | 880 | ||
| 883 | tipc_printf(buf, "%-10u %-10u ", sseq->lower, sseq->upper); | 881 | tipc_printf(buf, "%-10u %-10u ", sseq->lower, sseq->upper); |
| @@ -893,15 +891,8 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth, | |||
| 893 | tipc_node(publ->node), publ->ref); | 891 | tipc_node(publ->node), publ->ref); |
| 894 | tipc_printf(buf, "%-26s ", portIdStr); | 892 | tipc_printf(buf, "%-26s ", portIdStr); |
| 895 | if (depth > 3) { | 893 | if (depth > 3) { |
| 896 | if (publ->node != tipc_own_addr) | 894 | tipc_printf(buf, "%-10u %s", publ->key, |
| 897 | scopeStr = ""; | 895 | scope_str[publ->scope]); |
| 898 | else if (publ->scope == TIPC_NODE_SCOPE) | ||
| 899 | scopeStr = "node"; | ||
| 900 | else if (publ->scope == TIPC_CLUSTER_SCOPE) | ||
| 901 | scopeStr = "cluster"; | ||
| 902 | else | ||
| 903 | scopeStr = "zone"; | ||
| 904 | tipc_printf(buf, "%-10u %s", publ->key, scopeStr); | ||
| 905 | } | 896 | } |
| 906 | 897 | ||
| 907 | publ = publ->zone_list_next; | 898 | publ = publ->zone_list_next; |
| @@ -951,24 +942,19 @@ static void nameseq_list(struct name_seq *seq, struct print_buf *buf, u32 depth, | |||
| 951 | 942 | ||
| 952 | static void nametbl_header(struct print_buf *buf, u32 depth) | 943 | static void nametbl_header(struct print_buf *buf, u32 depth) |
| 953 | { | 944 | { |
| 954 | tipc_printf(buf, "Type "); | 945 | const char *header[] = { |
| 955 | 946 | "Type ", | |
| 956 | if (depth > 1) | 947 | "Lower Upper ", |
| 957 | tipc_printf(buf, "Lower Upper "); | 948 | "Port Identity ", |
| 958 | if (depth > 2) | 949 | "Publication Scope" |
| 959 | tipc_printf(buf, "Port Identity "); | 950 | }; |
| 960 | if (depth > 3) | 951 | |
| 961 | tipc_printf(buf, "Publication"); | 952 | int i; |
| 962 | 953 | ||
| 963 | tipc_printf(buf, "\n-----------"); | 954 | if (depth > 4) |
| 964 | 955 | depth = 4; | |
| 965 | if (depth > 1) | 956 | for (i = 0; i < depth; i++) |
| 966 | tipc_printf(buf, "--------------------- "); | 957 | tipc_printf(buf, header[i]); |
| 967 | if (depth > 2) | ||
| 968 | tipc_printf(buf, "-------------------------- "); | ||
| 969 | if (depth > 3) | ||
| 970 | tipc_printf(buf, "------------------"); | ||
| 971 | |||
| 972 | tipc_printf(buf, "\n"); | 958 | tipc_printf(buf, "\n"); |
| 973 | } | 959 | } |
| 974 | 960 | ||
| @@ -1023,16 +1009,6 @@ static void nametbl_list(struct print_buf *buf, u32 depth_info, | |||
| 1023 | } | 1009 | } |
| 1024 | } | 1010 | } |
| 1025 | 1011 | ||
| 1026 | #if 0 | ||
| 1027 | void tipc_nametbl_print(struct print_buf *buf, const char *str) | ||
| 1028 | { | ||
| 1029 | tipc_printf(buf, str); | ||
| 1030 | read_lock_bh(&tipc_nametbl_lock); | ||
| 1031 | nametbl_list(buf, 0, 0, 0, 0); | ||
| 1032 | read_unlock_bh(&tipc_nametbl_lock); | ||
| 1033 | } | ||
| 1034 | #endif | ||
| 1035 | |||
| 1036 | #define MAX_NAME_TBL_QUERY 32768 | 1012 | #define MAX_NAME_TBL_QUERY 32768 |
| 1037 | 1013 | ||
| 1038 | struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) | 1014 | struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) |
| @@ -1065,13 +1041,6 @@ struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) | |||
| 1065 | return buf; | 1041 | return buf; |
| 1066 | } | 1042 | } |
| 1067 | 1043 | ||
| 1068 | #if 0 | ||
| 1069 | void tipc_nametbl_dump(void) | ||
| 1070 | { | ||
| 1071 | nametbl_list(TIPC_CONS, 0, 0, 0, 0); | ||
| 1072 | } | ||
| 1073 | #endif | ||
| 1074 | |||
| 1075 | int tipc_nametbl_init(void) | 1044 | int tipc_nametbl_init(void) |
| 1076 | { | 1045 | { |
| 1077 | table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head), | 1046 | table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head), |
