From 4323add67792ced172d0d93b8b2e6187023115f1 Mon Sep 17 00:00:00 2001 From: Per Liden Date: Wed, 18 Jan 2006 00:38:21 +0100 Subject: [TIPC] Avoid polluting the global namespace This patch adds a tipc_ prefix to all externally visible symbols. Signed-off-by: Per Liden --- net/tipc/addr.c | 10 +- net/tipc/addr.h | 4 +- net/tipc/bcast.c | 162 ++++++------- net/tipc/bcast.h | 44 ++-- net/tipc/bearer.c | 170 +++++++------- net/tipc/bearer.h | 38 ++-- net/tipc/cluster.c | 154 ++++++------- net/tipc/cluster.h | 40 ++-- net/tipc/config.c | 218 +++++++++--------- net/tipc/config.h | 38 ++-- net/tipc/core.c | 86 +++---- net/tipc/core.h | 30 +-- net/tipc/dbg.c | 112 ++++----- net/tipc/dbg.h | 18 +- net/tipc/discover.c | 52 ++--- net/tipc/discover.h | 16 +- net/tipc/eth_media.c | 8 +- net/tipc/handler.c | 6 +- net/tipc/link.c | 602 ++++++++++++++++++++++++------------------------- net/tipc/link.h | 73 +++--- net/tipc/msg.c | 19 +- net/tipc/msg.h | 16 +- net/tipc/name_distr.c | 92 ++++---- net/tipc/name_distr.h | 10 +- net/tipc/name_table.c | 206 ++++++++--------- net/tipc/name_table.h | 26 +-- net/tipc/net.c | 126 +++++------ net/tipc/net.h | 20 +- net/tipc/netlink.c | 16 +- net/tipc/node.c | 215 +++++++++--------- net/tipc/node.h | 50 ++-- net/tipc/node_subscr.c | 20 +- net/tipc/node_subscr.h | 6 +- net/tipc/port.c | 274 +++++++++++----------- net/tipc/port.h | 58 ++--- net/tipc/ref.c | 72 +++--- net/tipc/ref.h | 38 ++-- net/tipc/socket.c | 10 +- net/tipc/subscr.c | 58 ++--- net/tipc/subscr.h | 24 +- net/tipc/user_reg.c | 22 +- net/tipc/user_reg.h | 8 +- net/tipc/zone.c | 40 ++-- net/tipc/zone.h | 20 +- 44 files changed, 1654 insertions(+), 1673 deletions(-) (limited to 'net/tipc') diff --git a/net/tipc/addr.c b/net/tipc/addr.c index eca22260c98c..0be25e175b93 100644 --- a/net/tipc/addr.c +++ b/net/tipc/addr.c @@ -47,7 +47,7 @@ u32 tipc_get_addr(void) } /** - * addr_domain_valid - validates a network domain address + * tipc_addr_domain_valid - validates a network domain address * * Accepts , , , and <0.0.0>, * where Z, C, and N are non-zero and do not exceed the configured limits. @@ -55,7 +55,7 @@ u32 tipc_get_addr(void) * Returns 1 if domain address is valid, otherwise 0 */ -int addr_domain_valid(u32 addr) +int tipc_addr_domain_valid(u32 addr) { u32 n = tipc_node(addr); u32 c = tipc_cluster(addr); @@ -79,7 +79,7 @@ int addr_domain_valid(u32 addr) } /** - * addr_node_valid - validates a proposed network address for this node + * tipc_addr_node_valid - validates a proposed network address for this node * * Accepts , where Z, C, and N are non-zero and do not exceed * the configured limits. @@ -87,8 +87,8 @@ int addr_domain_valid(u32 addr) * Returns 1 if address can be used, otherwise 0 */ -int addr_node_valid(u32 addr) +int tipc_addr_node_valid(u32 addr) { - return (addr_domain_valid(addr) && tipc_node(addr)); + return (tipc_addr_domain_valid(addr) && tipc_node(addr)); } diff --git a/net/tipc/addr.h b/net/tipc/addr.h index 02ca71783e2e..bcfebb3cbbf3 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h @@ -122,7 +122,7 @@ static inline char *addr_string_fill(char *string, u32 addr) return string; } -int addr_domain_valid(u32); -int addr_node_valid(u32 addr); +int tipc_addr_domain_valid(u32); +int tipc_addr_node_valid(u32 addr); #endif diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index af9743a52d6c..a7b04f397c12 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -104,7 +104,7 @@ static struct bclink *bclink = NULL; static struct link *bcl = NULL; static spinlock_t bc_lock = SPIN_LOCK_UNLOCKED; -char bc_link_name[] = "multicast-link"; +char tipc_bclink_name[] = "multicast-link"; static inline u32 buf_seqno(struct sk_buff *buf) @@ -178,19 +178,19 @@ static void bclink_retransmit_pkt(u32 after, u32 to) buf = buf->next; } if (buf != NULL) - link_retransmit(bcl, buf, mod(to - after)); + tipc_link_retransmit(bcl, buf, mod(to - after)); spin_unlock_bh(&bc_lock); } /** - * bclink_acknowledge - handle acknowledgement of broadcast packets + * tipc_bclink_acknowledge - handle acknowledgement of broadcast packets * @n_ptr: node that sent acknowledgement info * @acked: broadcast sequence # that has been acknowledged * * Node is locked, bc_lock unlocked. */ -void bclink_acknowledge(struct node *n_ptr, u32 acked) +void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) { struct sk_buff *crs; struct sk_buff *next; @@ -226,16 +226,16 @@ void bclink_acknowledge(struct node *n_ptr, u32 acked) /* Try resolving broadcast link congestion, if necessary */ if (unlikely(bcl->next_out)) - link_push_queue(bcl); + tipc_link_push_queue(bcl); if (unlikely(released && !list_empty(&bcl->waiting_ports))) - link_wakeup_ports(bcl, 0); + tipc_link_wakeup_ports(bcl, 0); spin_unlock_bh(&bc_lock); } /** * bclink_send_ack - unicast an ACK msg * - * net_lock and node lock set + * tipc_net_lock and node lock set */ static void bclink_send_ack(struct node *n_ptr) @@ -243,13 +243,13 @@ static void bclink_send_ack(struct node *n_ptr) struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; if (l_ptr != NULL) - link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); + tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); } /** * bclink_send_nack- broadcast a NACK msg * - * net_lock and node lock set + * tipc_net_lock and node lock set */ static void bclink_send_nack(struct node *n_ptr) @@ -271,11 +271,11 @@ static void bclink_send_nack(struct node *n_ptr) msg_set_bcgap_to(msg, n_ptr->bclink.gap_to); msg_set_bcast_tag(msg, tipc_own_tag); - if (bearer_send(&bcbearer->bearer, buf, 0)) { + if (tipc_bearer_send(&bcbearer->bearer, buf, 0)) { bcl->stats.sent_nacks++; buf_discard(buf); } else { - bearer_schedule(bcl->b_ptr, bcl); + tipc_bearer_schedule(bcl->b_ptr, bcl); bcl->proto_msg_queue = buf; bcl->stats.bearer_congs++; } @@ -291,12 +291,12 @@ static void bclink_send_nack(struct node *n_ptr) } /** - * bclink_check_gap - send a NACK if a sequence gap exists + * tipc_bclink_check_gap - send a NACK if a sequence gap exists * - * net_lock and node lock set + * tipc_net_lock and node lock set */ -void bclink_check_gap(struct node *n_ptr, u32 last_sent) +void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) { if (!n_ptr->bclink.supported || less_eq(last_sent, mod(n_ptr->bclink.last_in))) @@ -309,19 +309,19 @@ void bclink_check_gap(struct node *n_ptr, u32 last_sent) } /** - * bclink_peek_nack - process a NACK msg meant for another node + * tipc_bclink_peek_nack - process a NACK msg meant for another node * - * Only net_lock set. + * Only tipc_net_lock set. */ -void bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) +void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) { - struct node *n_ptr = node_find(dest); + struct node *n_ptr = tipc_node_find(dest); u32 my_after, my_to; - if (unlikely(!n_ptr || !node_is_up(n_ptr))) + if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) return; - node_lock(n_ptr); + tipc_node_lock(n_ptr); /* * Modify gap to suppress unnecessary NACKs from this node */ @@ -364,20 +364,20 @@ void bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) bclink_set_gap(n_ptr); } } - node_unlock(n_ptr); + tipc_node_unlock(n_ptr); } /** - * bclink_send_msg - broadcast a packet to all nodes in cluster + * tipc_bclink_send_msg - broadcast a packet to all nodes in cluster */ -int bclink_send_msg(struct sk_buff *buf) +int tipc_bclink_send_msg(struct sk_buff *buf) { int res; spin_lock_bh(&bc_lock); - res = link_send_buf(bcl, buf); + res = tipc_link_send_buf(bcl, buf); if (unlikely(res == -ELINKCONG)) buf_discard(buf); else @@ -393,22 +393,22 @@ int bclink_send_msg(struct sk_buff *buf) } /** - * bclink_recv_pkt - receive a broadcast packet, and deliver upwards + * tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards * - * net_lock is read_locked, no other locks set + * tipc_net_lock is read_locked, no other locks set */ -void bclink_recv_pkt(struct sk_buff *buf) +void tipc_bclink_recv_pkt(struct sk_buff *buf) { struct tipc_msg *msg = buf_msg(buf); - struct node* node = node_find(msg_prevnode(msg)); + struct node* node = tipc_node_find(msg_prevnode(msg)); u32 next_in; u32 seqno; struct sk_buff *deferred; msg_dbg(msg, "bclink.supported || + if (unlikely(!node || !tipc_node_is_up(node) || !node->bclink.supported || (msg_mc_netid(msg) != tipc_net_id))) { buf_discard(buf); return; @@ -417,14 +417,14 @@ void bclink_recv_pkt(struct sk_buff *buf) if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) { msg_dbg(msg, "stats.recv_nacks++; bclink_retransmit_pkt(msg_bcgap_after(msg), msg_bcgap_to(msg)); } else { - bclink_peek_nack(msg_destnode(msg), + tipc_bclink_peek_nack(msg_destnode(msg), msg_bcast_tag(msg), msg_bcgap_after(msg), msg_bcgap_to(msg)); @@ -433,7 +433,7 @@ void bclink_recv_pkt(struct sk_buff *buf) return; } - node_lock(node); + tipc_node_lock(node); receive: deferred = node->bclink.deferred_head; next_in = mod(node->bclink.last_in + 1); @@ -448,26 +448,26 @@ receive: bcl->stats.sent_acks++; } if (likely(msg_isdata(msg))) { - node_unlock(node); - port_recv_mcast(buf, NULL); + tipc_node_unlock(node); + tipc_port_recv_mcast(buf, NULL); } else if (msg_user(msg) == MSG_BUNDLER) { bcl->stats.recv_bundles++; bcl->stats.recv_bundled += msg_msgcnt(msg); - node_unlock(node); - link_recv_bundle(buf); + tipc_node_unlock(node); + tipc_link_recv_bundle(buf); } else if (msg_user(msg) == MSG_FRAGMENTER) { bcl->stats.recv_fragments++; - if (link_recv_fragment(&node->bclink.defragm, - &buf, &msg)) + if (tipc_link_recv_fragment(&node->bclink.defragm, + &buf, &msg)) bcl->stats.recv_fragmented++; - node_unlock(node); - net_route_msg(buf); + tipc_node_unlock(node); + tipc_net_route_msg(buf); } else { - node_unlock(node); - net_route_msg(buf); + tipc_node_unlock(node); + tipc_net_route_msg(buf); } if (deferred && (buf_seqno(deferred) == mod(next_in + 1))) { - node_lock(node); + tipc_node_lock(node); buf = deferred; msg = buf_msg(buf); node->bclink.deferred_head = deferred->next; @@ -478,9 +478,9 @@ receive: u32 gap_after = node->bclink.gap_after; u32 gap_to = node->bclink.gap_to; - if (link_defer_pkt(&node->bclink.deferred_head, - &node->bclink.deferred_tail, - buf)) { + if (tipc_link_defer_pkt(&node->bclink.deferred_head, + &node->bclink.deferred_tail, + buf)) { node->bclink.nack_sync++; bcl->stats.deferred_recv++; if (seqno == mod(gap_after + 1)) @@ -497,10 +497,10 @@ receive: bcl->stats.duplicates++; buf_discard(buf); } - node_unlock(node); + tipc_node_unlock(node); } -u32 bclink_get_last_sent(void) +u32 tipc_bclink_get_last_sent(void) { u32 last_sent = mod(bcl->next_out_no - 1); @@ -509,15 +509,15 @@ u32 bclink_get_last_sent(void) return last_sent; } -u32 bclink_acks_missing(struct node *n_ptr) +u32 tipc_bclink_acks_missing(struct node *n_ptr) { return (n_ptr->bclink.supported && - (bclink_get_last_sent() != n_ptr->bclink.acked)); + (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); } /** - * bcbearer_send - send a packet through the broadcast pseudo-bearer + * tipc_bcbearer_send - send a packet through the broadcast pseudo-bearer * * Send through as many bearers as necessary to reach all nodes * that support TIPC multicasting. @@ -525,9 +525,9 @@ u32 bclink_acks_missing(struct node *n_ptr) * Returns 0 if packet sent successfully, non-zero if not */ -int bcbearer_send(struct sk_buff *buf, - struct tipc_bearer *unused1, - struct tipc_media_addr *unused2) +int tipc_bcbearer_send(struct sk_buff *buf, + struct tipc_bearer *unused1, + struct tipc_media_addr *unused2) { static int send_count = 0; @@ -541,8 +541,8 @@ int bcbearer_send(struct sk_buff *buf, if (likely(!msg_non_seq(buf_msg(buf)))) { struct tipc_msg *msg; - assert(cluster_bcast_nodes.count != 0); - bcbuf_set_acks(buf, cluster_bcast_nodes.count); + assert(tipc_cltr_bcast_nodes.count != 0); + bcbuf_set_acks(buf, tipc_cltr_bcast_nodes.count); msg = buf_msg(buf); msg_set_non_seq(msg); msg_set_mc_netid(msg, tipc_net_id); @@ -555,7 +555,7 @@ int bcbearer_send(struct sk_buff *buf, /* Send buffer over bearers until all targets reached */ - remains = cluster_bcast_nodes; + remains = tipc_cltr_bcast_nodes; for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { struct bearer *p = bcbearer->bpairs[bp_index].primary; @@ -564,7 +564,7 @@ int bcbearer_send(struct sk_buff *buf, if (!p) break; /* no more bearers to try */ - nmap_diff(&remains, &p->nodes, &remains_new); + tipc_nmap_diff(&remains, &p->nodes, &remains_new); if (remains_new.count == remains.count) continue; /* bearer pair doesn't add anything */ @@ -597,10 +597,10 @@ update: } /** - * bcbearer_sort - create sets of bearer pairs used by broadcast bearer + * tipc_bcbearer_sort - create sets of bearer pairs used by broadcast bearer */ -void bcbearer_sort(void) +void tipc_bcbearer_sort(void) { struct bcbearer_pair *bp_temp = bcbearer->bpairs_temp; struct bcbearer_pair *bp_curr; @@ -614,7 +614,7 @@ void bcbearer_sort(void) memset(bp_temp, 0, sizeof(bcbearer->bpairs_temp)); for (b_index = 0; b_index < MAX_BEARERS; b_index++) { - struct bearer *b = &bearers[b_index]; + struct bearer *b = &tipc_bearers[b_index]; if (!b->active || !b->nodes.count) continue; @@ -638,8 +638,8 @@ void bcbearer_sort(void) bp_curr->primary = bp_temp[pri].primary; if (bp_temp[pri].secondary) { - if (nmap_equal(&bp_temp[pri].primary->nodes, - &bp_temp[pri].secondary->nodes)) { + if (tipc_nmap_equal(&bp_temp[pri].primary->nodes, + &bp_temp[pri].secondary->nodes)) { bp_curr->secondary = bp_temp[pri].secondary; } else { bp_curr++; @@ -654,14 +654,14 @@ void bcbearer_sort(void) } /** - * bcbearer_push - resolve bearer congestion + * tipc_bcbearer_push - resolve bearer congestion * * Forces bclink to push out any unsent packets, until all packets are gone * or congestion reoccurs. * No locks set when function called */ -void bcbearer_push(void) +void tipc_bcbearer_push(void) { struct bearer *b_ptr; @@ -669,20 +669,20 @@ void bcbearer_push(void) b_ptr = &bcbearer->bearer; if (b_ptr->publ.blocked) { b_ptr->publ.blocked = 0; - bearer_lock_push(b_ptr); + tipc_bearer_lock_push(b_ptr); } spin_unlock_bh(&bc_lock); } -int bclink_stats(char *buf, const u32 buf_size) +int tipc_bclink_stats(char *buf, const u32 buf_size) { struct print_buf pb; if (!bcl) return 0; - printbuf_init(&pb, buf, buf_size); + tipc_printbuf_init(&pb, buf, buf_size); spin_lock_bh(&bc_lock); @@ -718,10 +718,10 @@ int bclink_stats(char *buf, const u32 buf_size) : 0); spin_unlock_bh(&bc_lock); - return printbuf_validate(&pb); + return tipc_printbuf_validate(&pb); } -int bclink_reset_stats(void) +int tipc_bclink_reset_stats(void) { if (!bcl) return -ENOPROTOOPT; @@ -732,7 +732,7 @@ int bclink_reset_stats(void) return TIPC_OK; } -int bclink_set_queue_limits(u32 limit) +int tipc_bclink_set_queue_limits(u32 limit) { if (!bcl) return -ENOPROTOOPT; @@ -740,12 +740,12 @@ int bclink_set_queue_limits(u32 limit) return -EINVAL; spin_lock_bh(&bc_lock); - link_set_queue_limits(bcl, limit); + tipc_link_set_queue_limits(bcl, limit); spin_unlock_bh(&bc_lock); return TIPC_OK; } -int bclink_init(void) +int tipc_bclink_init(void) { bcbearer = kmalloc(sizeof(*bcbearer), GFP_ATOMIC); bclink = kmalloc(sizeof(*bclink), GFP_ATOMIC); @@ -762,7 +762,7 @@ int bclink_init(void) memset(bcbearer, 0, sizeof(struct bcbearer)); INIT_LIST_HEAD(&bcbearer->bearer.cong_links); bcbearer->bearer.media = &bcbearer->media; - bcbearer->media.send_msg = bcbearer_send; + bcbearer->media.send_msg = tipc_bcbearer_send; sprintf(bcbearer->media.name, "tipc-multicast"); bcl = &bclink->link; @@ -772,27 +772,27 @@ int bclink_init(void) bclink->node.lock = SPIN_LOCK_UNLOCKED; bcl->owner = &bclink->node; bcl->max_pkt = MAX_PKT_DEFAULT_MCAST; - link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); + tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); bcl->b_ptr = &bcbearer->bearer; bcl->state = WORKING_WORKING; - sprintf(bcl->name, bc_link_name); + sprintf(bcl->name, tipc_bclink_name); if (BCLINK_LOG_BUF_SIZE) { char *pb = kmalloc(BCLINK_LOG_BUF_SIZE, GFP_ATOMIC); if (!pb) goto nomem; - printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE); + tipc_printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE); } return TIPC_OK; } -void bclink_stop(void) +void tipc_bclink_stop(void) { spin_lock_bh(&bc_lock); if (bcbearer) { - link_stop(bcl); + tipc_link_stop(bcl); if (BCLINK_LOG_BUF_SIZE) kfree(bcl->print_buf.buf); bcl = NULL; diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index 5430e524b4f9..0e3be2ab3307 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h @@ -70,14 +70,14 @@ struct port_list { struct node; -extern char bc_link_name[]; +extern char tipc_bclink_name[]; /** * nmap_get - determine if node exists in a node map */ -static inline int nmap_get(struct node_map *nm_ptr, u32 node) +static inline int tipc_nmap_get(struct node_map *nm_ptr, u32 node) { int n = tipc_node(node); int w = n / WSIZE; @@ -90,7 +90,7 @@ static inline int nmap_get(struct node_map *nm_ptr, u32 node) * nmap_add - add a node to a node map */ -static inline void nmap_add(struct node_map *nm_ptr, u32 node) +static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) { int n = tipc_node(node); int w = n / WSIZE; @@ -106,7 +106,7 @@ static inline void nmap_add(struct node_map *nm_ptr, u32 node) * nmap_remove - remove a node from a node map */ -static inline void nmap_remove(struct node_map *nm_ptr, u32 node) +static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) { int n = tipc_node(node); int w = n / WSIZE; @@ -122,7 +122,7 @@ static inline void nmap_remove(struct node_map *nm_ptr, u32 node) * nmap_equal - test for equality of node maps */ -static inline int nmap_equal(struct node_map *nm_a, struct node_map *nm_b) +static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) { return !memcmp(nm_a, nm_b, sizeof(*nm_a)); } @@ -134,8 +134,8 @@ static inline int nmap_equal(struct node_map *nm_a, struct node_map *nm_b) * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) */ -static inline void nmap_diff(struct node_map *nm_a, struct node_map *nm_b, - struct node_map *nm_diff) +static inline void tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b, + struct node_map *nm_diff) { int stop = sizeof(nm_a->map) / sizeof(u32); int w; @@ -159,7 +159,7 @@ static inline void nmap_diff(struct node_map *nm_a, struct node_map *nm_b, * port_list_add - add a port to a port list, ensuring no duplicates */ -static inline void port_list_add(struct port_list *pl_ptr, u32 port) +static inline void tipc_port_list_add(struct port_list *pl_ptr, u32 port) { struct port_list *item = pl_ptr; int i; @@ -194,7 +194,7 @@ static inline void port_list_add(struct port_list *pl_ptr, u32 port) * Note: First item is on stack, so it doesn't need to be released */ -static inline void port_list_free(struct port_list *pl_ptr) +static inline void tipc_port_list_free(struct port_list *pl_ptr) { struct port_list *item; struct port_list *next; @@ -206,18 +206,18 @@ static inline void port_list_free(struct port_list *pl_ptr) } -int bclink_init(void); -void bclink_stop(void); -void bclink_acknowledge(struct node *n_ptr, u32 acked); -int bclink_send_msg(struct sk_buff *buf); -void bclink_recv_pkt(struct sk_buff *buf); -u32 bclink_get_last_sent(void); -u32 bclink_acks_missing(struct node *n_ptr); -void bclink_check_gap(struct node *n_ptr, u32 seqno); -int bclink_stats(char *stats_buf, const u32 buf_size); -int bclink_reset_stats(void); -int bclink_set_queue_limits(u32 limit); -void bcbearer_sort(void); -void bcbearer_push(void); +int tipc_bclink_init(void); +void tipc_bclink_stop(void); +void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked); +int tipc_bclink_send_msg(struct sk_buff *buf); +void tipc_bclink_recv_pkt(struct sk_buff *buf); +u32 tipc_bclink_get_last_sent(void); +u32 tipc_bclink_acks_missing(struct node *n_ptr); +void tipc_bclink_check_gap(struct node *n_ptr, u32 seqno); +int tipc_bclink_stats(char *stats_buf, const u32 buf_size); +int tipc_bclink_reset_stats(void); +int tipc_bclink_set_queue_limits(u32 limit); +void tipc_bcbearer_sort(void); +void tipc_bcbearer_push(void); #endif diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 02b6cf6ab7a4..64dcb0f3a8b2 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -48,7 +48,7 @@ static struct media *media_list = 0; static u32 media_count = 0; -struct bearer *bearers = 0; +struct bearer *tipc_bearers = 0; /** * media_name_valid - validate media name @@ -107,7 +107,7 @@ int tipc_register_media(u32 media_type, u32 i; int res = -EINVAL; - write_lock_bh(&net_lock); + write_lock_bh(&tipc_net_lock); if (!media_list) goto exit; @@ -165,15 +165,15 @@ int tipc_register_media(u32 media_type, dbg("Media <%s> registered\n", name); res = 0; exit: - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); return res; } /** - * media_addr_printf - record media address in print buffer + * tipc_media_addr_printf - record media address in print buffer */ -void media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) +void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) { struct media *m_ptr; u32 media_type; @@ -201,25 +201,25 @@ void media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) } /** - * media_get_names - record names of registered media in buffer + * tipc_media_get_names - record names of registered media in buffer */ -struct sk_buff *media_get_names(void) +struct sk_buff *tipc_media_get_names(void) { struct sk_buff *buf; struct media *m_ptr; int i; - buf = cfg_reply_alloc(MAX_MEDIA * TLV_SPACE(TIPC_MAX_MEDIA_NAME)); + buf = tipc_cfg_reply_alloc(MAX_MEDIA * TLV_SPACE(TIPC_MAX_MEDIA_NAME)); if (!buf) return NULL; - read_lock_bh(&net_lock); + read_lock_bh(&tipc_net_lock); for (i = 0, m_ptr = media_list; i < media_count; i++, m_ptr++) { - cfg_append_tlv(buf, TIPC_TLV_MEDIA_NAME, m_ptr->name, - strlen(m_ptr->name) + 1); + tipc_cfg_append_tlv(buf, TIPC_TLV_MEDIA_NAME, m_ptr->name, + strlen(m_ptr->name) + 1); } - read_unlock_bh(&net_lock); + read_unlock_bh(&tipc_net_lock); return buf; } @@ -283,7 +283,7 @@ static struct bearer *bearer_find(const char *name) struct bearer *b_ptr; u32 i; - for (i = 0, b_ptr = bearers; i < MAX_BEARERS; i++, b_ptr++) { + for (i = 0, b_ptr = tipc_bearers; i < MAX_BEARERS; i++, b_ptr++) { if (b_ptr->active && (!strcmp(b_ptr->publ.name, name))) return b_ptr; } @@ -291,16 +291,16 @@ static struct bearer *bearer_find(const char *name) } /** - * bearer_find - locates bearer object with matching interface name + * tipc_bearer_find_interface - locates bearer object with matching interface name */ -struct bearer *bearer_find_interface(const char *if_name) +struct bearer *tipc_bearer_find_interface(const char *if_name) { struct bearer *b_ptr; char *b_if_name; u32 i; - for (i = 0, b_ptr = bearers; i < MAX_BEARERS; i++, b_ptr++) { + for (i = 0, b_ptr = tipc_bearers; i < MAX_BEARERS; i++, b_ptr++) { if (!b_ptr->active) continue; b_if_name = strchr(b_ptr->publ.name, ':') + 1; @@ -311,54 +311,54 @@ struct bearer *bearer_find_interface(const char *if_name) } /** - * bearer_get_names - record names of bearers in buffer + * tipc_bearer_get_names - record names of bearers in buffer */ -struct sk_buff *bearer_get_names(void) +struct sk_buff *tipc_bearer_get_names(void) { struct sk_buff *buf; struct media *m_ptr; struct bearer *b_ptr; int i, j; - buf = cfg_reply_alloc(MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME)); + buf = tipc_cfg_reply_alloc(MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME)); if (!buf) return NULL; - read_lock_bh(&net_lock); + read_lock_bh(&tipc_net_lock); for (i = 0, m_ptr = media_list; i < media_count; i++, m_ptr++) { for (j = 0; j < MAX_BEARERS; j++) { - b_ptr = &bearers[j]; + b_ptr = &tipc_bearers[j]; if (b_ptr->active && (b_ptr->media == m_ptr)) { - cfg_append_tlv(buf, TIPC_TLV_BEARER_NAME, - b_ptr->publ.name, - strlen(b_ptr->publ.name) + 1); + tipc_cfg_append_tlv(buf, TIPC_TLV_BEARER_NAME, + b_ptr->publ.name, + strlen(b_ptr->publ.name) + 1); } } } - read_unlock_bh(&net_lock); + read_unlock_bh(&tipc_net_lock); return buf; } -void bearer_add_dest(struct bearer *b_ptr, u32 dest) +void tipc_bearer_add_dest(struct bearer *b_ptr, u32 dest) { - nmap_add(&b_ptr->nodes, dest); - disc_update_link_req(b_ptr->link_req); - bcbearer_sort(); + tipc_nmap_add(&b_ptr->nodes, dest); + tipc_disc_update_link_req(b_ptr->link_req); + tipc_bcbearer_sort(); } -void bearer_remove_dest(struct bearer *b_ptr, u32 dest) +void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest) { - nmap_remove(&b_ptr->nodes, dest); - disc_update_link_req(b_ptr->link_req); - bcbearer_sort(); + tipc_nmap_remove(&b_ptr->nodes, dest); + tipc_disc_update_link_req(b_ptr->link_req); + tipc_bcbearer_sort(); } /* * bearer_push(): Resolve bearer congestion. Force the waiting * links to push out their unsent packets, one packet per link * per iteration, until all packets are gone or congestion reoccurs. - * 'net_lock' is read_locked when this function is called + * 'tipc_net_lock' is read_locked when this function is called * bearer.lock must be taken before calling * Returns binary true(1) ore false(0) */ @@ -372,7 +372,7 @@ static int bearer_push(struct bearer *b_ptr) while (!list_empty(&b_ptr->cong_links) && (res != PUSH_FAILED)) { list_for_each_entry_safe(ln, tln, &b_ptr->cong_links, link_list) { - res = link_push_packet(ln); + res = tipc_link_push_packet(ln); if (res == PUSH_FAILED) break; if (res == PUSH_FINISHED) @@ -382,7 +382,7 @@ static int bearer_push(struct bearer *b_ptr) return list_empty(&b_ptr->cong_links); } -void bearer_lock_push(struct bearer *b_ptr) +void tipc_bearer_lock_push(struct bearer *b_ptr) { int res; @@ -390,7 +390,7 @@ void bearer_lock_push(struct bearer *b_ptr) res = bearer_push(b_ptr); spin_unlock_bh(&b_ptr->publ.lock); if (res) - bcbearer_push(); + tipc_bcbearer_push(); } @@ -405,7 +405,7 @@ void tipc_continue(struct tipc_bearer *tb_ptr) spin_lock_bh(&b_ptr->publ.lock); b_ptr->continue_count++; if (!list_empty(&b_ptr->cong_links)) - k_signal((Handler)bearer_lock_push, (unsigned long)b_ptr); + tipc_k_signal((Handler)tipc_bearer_lock_push, (unsigned long)b_ptr); b_ptr->publ.blocked = 0; spin_unlock_bh(&b_ptr->publ.lock); } @@ -414,11 +414,11 @@ void tipc_continue(struct tipc_bearer *tb_ptr) * Schedule link for sending of messages after the bearer * has been deblocked by 'continue()'. This method is called * when somebody tries to send a message via this link while - * the bearer is congested. 'net_lock' is in read_lock here + * the bearer is congested. 'tipc_net_lock' is in read_lock here * bearer.lock is busy */ -static void bearer_schedule_unlocked(struct bearer *b_ptr, struct link *l_ptr) +static void tipc_bearer_schedule_unlocked(struct bearer *b_ptr, struct link *l_ptr) { list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); } @@ -427,24 +427,24 @@ static void bearer_schedule_unlocked(struct bearer *b_ptr, struct link *l_ptr) * Schedule link for sending of messages after the bearer * has been deblocked by 'continue()'. This method is called * when somebody tries to send a message via this link while - * the bearer is congested. 'net_lock' is in read_lock here, + * the bearer is congested. 'tipc_net_lock' is in read_lock here, * bearer.lock is free */ -void bearer_schedule(struct bearer *b_ptr, struct link *l_ptr) +void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr) { spin_lock_bh(&b_ptr->publ.lock); - bearer_schedule_unlocked(b_ptr, l_ptr); + tipc_bearer_schedule_unlocked(b_ptr, l_ptr); spin_unlock_bh(&b_ptr->publ.lock); } /* - * bearer_resolve_congestion(): Check if there is bearer congestion, + * tipc_bearer_resolve_congestion(): Check if there is bearer congestion, * and if there is, try to resolve it before returning. - * 'net_lock' is read_locked when this function is called + * 'tipc_net_lock' is read_locked when this function is called */ -int bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr) +int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr) { int res = 1; @@ -452,7 +452,7 @@ int bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr) return 1; spin_lock_bh(&b_ptr->publ.lock); if (!bearer_push(b_ptr)) { - bearer_schedule_unlocked(b_ptr, l_ptr); + tipc_bearer_schedule_unlocked(b_ptr, l_ptr); res = 0; } spin_unlock_bh(&b_ptr->publ.lock); @@ -479,7 +479,7 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority) return -ENOPROTOOPT; if (!bearer_name_validate(name, &b_name) || - !addr_domain_valid(bcast_scope) || + !tipc_addr_domain_valid(bcast_scope) || !in_scope(bcast_scope, tipc_own_addr)) return -EINVAL; @@ -488,8 +488,8 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority) (priority != TIPC_MEDIA_LINK_PRI)) return -EINVAL; - write_lock_bh(&net_lock); - if (!bearers) + write_lock_bh(&tipc_net_lock); + if (!tipc_bearers) goto failed; m_ptr = media_find(b_name.media_name); @@ -505,15 +505,15 @@ restart: bearer_id = MAX_BEARERS; with_this_prio = 1; for (i = MAX_BEARERS; i-- != 0; ) { - if (!bearers[i].active) { + if (!tipc_bearers[i].active) { bearer_id = i; continue; } - if (!strcmp(name, bearers[i].publ.name)) { + if (!strcmp(name, tipc_bearers[i].publ.name)) { warn("Bearer <%s> already enabled\n", name); goto failed; } - if ((bearers[i].priority == priority) && + if ((tipc_bearers[i].priority == priority) && (++with_this_prio > 2)) { if (priority-- == 0) { warn("Third bearer <%s> with priority %u, unable to lower to %u\n", @@ -530,7 +530,7 @@ restart: goto failed; } - b_ptr = &bearers[bearer_id]; + b_ptr = &tipc_bearers[bearer_id]; memset(b_ptr, 0, sizeof(struct bearer)); strcpy(b_ptr->publ.name, name); @@ -549,16 +549,16 @@ restart: INIT_LIST_HEAD(&b_ptr->cong_links); INIT_LIST_HEAD(&b_ptr->links); if (m_ptr->bcast) { - b_ptr->link_req = disc_init_link_req(b_ptr, &m_ptr->bcast_addr, - bcast_scope, 2); + b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr, + bcast_scope, 2); } b_ptr->publ.lock = SPIN_LOCK_UNLOCKED; - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); info("Enabled bearer <%s>, discovery domain %s, priority %u\n", name, addr_string_fill(addr_string, bcast_scope), priority); return 0; failed: - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); return res; } @@ -576,11 +576,11 @@ int tipc_block_bearer(const char *name) if (tipc_mode != TIPC_NET_MODE) return -ENOPROTOOPT; - read_lock_bh(&net_lock); + read_lock_bh(&tipc_net_lock); b_ptr = bearer_find(name); if (!b_ptr) { warn("Attempt to block unknown bearer <%s>\n", name); - read_unlock_bh(&net_lock); + read_unlock_bh(&tipc_net_lock); return -EINVAL; } @@ -590,11 +590,11 @@ int tipc_block_bearer(const char *name) struct node *n_ptr = l_ptr->owner; spin_lock_bh(&n_ptr->lock); - link_reset(l_ptr); + tipc_link_reset(l_ptr); spin_unlock_bh(&n_ptr->lock); } spin_unlock_bh(&b_ptr->publ.lock); - read_unlock_bh(&net_lock); + read_unlock_bh(&tipc_net_lock); info("Blocked bearer <%s>\n", name); return TIPC_OK; } @@ -602,7 +602,7 @@ int tipc_block_bearer(const char *name) /** * bearer_disable - * - * Note: This routine assumes caller holds net_lock. + * Note: This routine assumes caller holds tipc_net_lock. */ static int bearer_disable(const char *name) @@ -620,19 +620,19 @@ static int bearer_disable(const char *name) return -EINVAL; } - disc_stop_link_req(b_ptr->link_req); + tipc_disc_stop_link_req(b_ptr->link_req); spin_lock_bh(&b_ptr->publ.lock); b_ptr->link_req = NULL; b_ptr->publ.blocked = 1; if (b_ptr->media->disable_bearer) { spin_unlock_bh(&b_ptr->publ.lock); - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); b_ptr->media->disable_bearer(&b_ptr->publ); - write_lock_bh(&net_lock); + write_lock_bh(&tipc_net_lock); spin_lock_bh(&b_ptr->publ.lock); } list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { - link_delete(l_ptr); + tipc_link_delete(l_ptr); } spin_unlock_bh(&b_ptr->publ.lock); info("Disabled bearer <%s>\n", name); @@ -644,54 +644,54 @@ int tipc_disable_bearer(const char *name) { int res; - write_lock_bh(&net_lock); + write_lock_bh(&tipc_net_lock); res = bearer_disable(name); - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); return res; } -int bearer_init(void) +int tipc_bearer_init(void) { int res; - write_lock_bh(&net_lock); - bearers = kmalloc(MAX_BEARERS * sizeof(struct bearer), GFP_ATOMIC); + write_lock_bh(&tipc_net_lock); + tipc_bearers = kmalloc(MAX_BEARERS * sizeof(struct bearer), GFP_ATOMIC); media_list = kmalloc(MAX_MEDIA * sizeof(struct media), GFP_ATOMIC); - if (bearers && media_list) { - memset(bearers, 0, MAX_BEARERS * sizeof(struct bearer)); + if (tipc_bearers && media_list) { + memset(tipc_bearers, 0, MAX_BEARERS * sizeof(struct bearer)); memset(media_list, 0, MAX_MEDIA * sizeof(struct media)); res = TIPC_OK; } else { - kfree(bearers); + kfree(tipc_bearers); kfree(media_list); - bearers = 0; + tipc_bearers = 0; media_list = 0; res = -ENOMEM; } - write_unlock_bh(&net_lock); + write_unlock_bh(&tipc_net_lock); return res; } -void bearer_stop(void) +void tipc_bearer_stop(void) { u32 i; - if (!bearers) + if (!tipc_bearers) return; for (i = 0; i < MAX_BEARERS; i++) { - if (bearers[i].active) - bearers[i].publ.blocked = 1; + if (tipc_bearers[i].active) + tipc_bearers[i].publ.blocked = 1; } for (i = 0; i < MAX_BEARERS; i++) { - if (bearers[i].active) - bearer_disable(bearers[i].publ.name); + if (tipc_bearers[i].active) + bearer_disable(tipc_bearers[i].publ.name); } - kfree(bearers); + kfree(tipc_bearers); kfree(media_list); - bearers = 0; + tipc_bearers = 0; media_list = 0; media_count = 0; } diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 0c40cc2b43cc..c4e7c1c3655b 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h @@ -114,26 +114,24 @@ struct bearer_name { struct link; -extern struct bearer *bearers; +extern struct bearer *tipc_bearers; -void media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a); -struct sk_buff *media_get_names(void); +void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a); +struct sk_buff *tipc_media_get_names(void); -struct sk_buff *bearer_get_names(void); -void bearer_add_dest(struct bearer *b_ptr, u32 dest); -void bearer_remove_dest(struct bearer *b_ptr, u32 dest); -void bearer_schedule(struct bearer *b_ptr, struct link *l_ptr); -struct bearer *bearer_find_interface(const char *if_name); -int bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr); -int bearer_init(void); -void bearer_stop(void); -int bearer_broadcast(struct sk_buff *buf, struct tipc_bearer *b_ptr, - struct tipc_media_addr *dest); -void bearer_lock_push(struct bearer *b_ptr); +struct sk_buff *tipc_bearer_get_names(void); +void tipc_bearer_add_dest(struct bearer *b_ptr, u32 dest); +void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest); +void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr); +struct bearer *tipc_bearer_find_interface(const char *if_name); +int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr); +int tipc_bearer_init(void); +void tipc_bearer_stop(void); +void tipc_bearer_lock_push(struct bearer *b_ptr); /** - * bearer_send- sends buffer to destination over bearer + * tipc_bearer_send- sends buffer to destination over bearer * * Returns true (1) if successful, or false (0) if unable to send * @@ -150,23 +148,23 @@ void bearer_lock_push(struct bearer *b_ptr); * and let TIPC's link code deal with the undelivered message. */ -static inline int bearer_send(struct bearer *b_ptr, struct sk_buff *buf, - struct tipc_media_addr *dest) +static inline int tipc_bearer_send(struct bearer *b_ptr, struct sk_buff *buf, + struct tipc_media_addr *dest) { return !b_ptr->media->send_msg(buf, &b_ptr->publ, dest); } /** - * bearer_congested - determines if bearer is currently congested + * tipc_bearer_congested - determines if bearer is currently congested */ -static inline int bearer_congested(struct bearer *b_ptr, struct link *l_ptr) +static inline int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr) { if (unlikely(b_ptr->publ.blocked)) return 1; if (likely(list_empty(&b_ptr->cong_links))) return 0; - return !bearer_resolve_congestion(b_ptr, l_ptr); + return !tipc_bearer_resolve_congestion(b_ptr, l_ptr); } #endif diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c index f0f7bac51d41..ab974ca19371 100644 --- a/net/tipc/cluster.c +++ b/net/tipc/cluster.c @@ -44,15 +44,15 @@ #include "msg.h" #include "bearer.h" -void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, - u32 lower, u32 upper); -struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest); +void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, + u32 lower, u32 upper); +struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); -struct node **local_nodes = 0; -struct node_map cluster_bcast_nodes = {0,{0,}}; -u32 highest_allowed_slave = 0; +struct node **tipc_local_nodes = 0; +struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; +u32 tipc_highest_allowed_slave = 0; -struct cluster *cluster_create(u32 addr) +struct cluster *tipc_cltr_create(u32 addr) { struct _zone *z_ptr; struct cluster *c_ptr; @@ -77,16 +77,16 @@ struct cluster *cluster_create(u32 addr) } memset(c_ptr->nodes, 0, alloc); if (in_own_cluster(addr)) - local_nodes = c_ptr->nodes; + tipc_local_nodes = c_ptr->nodes; c_ptr->highest_slave = LOWEST_SLAVE - 1; c_ptr->highest_node = 0; - z_ptr = zone_find(tipc_zone(addr)); + z_ptr = tipc_zone_find(tipc_zone(addr)); if (z_ptr == NULL) { - z_ptr = zone_create(addr); + z_ptr = tipc_zone_create(addr); } if (z_ptr != NULL) { - zone_attach_cluster(z_ptr, c_ptr); + tipc_zone_attach_cluster(z_ptr, c_ptr); c_ptr->owner = z_ptr; } else { @@ -97,23 +97,23 @@ struct cluster *cluster_create(u32 addr) return c_ptr; } -void cluster_delete(struct cluster *c_ptr) +void tipc_cltr_delete(struct cluster *c_ptr) { u32 n_num; if (!c_ptr) return; for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) { - node_delete(c_ptr->nodes[n_num]); + tipc_node_delete(c_ptr->nodes[n_num]); } for (n_num = LOWEST_SLAVE; n_num <= c_ptr->highest_slave; n_num++) { - node_delete(c_ptr->nodes[n_num]); + tipc_node_delete(c_ptr->nodes[n_num]); } kfree(c_ptr->nodes); kfree(c_ptr); } -u32 cluster_next_node(struct cluster *c_ptr, u32 addr) +u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) { struct node *n_ptr; u32 n_num = tipc_node(addr) + 1; @@ -122,24 +122,24 @@ u32 cluster_next_node(struct cluster *c_ptr, u32 addr) return addr; for (; n_num <= c_ptr->highest_node; n_num++) { n_ptr = c_ptr->nodes[n_num]; - if (n_ptr && node_has_active_links(n_ptr)) + if (n_ptr && tipc_node_has_active_links(n_ptr)) return n_ptr->addr; } for (n_num = 1; n_num < tipc_node(addr); n_num++) { n_ptr = c_ptr->nodes[n_num]; - if (n_ptr && node_has_active_links(n_ptr)) + if (n_ptr && tipc_node_has_active_links(n_ptr)) return n_ptr->addr; } return 0; } -void cluster_attach_node(struct cluster *c_ptr, struct node *n_ptr) +void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) { u32 n_num = tipc_node(n_ptr->addr); u32 max_n_num = tipc_max_nodes; if (in_own_cluster(n_ptr->addr)) - max_n_num = highest_allowed_slave; + max_n_num = tipc_highest_allowed_slave; assert(n_num > 0); assert(n_num <= max_n_num); assert(c_ptr->nodes[n_num] == 0); @@ -149,12 +149,12 @@ void cluster_attach_node(struct cluster *c_ptr, struct node *n_ptr) } /** - * cluster_select_router - select router to a cluster + * tipc_cltr_select_router - select router to a cluster * * Uses deterministic and fair algorithm. */ -u32 cluster_select_router(struct cluster *c_ptr, u32 ref) +u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) { u32 n_num; u32 ulim = c_ptr->highest_node; @@ -174,29 +174,29 @@ u32 cluster_select_router(struct cluster *c_ptr, u32 ref) /* Lookup upwards with wrap-around */ do { - if (node_is_up(c_ptr->nodes[n_num])) + if (tipc_node_is_up(c_ptr->nodes[n_num])) break; } while (++n_num <= ulim); if (n_num > ulim) { n_num = 1; do { - if (node_is_up(c_ptr->nodes[n_num])) + if (tipc_node_is_up(c_ptr->nodes[n_num])) break; } while (++n_num < tstart); if (n_num == tstart) return 0; } assert(n_num <= ulim); - return node_select_router(c_ptr->nodes[n_num], ref); + return tipc_node_select_router(c_ptr->nodes[n_num], ref); } /** - * cluster_select_node - select destination node within a remote cluster + * tipc_cltr_select_node - select destination node within a remote cluster * * Uses deterministic and fair algorithm. */ -struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) +struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) { u32 n_num; u32 mask = tipc_max_nodes; @@ -215,11 +215,11 @@ struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) /* Lookup upwards with wrap-around */ for (n_num = start_entry; n_num <= c_ptr->highest_node; n_num++) { - if (node_has_active_links(c_ptr->nodes[n_num])) + if (tipc_node_has_active_links(c_ptr->nodes[n_num])) return c_ptr->nodes[n_num]; } for (n_num = 1; n_num < start_entry; n_num++) { - if (node_has_active_links(c_ptr->nodes[n_num])) + if (tipc_node_has_active_links(c_ptr->nodes[n_num])) return c_ptr->nodes[n_num]; } return 0; @@ -229,7 +229,7 @@ struct node *cluster_select_node(struct cluster *c_ptr, u32 selector) * Routing table management: See description in node.c */ -struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest) +struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest) { u32 size = INT_H_SIZE + data_size; struct sk_buff *buf = buf_acquire(size); @@ -243,39 +243,39 @@ struct sk_buff *cluster_prepare_routing_msg(u32 data_size, u32 dest) return buf; } -void cluster_bcast_new_route(struct cluster *c_ptr, u32 dest, +void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lower, u32 upper) { - struct sk_buff *buf = cluster_prepare_routing_msg(0, c_ptr->addr); + struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); struct tipc_msg *msg; if (buf) { msg = buf_msg(buf); msg_set_remote_node(msg, dest); msg_set_type(msg, ROUTE_ADDITION); - cluster_multicast(c_ptr, buf, lower, upper); + tipc_cltr_multicast(c_ptr, buf, lower, upper); } else { warn("Memory squeeze: broadcast of new route failed\n"); } } -void cluster_bcast_lost_route(struct cluster *c_ptr, u32 dest, - u32 lower, u32 upper) +void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, + u32 lower, u32 upper) { - struct sk_buff *buf = cluster_prepare_routing_msg(0, c_ptr->addr); + struct sk_buff *buf = tipc_cltr_prepare_routing_msg(0, c_ptr->addr); struct tipc_msg *msg; if (buf) { msg = buf_msg(buf); msg_set_remote_node(msg, dest); msg_set_type(msg, ROUTE_REMOVAL); - cluster_multicast(c_ptr, buf, lower, upper); + tipc_cltr_multicast(c_ptr, buf, lower, upper); } else { warn("Memory squeeze: broadcast of lost route failed\n"); } } -void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) +void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest) { struct sk_buff *buf; struct tipc_msg *msg; @@ -288,21 +288,21 @@ void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) assert(in_own_cluster(c_ptr->addr)); if (highest <= LOWEST_SLAVE) return; - buf = cluster_prepare_routing_msg(highest - LOWEST_SLAVE + 1, - c_ptr->addr); + buf = tipc_cltr_prepare_routing_msg(highest - LOWEST_SLAVE + 1, + c_ptr->addr); if (buf) { msg = buf_msg(buf); msg_set_remote_node(msg, c_ptr->addr); msg_set_type(msg, SLAVE_ROUTING_TABLE); for (n_num = LOWEST_SLAVE; n_num <= highest; n_num++) { if (c_ptr->nodes[n_num] && - node_has_active_links(c_ptr->nodes[n_num])) { + tipc_node_has_active_links(c_ptr->nodes[n_num])) { send = 1; msg_set_dataoctet(msg, n_num); } } if (send) - link_send(buf, dest, dest); + tipc_link_send(buf, dest, dest); else buf_discard(buf); } else { @@ -310,7 +310,7 @@ void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest) } } -void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) +void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest) { struct sk_buff *buf; struct tipc_msg *msg; @@ -323,20 +323,20 @@ void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) assert(!is_slave(dest)); assert(in_own_cluster(dest)); highest = c_ptr->highest_node; - buf = cluster_prepare_routing_msg(highest + 1, c_ptr->addr); + buf = tipc_cltr_prepare_routing_msg(highest + 1, c_ptr->addr); if (buf) { msg = buf_msg(buf); msg_set_remote_node(msg, c_ptr->addr); msg_set_type(msg, EXT_ROUTING_TABLE); for (n_num = 1; n_num <= highest; n_num++) { if (c_ptr->nodes[n_num] && - node_has_active_links(c_ptr->nodes[n_num])) { + tipc_node_has_active_links(c_ptr->nodes[n_num])) { send = 1; msg_set_dataoctet(msg, n_num); } } if (send) - link_send(buf, dest, dest); + tipc_link_send(buf, dest, dest); else buf_discard(buf); } else { @@ -344,7 +344,7 @@ void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest) } } -void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) +void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest) { struct sk_buff *buf; struct tipc_msg *msg; @@ -354,20 +354,20 @@ void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) assert(is_slave(dest)); assert(in_own_cluster(c_ptr->addr)); - buf = cluster_prepare_routing_msg(highest, c_ptr->addr); + buf = tipc_cltr_prepare_routing_msg(highest, c_ptr->addr); if (buf) { msg = buf_msg(buf); msg_set_remote_node(msg, c_ptr->addr); msg_set_type(msg, LOCAL_ROUTING_TABLE); for (n_num = 1; n_num <= highest; n_num++) { if (c_ptr->nodes[n_num] && - node_has_active_links(c_ptr->nodes[n_num])) { + tipc_node_has_active_links(c_ptr->nodes[n_num])) { send = 1; msg_set_dataoctet(msg, n_num); } } if (send) - link_send(buf, dest, dest); + tipc_link_send(buf, dest, dest); else buf_discard(buf); } else { @@ -375,7 +375,7 @@ void cluster_send_local_routes(struct cluster *c_ptr, u32 dest) } } -void cluster_recv_routing_table(struct sk_buff *buf) +void tipc_cltr_recv_routing_table(struct sk_buff *buf) { struct tipc_msg *msg = buf_msg(buf); struct cluster *c_ptr; @@ -388,9 +388,9 @@ void cluster_recv_routing_table(struct sk_buff *buf) u32 c_num; u32 n_num; - c_ptr = cluster_find(rem_node); + c_ptr = tipc_cltr_find(rem_node); if (!c_ptr) { - c_ptr = cluster_create(rem_node); + c_ptr = tipc_cltr_create(rem_node); if (!c_ptr) { buf_discard(buf); return; @@ -412,10 +412,10 @@ void cluster_recv_routing_table(struct sk_buff *buf) u32 addr = tipc_addr(z_num, c_num, n_num); n_ptr = c_ptr->nodes[n_num]; if (!n_ptr) { - n_ptr = node_create(addr); + n_ptr = tipc_node_create(addr); } if (n_ptr) - node_add_router(n_ptr, router); + tipc_node_add_router(n_ptr, router); } } break; @@ -428,10 +428,10 @@ void cluster_recv_routing_table(struct sk_buff *buf) u32 addr = tipc_addr(z_num, c_num, slave_num); n_ptr = c_ptr->nodes[slave_num]; if (!n_ptr) { - n_ptr = node_create(addr); + n_ptr = tipc_node_create(addr); } if (n_ptr) - node_add_router(n_ptr, router); + tipc_node_add_router(n_ptr, router); } } break; @@ -445,9 +445,9 @@ void cluster_recv_routing_table(struct sk_buff *buf) } n_ptr = c_ptr->nodes[tipc_node(rem_node)]; if (!n_ptr) - n_ptr = node_create(rem_node); + n_ptr = tipc_node_create(rem_node); if (n_ptr) - node_add_router(n_ptr, router); + tipc_node_add_router(n_ptr, router); break; case ROUTE_REMOVAL: if (!is_slave(tipc_own_addr)) { @@ -459,7 +459,7 @@ void cluster_recv_routing_table(struct sk_buff *buf) } n_ptr = c_ptr->nodes[tipc_node(rem_node)]; if (n_ptr) - node_remove_router(n_ptr, router); + tipc_node_remove_router(n_ptr, router); break; default: assert(!"Illegal routing manager message received\n"); @@ -467,7 +467,7 @@ void cluster_recv_routing_table(struct sk_buff *buf) buf_discard(buf); } -void cluster_remove_as_router(struct cluster *c_ptr, u32 router) +void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router) { u32 start_entry; u32 tstop; @@ -486,17 +486,17 @@ void cluster_remove_as_router(struct cluster *c_ptr, u32 router) for (n_num = start_entry; n_num <= tstop; n_num++) { if (c_ptr->nodes[n_num]) { - node_remove_router(c_ptr->nodes[n_num], router); + tipc_node_remove_router(c_ptr->nodes[n_num], router); } } } /** - * cluster_multicast - multicast message to local nodes + * tipc_cltr_multicast - multicast message to local nodes */ -void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, - u32 lower, u32 upper) +void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, + u32 lower, u32 upper) { struct sk_buff *buf_copy; struct node *n_ptr; @@ -505,9 +505,9 @@ void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, assert(lower <= upper); assert(((lower >= 1) && (lower <= tipc_max_nodes)) || - ((lower >= LOWEST_SLAVE) && (lower <= highest_allowed_slave))); + ((lower >= LOWEST_SLAVE) && (lower <= tipc_highest_allowed_slave))); assert(((upper >= 1) && (upper <= tipc_max_nodes)) || - ((upper >= LOWEST_SLAVE) && (upper <= highest_allowed_slave))); + ((upper >= LOWEST_SLAVE) && (upper <= tipc_highest_allowed_slave))); assert(in_own_cluster(c_ptr->addr)); tstop = is_slave(upper) ? c_ptr->highest_slave : c_ptr->highest_node; @@ -515,22 +515,22 @@ void cluster_multicast(struct cluster *c_ptr, struct sk_buff *buf, tstop = upper; for (n_num = lower; n_num <= tstop; n_num++) { n_ptr = c_ptr->nodes[n_num]; - if (n_ptr && node_has_active_links(n_ptr)) { + if (n_ptr && tipc_node_has_active_links(n_ptr)) { buf_copy = skb_copy(buf, GFP_ATOMIC); if (buf_copy == NULL) break; msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); - link_send(buf_copy, n_ptr->addr, n_ptr->addr); + tipc_link_send(buf_copy, n_ptr->addr, n_ptr->addr); } } buf_discard(buf); } /** - * cluster_broadcast - broadcast message to all nodes within cluster + * tipc_cltr_broadcast - broadcast message to all nodes within cluster */ -void cluster_broadcast(struct sk_buff *buf) +void tipc_cltr_broadcast(struct sk_buff *buf) { struct sk_buff *buf_copy; struct cluster *c_ptr; @@ -541,7 +541,7 @@ void cluster_broadcast(struct sk_buff *buf) u32 node_type; if (tipc_mode == TIPC_NET_MODE) { - c_ptr = cluster_find(tipc_own_addr); + c_ptr = tipc_cltr_find(tipc_own_addr); assert(in_own_cluster(c_ptr->addr)); /* For now */ /* Send to standard nodes, then repeat loop sending to slaves */ @@ -550,14 +550,14 @@ void cluster_broadcast(struct sk_buff *buf) for (node_type = 1; node_type <= 2; node_type++) { for (n_num = tstart; n_num <= tstop; n_num++) { n_ptr = c_ptr->nodes[n_num]; - if (n_ptr && node_has_active_links(n_ptr)) { + if (n_ptr && tipc_node_has_active_links(n_ptr)) { buf_copy = skb_copy(buf, GFP_ATOMIC); if (buf_copy == NULL) goto exit; msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); - link_send(buf_copy, n_ptr->addr, - n_ptr->addr); + tipc_link_send(buf_copy, n_ptr->addr, + n_ptr->addr); } } tstart = LOWEST_SLAVE; @@ -568,9 +568,9 @@ exit: buf_discard(buf); } -int cluster_init(void) +int tipc_cltr_init(void) { - highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves; - return cluster_create(tipc_own_addr) ? TIPC_OK : -ENOMEM; + tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves; + return tipc_cltr_create(tipc_own_addr) ? TIPC_OK : -ENOMEM; } diff --git a/net/tipc/cluster.h b/net/tipc/cluster.h index 1ffb095991df..9963642e1058 100644 --- a/net/tipc/cluster.h +++ b/net/tipc/cluster.h @@ -60,29 +60,29 @@ struct cluster { }; -extern struct node **local_nodes; -extern u32 highest_allowed_slave; -extern struct node_map cluster_bcast_nodes; +extern struct node **tipc_local_nodes; +extern u32 tipc_highest_allowed_slave; +extern struct node_map tipc_cltr_bcast_nodes; -void cluster_remove_as_router(struct cluster *c_ptr, u32 router); -void cluster_send_ext_routes(struct cluster *c_ptr, u32 dest); -struct node *cluster_select_node(struct cluster *c_ptr, u32 selector); -u32 cluster_select_router(struct cluster *c_ptr, u32 ref); -void cluster_recv_routing_table(struct sk_buff *buf); -struct cluster *cluster_create(u32 addr); -void cluster_delete(struct cluster *c_ptr); -void cluster_attach_node(struct cluster *c_ptr, struct node *n_ptr); -void cluster_send_slave_routes(struct cluster *c_ptr, u32 dest); -void cluster_broadcast(struct sk_buff *buf); -int cluster_init(void); -u32 cluster_next_node(struct cluster *c_ptr, u32 addr); -void cluster_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); -void cluster_send_local_routes(struct cluster *c_ptr, u32 dest); -void cluster_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); +void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); +void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); +struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); +u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); +void tipc_cltr_recv_routing_table(struct sk_buff *buf); +struct cluster *tipc_cltr_create(u32 addr); +void tipc_cltr_delete(struct cluster *c_ptr); +void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr); +void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); +void tipc_cltr_broadcast(struct sk_buff *buf); +int tipc_cltr_init(void); +u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr); +void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); +void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest); +void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); -static inline struct cluster *cluster_find(u32 addr) +static inline struct cluster *tipc_cltr_find(u32 addr) { - struct _zone *z_ptr = zone_find(addr); + struct _zone *z_ptr = tipc_zone_find(addr); if (z_ptr) return z_ptr->clusters[1]; diff --git a/net/tipc/config.c b/net/tipc/config.c index 8ddef4fce2c2..3c8e6740e5ae 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c @@ -70,13 +70,13 @@ static int req_tlv_space; /* request message TLV area size */ static int rep_headroom; /* reply message headroom to use */ -void cfg_link_event(u32 addr, char *name, int up) +void tipc_cfg_link_event(u32 addr, char *name, int up) { /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */ } -struct sk_buff *cfg_reply_alloc(int payload_size) +struct sk_buff *tipc_cfg_reply_alloc(int payload_size) { struct sk_buff *buf; @@ -86,14 +86,14 @@ struct sk_buff *cfg_reply_alloc(int payload_size) return buf; } -int cfg_append_tlv(struct sk_buff *buf, int tlv_type, - void *tlv_data, int tlv_data_size) +int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type, + void *tlv_data, int tlv_data_size) { struct tlv_desc *tlv = (struct tlv_desc *)buf->tail; int new_tlv_space = TLV_SPACE(tlv_data_size); if (skb_tailroom(buf) < new_tlv_space) { - dbg("cfg_append_tlv unable to append TLV\n"); + dbg("tipc_cfg_append_tlv unable to append TLV\n"); return 0; } skb_put(buf, new_tlv_space); @@ -104,28 +104,28 @@ int cfg_append_tlv(struct sk_buff *buf, int tlv_type, return 1; } -struct sk_buff *cfg_reply_unsigned_type(u16 tlv_type, u32 value) +struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value) { struct sk_buff *buf; u32 value_net; - buf = cfg_reply_alloc(TLV_SPACE(sizeof(value))); + buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(value))); if (buf) { value_net = htonl(value); - cfg_append_tlv(buf, tlv_type, &value_net, - sizeof(value_net)); + tipc_cfg_append_tlv(buf, tlv_type, &value_net, + sizeof(value_net)); } return buf; } -struct sk_buff *cfg_reply_string_type(u16 tlv_type, char *string) +struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string) { struct sk_buff *buf; int string_len = strlen(string) + 1; - buf = cfg_reply_alloc(TLV_SPACE(string_len)); + buf = tipc_cfg_reply_alloc(TLV_SPACE(string_len)); if (buf) - cfg_append_tlv(buf, tlv_type, string, string_len); + tipc_cfg_append_tlv(buf, tlv_type, string, string_len); return buf; } @@ -246,7 +246,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg, exit: rmsg.result_len = htonl(msg_sect[1].iov_len); rmsg.retval = htonl(rv); - cfg_respond(msg_sect, 2u, orig); + tipc_cfg_respond(msg_sect, 2u, orig); } #endif @@ -255,26 +255,26 @@ static struct sk_buff *cfg_enable_bearer(void) struct tipc_bearer_config *args; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_CONFIG)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area); if (tipc_enable_bearer(args->name, ntohl(args->detect_scope), ntohl(args->priority))) - return cfg_reply_error_string("unable to enable bearer"); + return tipc_cfg_reply_error_string("unable to enable bearer"); - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_disable_bearer(void) { if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_NAME)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); if (tipc_disable_bearer((char *)TLV_DATA(req_tlv_area))) - return cfg_reply_error_string("unable to disable bearer"); + return tipc_cfg_reply_error_string("unable to disable bearer"); - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_set_own_addr(void) @@ -282,25 +282,25 @@ static struct sk_buff *cfg_set_own_addr(void) u32 addr; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); addr = *(u32 *)TLV_DATA(req_tlv_area); addr = ntohl(addr); if (addr == tipc_own_addr) - return cfg_reply_none(); - if (!addr_node_valid(addr)) - return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE - " (node address)"); + return tipc_cfg_reply_none(); + if (!tipc_addr_node_valid(addr)) + return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE + " (node address)"); if (tipc_own_addr) - return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED - " (cannot change node address once assigned)"); + return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED + " (cannot change node address once assigned)"); spin_unlock_bh(&config_lock); - stop_net(); + tipc_core_stop_net(); tipc_own_addr = addr; - start_net(); + tipc_core_start_net(); spin_lock_bh(&config_lock); - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_set_remote_mng(void) @@ -308,12 +308,12 @@ static struct sk_buff *cfg_set_remote_mng(void) u32 value; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); value = *(u32 *)TLV_DATA(req_tlv_area); value = ntohl(value); tipc_remote_management = (value != 0); - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_set_max_publications(void) @@ -321,15 +321,15 @@ static struct sk_buff *cfg_set_max_publications(void) u32 value; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); value = *(u32 *)TLV_DATA(req_tlv_area); value = ntohl(value); if (value != delimit(value, 1, 65535)) - return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE - " (max publications must be 1-65535)"); + return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE + " (max publications must be 1-65535)"); tipc_max_publications = value; - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_set_max_subscriptions(void) @@ -337,15 +337,15 @@ static struct sk_buff *cfg_set_max_subscriptions(void) u32 value; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); value = *(u32 *)TLV_DATA(req_tlv_area); value = ntohl(value); if (value != delimit(value, 1, 65535)) - return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE - " (max subscriptions must be 1-65535"); + return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE + " (max subscriptions must be 1-65535"); tipc_max_subscriptions = value; - return cfg_reply_none(); + return tipc_cfg_reply_none(); } static struct sk_buff *cfg_set_max_ports(void) @@ -354,31 +354,31 @@ static struct sk_buff *cfg_set_max_ports(void) u32 value; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) - return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); + return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); value = *(u32 *)TLV_DATA(req_tlv_area); value = ntohl(value); if (value != delimit(value, 127, 65535)) - return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE - " (max ports must be 127-65535)"); + return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE + " (max ports must be 127-65535)"); if (value == tipc_max_ports) - return cfg_reply_none(); + return tipc_cfg_reply_none(); if (atomic_read(&tipc_user_count) > 2) - return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED - " (cannot change max ports while TIPC users exist)"); + return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED + " (cannot change max ports while TIPC users exist)"); spin_unlock_bh(&config_lock); orig_mode = tipc_get_mode(); if (orig_mode == TIPC_NET_MODE) - stop_net(); - stop_core(); + tipc_core_stop_net(); + tipc_core_stop(); tipc_max_ports = value; - s