X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Ftipc%2Fname_distr.c;h=830f9099904182daa81dc9e2b76151c81570546e;hb=489447380a2921ec0e9154f773c44ab3167ede4b;hp=31448272a13ac3f487b6763e58fc67343fa44d75;hpb=9ea1fd3c1a15c620d1e3d0aa269d34b705477003;p=linux-2.6 diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 31448272a1..830f909990 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -1,9 +1,8 @@ /* * net/tipc/name_distr.c: TIPC name distribution code * - * Copyright (c) 2003-2005, Ericsson Research Canada + * Copyright (c) 2000-2006, Ericsson AB * Copyright (c) 2005, Wind River Systems - * Copyright (c) 2005-2006, Ericsson AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,10 +114,10 @@ static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest) } /** - * named_publish - tell other nodes about a new publication by this node + * tipc_named_publish - tell other nodes about a new publication by this node */ -void named_publish(struct publication *publ) +void tipc_named_publish(struct publication *publ) { struct sk_buff *buf; struct distr_item *item; @@ -134,15 +133,15 @@ void named_publish(struct publication *publ) item = (struct distr_item *)msg_data(buf_msg(buf)); publ_to_item(item, publ); - dbg("named_withdraw: broadcasting publish msg\n"); - cluster_broadcast(buf); + dbg("tipc_named_withdraw: broadcasting publish msg\n"); + tipc_cltr_broadcast(buf); } /** - * named_withdraw - tell other nodes about a withdrawn publication by this node + * tipc_named_withdraw - tell other nodes about a withdrawn publication by this node */ -void named_withdraw(struct publication *publ) +void tipc_named_withdraw(struct publication *publ) { struct sk_buff *buf; struct distr_item *item; @@ -158,15 +157,15 @@ void named_withdraw(struct publication *publ) item = (struct distr_item *)msg_data(buf_msg(buf)); publ_to_item(item, publ); - dbg("named_withdraw: broadcasting withdraw msg\n"); - cluster_broadcast(buf); + dbg("tipc_named_withdraw: broadcasting withdraw msg\n"); + tipc_cltr_broadcast(buf); } /** - * named_node_up - tell specified node about all publications by this node + * tipc_named_node_up - tell specified node about all publications by this node */ -void named_node_up(unsigned long node) +void tipc_named_node_up(unsigned long node) { struct publication *publ; struct distr_item *item = 0; @@ -176,7 +175,7 @@ void named_node_up(unsigned long node) u32 max_item_buf; assert(in_own_cluster(node)); - read_lock_bh(&nametbl_lock); + read_lock_bh(&tipc_nametbl_lock); max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE; max_item_buf *= ITEM_SIZE; rest = publ_cnt * ITEM_SIZE; @@ -197,15 +196,15 @@ void named_node_up(unsigned long node) left -= ITEM_SIZE; if (!left) { msg_set_link_selector(buf_msg(buf), node); - dbg("named_node_up: sending publish msg to " + dbg("tipc_named_node_up: sending publish msg to " "<%u.%u.%u>\n", tipc_zone(node), tipc_cluster(node), tipc_node(node)); - link_send(buf, node, node); + tipc_link_send(buf, node, node); buf = 0; } } exit: - read_unlock_bh(&nametbl_lock); + read_unlock_bh(&tipc_nametbl_lock); } /** @@ -222,73 +221,73 @@ exit: static void node_is_down(struct publication *publ) { struct publication *p; - write_lock_bh(&nametbl_lock); + write_lock_bh(&tipc_nametbl_lock); dbg("node_is_down: withdrawing %u, %u, %u\n", publ->type, publ->lower, publ->upper); publ->key += 1222345; - p = nametbl_remove_publ(publ->type, publ->lower, - publ->node, publ->ref, publ->key); + p = tipc_nametbl_remove_publ(publ->type, publ->lower, + publ->node, publ->ref, publ->key); assert(p == publ); - write_unlock_bh(&nametbl_lock); + write_unlock_bh(&tipc_nametbl_lock); if (publ) kfree(publ); } /** - * named_recv - process name table update message sent by another node + * tipc_named_recv - process name table update message sent by another node */ -void named_recv(struct sk_buff *buf) +void tipc_named_recv(struct sk_buff *buf) { struct publication *publ; struct tipc_msg *msg = buf_msg(buf); struct distr_item *item = (struct distr_item *)msg_data(msg); u32 count = msg_data_sz(msg) / ITEM_SIZE; - write_lock_bh(&nametbl_lock); + write_lock_bh(&tipc_nametbl_lock); while (count--) { if (msg_type(msg) == PUBLICATION) { - dbg("named_recv: got publication for %u, %u, %u\n", + dbg("tipc_named_recv: got publication for %u, %u, %u\n", ntohl(item->type), ntohl(item->lower), ntohl(item->upper)); - publ = nametbl_insert_publ(ntohl(item->type), - ntohl(item->lower), - ntohl(item->upper), - TIPC_CLUSTER_SCOPE, - msg_orignode(msg), - ntohl(item->ref), - ntohl(item->key)); + publ = tipc_nametbl_insert_publ(ntohl(item->type), + ntohl(item->lower), + ntohl(item->upper), + TIPC_CLUSTER_SCOPE, + msg_orignode(msg), + ntohl(item->ref), + ntohl(item->key)); if (publ) { - nodesub_subscribe(&publ->subscr, - msg_orignode(msg), - publ, - (net_ev_handler)node_is_down); + tipc_nodesub_subscribe(&publ->subscr, + msg_orignode(msg), + publ, + (net_ev_handler)node_is_down); } } else if (msg_type(msg) == WITHDRAWAL) { - dbg("named_recv: got withdrawl for %u, %u, %u\n", + dbg("tipc_named_recv: got withdrawl for %u, %u, %u\n", ntohl(item->type), ntohl(item->lower), ntohl(item->upper)); - publ = nametbl_remove_publ(ntohl(item->type), - ntohl(item->lower), - msg_orignode(msg), - ntohl(item->ref), - ntohl(item->key)); + publ = tipc_nametbl_remove_publ(ntohl(item->type), + ntohl(item->lower), + msg_orignode(msg), + ntohl(item->ref), + ntohl(item->key)); if (publ) { - nodesub_unsubscribe(&publ->subscr); + tipc_nodesub_unsubscribe(&publ->subscr); kfree(publ); } } else { - warn("named_recv: unknown msg\n"); + warn("tipc_named_recv: unknown msg\n"); } item++; } - write_unlock_bh(&nametbl_lock); + write_unlock_bh(&tipc_nametbl_lock); buf_discard(buf); } /** - * named_reinit - re-initialize local publication list + * tipc_named_reinit - re-initialize local publication list * * This routine is called whenever TIPC networking is (re)enabled. * All existing publications by this node that have "cluster" or "zone" scope @@ -296,15 +295,15 @@ void named_recv(struct sk_buff *buf) * (If the node's address is unchanged, the update loop terminates immediately.) */ -void named_reinit(void) +void tipc_named_reinit(void) { struct publication *publ; - write_lock_bh(&nametbl_lock); + write_lock_bh(&tipc_nametbl_lock); list_for_each_entry(publ, &publ_root, local_list) { if (publ->node == tipc_own_addr) break; publ->node = tipc_own_addr; } - write_unlock_bh(&nametbl_lock); + write_unlock_bh(&tipc_nametbl_lock); }