Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c00055a authored by David S. Miller's avatar David S. Miller
Browse files

tipc: Don't use structure names which easily globally conflict.



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: default avatarDavid S. Miller <davem@davemloft.net>
parent 37b08e34
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -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;
};

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

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


@@ -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;

@@ -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;
@@ -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];

@@ -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;
@@ -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)))
@@ -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)))
@@ -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;
@@ -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));
+11 −11
Original line number Diff line number Diff line
@@ -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];
};
@@ -68,7 +68,7 @@ struct port_list {
};


struct node;
struct tipc_node;

extern char tipc_bclink_name[];

@@ -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;
@@ -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;
@@ -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));
}
@@ -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;
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+8 −8
Original line number Diff line number Diff line
@@ -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)
@@ -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)
@@ -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;
@@ -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;
@@ -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;
@@ -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;

@@ -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;
Loading