Skip to content

Commit 56be178

Browse files
committed
Merge branch 'tipc-Dec29-2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2 parents 7f8e323 + f19765f commit 56be178

File tree

18 files changed

+248
-237
lines changed

18 files changed

+248
-237
lines changed

net/tipc/bcast.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@
4646
#define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */
4747

4848
/**
49-
* struct bcbearer_pair - a pair of bearers used by broadcast link
49+
* struct tipc_bcbearer_pair - a pair of bearers used by broadcast link
5050
* @primary: pointer to primary bearer
5151
* @secondary: pointer to secondary bearer
5252
*
5353
* Bearers must have same priority and same set of reachable destinations
5454
* to be paired.
5555
*/
5656

57-
struct bcbearer_pair {
57+
struct tipc_bcbearer_pair {
5858
struct tipc_bearer *primary;
5959
struct tipc_bearer *secondary;
6060
};
6161

6262
/**
63-
* struct bcbearer - bearer used by broadcast link
63+
* struct tipc_bcbearer - bearer used by broadcast link
6464
* @bearer: (non-standard) broadcast bearer structure
6565
* @media: (non-standard) broadcast media structure
6666
* @bpairs: array of bearer pairs
@@ -74,17 +74,17 @@ struct bcbearer_pair {
7474
* prevented through use of the spinlock "bc_lock".
7575
*/
7676

77-
struct bcbearer {
77+
struct tipc_bcbearer {
7878
struct tipc_bearer bearer;
79-
struct media media;
80-
struct bcbearer_pair bpairs[MAX_BEARERS];
81-
struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];
79+
struct tipc_media media;
80+
struct tipc_bcbearer_pair bpairs[MAX_BEARERS];
81+
struct tipc_bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];
8282
struct tipc_node_map remains;
8383
struct tipc_node_map remains_new;
8484
};
8585

8686
/**
87-
* struct bclink - link used for broadcast messages
87+
* struct tipc_bclink - link used for broadcast messages
8888
* @link: (non-standard) broadcast link structure
8989
* @node: (non-standard) node structure representing b'cast link's peer node
9090
* @bcast_nodes: map of broadcast-capable nodes
@@ -93,19 +93,19 @@ struct bcbearer {
9393
* Handles sequence numbering, fragmentation, bundling, etc.
9494
*/
9595

96-
struct bclink {
97-
struct link link;
96+
struct tipc_bclink {
97+
struct tipc_link link;
9898
struct tipc_node node;
9999
struct tipc_node_map bcast_nodes;
100100
struct tipc_node *retransmit_to;
101101
};
102102

103-
static struct bcbearer bcast_bearer;
104-
static struct bclink bcast_link;
103+
static struct tipc_bcbearer bcast_bearer;
104+
static struct tipc_bclink bcast_link;
105105

106-
static struct bcbearer *bcbearer = &bcast_bearer;
107-
static struct bclink *bclink = &bcast_link;
108-
static struct link *bcl = &bcast_link.link;
106+
static struct tipc_bcbearer *bcbearer = &bcast_bearer;
107+
static struct tipc_bclink *bclink = &bcast_link;
108+
static struct tipc_link *bcl = &bcast_link.link;
109109

110110
static DEFINE_SPINLOCK(bc_lock);
111111

@@ -308,7 +308,7 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
308308

309309
static void bclink_send_ack(struct tipc_node *n_ptr)
310310
{
311-
struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];
311+
struct tipc_link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];
312312

313313
if (l_ptr != NULL)
314314
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
@@ -677,8 +677,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
677677

678678
void tipc_bcbearer_sort(void)
679679
{
680-
struct bcbearer_pair *bp_temp = bcbearer->bpairs_temp;
681-
struct bcbearer_pair *bp_curr;
680+
struct tipc_bcbearer_pair *bp_temp = bcbearer->bpairs_temp;
681+
struct tipc_bcbearer_pair *bp_curr;
682682
int b_index;
683683
int pri;
684684

@@ -893,9 +893,9 @@ static void tipc_nmap_diff(struct tipc_node_map *nm_a,
893893
* tipc_port_list_add - add a port to a port list, ensuring no duplicates
894894
*/
895895

896-
void tipc_port_list_add(struct port_list *pl_ptr, u32 port)
896+
void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port)
897897
{
898-
struct port_list *item = pl_ptr;
898+
struct tipc_port_list *item = pl_ptr;
899899
int i;
900900
int item_sz = PLSIZE;
901901
int cnt = pl_ptr->count;
@@ -927,10 +927,10 @@ void tipc_port_list_add(struct port_list *pl_ptr, u32 port)
927927
*
928928
*/
929929

930-
void tipc_port_list_free(struct port_list *pl_ptr)
930+
void tipc_port_list_free(struct tipc_port_list *pl_ptr)
931931
{
932-
struct port_list *item;
933-
struct port_list *next;
932+
struct tipc_port_list *item;
933+
struct tipc_port_list *next;
934934

935935
for (item = pl_ptr->next; item; item = next) {
936936
next = item->next;

net/tipc/bcast.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ struct tipc_node_map {
5454
#define PLSIZE 32
5555

5656
/**
57-
* struct port_list - set of node local destination ports
57+
* struct tipc_port_list - set of node local destination ports
5858
* @count: # of ports in set (only valid for first entry in list)
5959
* @next: pointer to next entry in list
6060
* @ports: array of port references
6161
*/
6262

63-
struct port_list {
63+
struct tipc_port_list {
6464
int count;
65-
struct port_list *next;
65+
struct tipc_port_list *next;
6666
u32 ports[PLSIZE];
6767
};
6868

@@ -83,8 +83,8 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m
8383
return !memcmp(nm_a, nm_b, sizeof(*nm_a));
8484
}
8585

86-
void tipc_port_list_add(struct port_list *pl_ptr, u32 port);
87-
void tipc_port_list_free(struct port_list *pl_ptr);
86+
void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port);
87+
void tipc_port_list_free(struct tipc_port_list *pl_ptr);
8888

8989
void tipc_bclink_init(void);
9090
void tipc_bclink_stop(void);

net/tipc/bearer.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#define MAX_ADDR_STR 32
4343

44-
static struct media *media_list[MAX_MEDIA];
44+
static struct tipc_media *media_list[MAX_MEDIA];
4545
static u32 media_count;
4646

4747
struct tipc_bearer tipc_bearers[MAX_BEARERS];
@@ -68,7 +68,7 @@ static int media_name_valid(const char *name)
6868
* tipc_media_find - locates specified media object by name
6969
*/
7070

71-
struct media *tipc_media_find(const char *name)
71+
struct tipc_media *tipc_media_find(const char *name)
7272
{
7373
u32 i;
7474

@@ -83,7 +83,7 @@ struct media *tipc_media_find(const char *name)
8383
* media_find_id - locates specified media object by type identifier
8484
*/
8585

86-
static struct media *media_find_id(u8 type)
86+
static struct tipc_media *media_find_id(u8 type)
8787
{
8888
u32 i;
8989

@@ -100,7 +100,7 @@ static struct media *media_find_id(u8 type)
100100
* Bearers for this media type must be activated separately at a later stage.
101101
*/
102102

103-
int tipc_register_media(struct media *m_ptr)
103+
int tipc_register_media(struct tipc_media *m_ptr)
104104
{
105105
int res = -EINVAL;
106106

@@ -138,7 +138,7 @@ int tipc_register_media(struct media *m_ptr)
138138
void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a)
139139
{
140140
char addr_str[MAX_ADDR_STR];
141-
struct media *m_ptr;
141+
struct tipc_media *m_ptr;
142142

143143
m_ptr = media_find_id(a->media_id);
144144

@@ -185,7 +185,7 @@ struct sk_buff *tipc_media_get_names(void)
185185
*/
186186

187187
static int bearer_name_validate(const char *name,
188-
struct bearer_name *name_parts)
188+
struct tipc_bearer_names *name_parts)
189189
{
190190
char name_copy[TIPC_MAX_BEARER_NAME];
191191
char *media_name;
@@ -318,7 +318,7 @@ void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest)
318318
static int bearer_push(struct tipc_bearer *b_ptr)
319319
{
320320
u32 res = 0;
321-
struct link *ln, *tln;
321+
struct tipc_link *ln, *tln;
322322

323323
if (b_ptr->blocked)
324324
return 0;
@@ -364,7 +364,8 @@ void tipc_continue(struct tipc_bearer *b_ptr)
364364
* bearer.lock is busy
365365
*/
366366

367-
static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link *l_ptr)
367+
static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr,
368+
struct tipc_link *l_ptr)
368369
{
369370
list_move_tail(&l_ptr->link_list, &b_ptr->cong_links);
370371
}
@@ -377,7 +378,7 @@ static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link
377378
* bearer.lock is free
378379
*/
379380

380-
void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr)
381+
void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr)
381382
{
382383
spin_lock_bh(&b_ptr->lock);
383384
tipc_bearer_schedule_unlocked(b_ptr, l_ptr);
@@ -390,7 +391,8 @@ void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr)
390391
* and if there is, try to resolve it before returning.
391392
* 'tipc_net_lock' is read_locked when this function is called
392393
*/
393-
int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr)
394+
int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr,
395+
struct tipc_link *l_ptr)
394396
{
395397
int res = 1;
396398

@@ -409,7 +411,7 @@ int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr
409411
* tipc_bearer_congested - determines if bearer is currently congested
410412
*/
411413

412-
int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr)
414+
int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr)
413415
{
414416
if (unlikely(b_ptr->blocked))
415417
return 1;
@@ -425,8 +427,8 @@ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr)
425427
int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
426428
{
427429
struct tipc_bearer *b_ptr;
428-
struct media *m_ptr;
429-
struct bearer_name b_name;
430+
struct tipc_media *m_ptr;
431+
struct tipc_bearer_names b_names;
430432
char addr_string[16];
431433
u32 bearer_id;
432434
u32 with_this_prio;
@@ -438,7 +440,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
438440
name);
439441
return -ENOPROTOOPT;
440442
}
441-
if (!bearer_name_validate(name, &b_name)) {
443+
if (!bearer_name_validate(name, &b_names)) {
442444
warn("Bearer <%s> rejected, illegal name\n", name);
443445
return -EINVAL;
444446
}
@@ -463,10 +465,10 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
463465

464466
write_lock_bh(&tipc_net_lock);
465467

466-
m_ptr = tipc_media_find(b_name.media_name);
468+
m_ptr = tipc_media_find(b_names.media_name);
467469
if (!m_ptr) {
468470
warn("Bearer <%s> rejected, media <%s> not registered\n", name,
469-
b_name.media_name);
471+
b_names.media_name);
470472
goto exit;
471473
}
472474

@@ -544,8 +546,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
544546
int tipc_block_bearer(const char *name)
545547
{
546548
struct tipc_bearer *b_ptr = NULL;
547-
struct link *l_ptr;
548-
struct link *temp_l_ptr;
549+
struct tipc_link *l_ptr;
550+
struct tipc_link *temp_l_ptr;
549551

550552
read_lock_bh(&tipc_net_lock);
551553
b_ptr = tipc_bearer_find(name);
@@ -579,8 +581,8 @@ int tipc_block_bearer(const char *name)
579581

580582
static void bearer_disable(struct tipc_bearer *b_ptr)
581583
{
582-
struct link *l_ptr;
583-
struct link *temp_l_ptr;
584+
struct tipc_link *l_ptr;
585+
struct tipc_link *temp_l_ptr;
584586

585587
info("Disabling bearer <%s>\n", b_ptr->name);
586588
spin_lock_bh(&b_ptr->lock);

net/tipc/bearer.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct tipc_media_addr {
7474
struct tipc_bearer;
7575

7676
/**
77-
* struct media - TIPC media information available to internal users
77+
* struct tipc_media - TIPC media information available to internal users
7878
* @send_msg: routine which handles buffer transmission
7979
* @enable_bearer: routine which enables a bearer
8080
* @disable_bearer: routine which disables a bearer
@@ -90,7 +90,7 @@ struct tipc_bearer;
9090
* @name: media name
9191
*/
9292

93-
struct media {
93+
struct tipc_media {
9494
int (*send_msg)(struct sk_buff *buf,
9595
struct tipc_bearer *b_ptr,
9696
struct tipc_media_addr *dest);
@@ -139,32 +139,32 @@ struct tipc_bearer {
139139
struct tipc_media_addr addr; /* initalized by media */
140140
char name[TIPC_MAX_BEARER_NAME];
141141
spinlock_t lock;
142-
struct media *media;
142+
struct tipc_media *media;
143143
u32 priority;
144144
u32 window;
145145
u32 tolerance;
146146
u32 identity;
147-
struct link_req *link_req;
147+
struct tipc_link_req *link_req;
148148
struct list_head links;
149149
struct list_head cong_links;
150150
int active;
151151
char net_plane;
152152
struct tipc_node_map nodes;
153153
};
154154

155-
struct bearer_name {
155+
struct tipc_bearer_names {
156156
char media_name[TIPC_MAX_MEDIA_NAME];
157157
char if_name[TIPC_MAX_IF_NAME];
158158
};
159159

160-
struct link;
160+
struct tipc_link;
161161

162162
extern struct tipc_bearer tipc_bearers[];
163163

164164
/*
165165
* TIPC routines available to supported media types
166166
*/
167-
int tipc_register_media(struct media *m_ptr);
167+
int tipc_register_media(struct tipc_media *m_ptr);
168168

169169
void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr);
170170

@@ -188,12 +188,13 @@ struct sk_buff *tipc_media_get_names(void);
188188
struct sk_buff *tipc_bearer_get_names(void);
189189
void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest);
190190
void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest);
191-
void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr);
191+
void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr);
192192
struct tipc_bearer *tipc_bearer_find(const char *name);
193193
struct tipc_bearer *tipc_bearer_find_interface(const char *if_name);
194-
struct media *tipc_media_find(const char *name);
195-
int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr);
196-
int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr);
194+
struct tipc_media *tipc_media_find(const char *name);
195+
int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr,
196+
struct tipc_link *l_ptr);
197+
int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr);
197198
void tipc_bearer_stop(void);
198199
void tipc_bearer_lock_push(struct tipc_bearer *b_ptr);
199200

0 commit comments

Comments
 (0)