Skip to content

Commit

Permalink
tipc: Don't use structure names which easily globally conflict.
Browse files Browse the repository at this point in the history
Andrew Morton reported a build failure on sparc32, because TIPC
uses names like "struct node" and there is a like named data
structure defined in linux/node.h

This just regexp replaces "struct node*" to "struct tipc_node*"
to avoid this and any future similar problems.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Sep 3, 2008
1 parent 37b08e3 commit 6c00055
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 117 deletions.
22 changes: 11 additions & 11 deletions net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ struct bcbearer {
struct media media;
struct bcbearer_pair bpairs[MAX_BEARERS];
struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];
struct node_map remains;
struct node_map remains_new;
struct tipc_node_map remains;
struct tipc_node_map remains_new;
};

/**
Expand All @@ -110,7 +110,7 @@ struct bcbearer {

struct bclink {
struct link link;
struct node node;
struct tipc_node node;
};


Expand Down Expand Up @@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf)
* Called with 'node' locked, bc_lock unlocked
*/

static void bclink_set_gap(struct node *n_ptr)
static void bclink_set_gap(struct tipc_node *n_ptr)
{
struct sk_buff *buf = n_ptr->bclink.deferred_head;

Expand Down Expand Up @@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to)
* Node is locked, bc_lock unlocked.
*/

void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked)
void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
{
struct sk_buff *crs;
struct sk_buff *next;
Expand Down Expand Up @@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked)
* tipc_net_lock and node lock set
*/

static void bclink_send_ack(struct node *n_ptr)
static void bclink_send_ack(struct tipc_node *n_ptr)
{
struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];

Expand All @@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr)
* tipc_net_lock and node lock set
*/

static void bclink_send_nack(struct node *n_ptr)
static void bclink_send_nack(struct tipc_node *n_ptr)
{
struct sk_buff *buf;
struct tipc_msg *msg;
Expand Down Expand Up @@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr)
* tipc_net_lock and node lock set
*/

void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent)
void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 last_sent)
{
if (!n_ptr->bclink.supported ||
less_eq(last_sent, mod(n_ptr->bclink.last_in)))
Expand All @@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent)

static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to)
{
struct node *n_ptr = tipc_node_find(dest);
struct tipc_node *n_ptr = tipc_node_find(dest);
u32 my_after, my_to;

if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr)))
Expand Down Expand Up @@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
static int rx_count = 0;
#endif
struct tipc_msg *msg = buf_msg(buf);
struct node* node = tipc_node_find(msg_prevnode(msg));
struct tipc_node* node = tipc_node_find(msg_prevnode(msg));
u32 next_in;
u32 seqno;
struct sk_buff *deferred;
Expand Down Expand Up @@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void)
return last_sent;
}

u32 tipc_bclink_acks_missing(struct node *n_ptr)
u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
{
return (n_ptr->bclink.supported &&
(tipc_bclink_get_last_sent() != n_ptr->bclink.acked));
Expand Down
22 changes: 11 additions & 11 deletions net/tipc/bcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
#define WSIZE 32

/**
* struct node_map - set of node identifiers
* struct tipc_node_map - set of node identifiers
* @count: # of nodes in set
* @map: bitmap of node identifiers that are in the set
*/

struct node_map {
struct tipc_node_map {
u32 count;
u32 map[MAX_NODES / WSIZE];
};
Expand All @@ -68,7 +68,7 @@ struct port_list {
};


struct node;
struct tipc_node;

extern char tipc_bclink_name[];

Expand All @@ -77,7 +77,7 @@ extern char tipc_bclink_name[];
* nmap_add - add a node to a node map
*/

static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node)
static inline void tipc_nmap_add(struct tipc_node_map *nm_ptr, u32 node)
{
int n = tipc_node(node);
int w = n / WSIZE;
Expand All @@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node)
* nmap_remove - remove a node from a node map
*/

static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node)
static inline void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node)
{
int n = tipc_node(node);
int w = n / WSIZE;
Expand All @@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node)
* nmap_equal - test for equality of node maps
*/

static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b)
static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b)
{
return !memcmp(nm_a, nm_b, sizeof(*nm_a));
}
Expand All @@ -121,8 +121,8 @@ static inline int tipc_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 tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b,
struct node_map *nm_diff)
static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
struct tipc_node_map *nm_diff)
{
int stop = sizeof(nm_a->map) / sizeof(u32);
int w;
Expand Down Expand Up @@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr)

int tipc_bclink_init(void);
void tipc_bclink_stop(void);
void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked);
void tipc_bclink_acknowledge(struct tipc_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);
u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr);
void tipc_bclink_check_gap(struct tipc_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);
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name)
spin_lock_bh(&b_ptr->publ.lock);
b_ptr->publ.blocked = 1;
list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
struct node *n_ptr = l_ptr->owner;
struct tipc_node *n_ptr = l_ptr->owner;

spin_lock_bh(&n_ptr->lock);
tipc_link_reset(l_ptr);
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/bearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct bearer {
u32 continue_count;
int active;
char net_plane;
struct node_map nodes;
struct tipc_node_map nodes;
};

struct bearer_name {
Expand Down
16 changes: 8 additions & 8 deletions net/tipc/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
u32 lower, u32 upper);
static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);

struct node **tipc_local_nodes = NULL;
struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
struct tipc_node **tipc_local_nodes = NULL;
struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}};
u32 tipc_highest_allowed_slave = 0;

struct cluster *tipc_cltr_create(u32 addr)
Expand Down Expand Up @@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr)

u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
{
struct node *n_ptr;
struct tipc_node *n_ptr;
u32 n_num = tipc_node(addr) + 1;

if (!c_ptr)
Expand All @@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
return 0;
}

void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
{
u32 n_num = tipc_node(n_ptr->addr);
u32 max_n_num = tipc_max_nodes;
Expand Down Expand Up @@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref)
* Uses deterministic and fair algorithm.
*/

struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
{
u32 n_num;
u32 mask = tipc_max_nodes;
Expand Down Expand Up @@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
{
struct tipc_msg *msg = buf_msg(buf);
struct cluster *c_ptr;
struct node *n_ptr;
struct tipc_node *n_ptr;
unchar *node_table;
u32 table_size;
u32 router;
Expand Down Expand Up @@ -499,7 +499,7 @@ static 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;
struct tipc_node *n_ptr;
u32 n_num;
u32 tstop;

Expand Down Expand Up @@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf)
{
struct sk_buff *buf_copy;
struct cluster *c_ptr;
struct node *n_ptr;
struct tipc_node *n_ptr;
u32 n_num;
u32 tstart;
u32 tstop;
Expand Down
10 changes: 5 additions & 5 deletions net/tipc/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@
struct cluster {
u32 addr;
struct _zone *owner;
struct node **nodes;
struct tipc_node **nodes;
u32 highest_node;
u32 highest_slave;
};


extern struct node **tipc_local_nodes;
extern struct tipc_node **tipc_local_nodes;
extern u32 tipc_highest_allowed_slave;
extern struct node_map tipc_cltr_bcast_nodes;
extern struct tipc_node_map tipc_cltr_bcast_nodes;

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);
struct tipc_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_attach_node(struct cluster *c_ptr, struct tipc_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);
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
/* Always accept link here */
struct sk_buff *rbuf;
struct tipc_media_addr *addr;
struct node *n_ptr = tipc_node_find(orig);
struct tipc_node *n_ptr = tipc_node_find(orig);
int link_fully_up;

dbg(" in own cluster\n");
Expand Down
Loading

0 comments on commit 6c00055

Please sign in to comment.