Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'tipc-Dec29-2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

+248 -237
+23 -23
net/tipc/bcast.c
··· 46 46 #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ 47 47 48 48 /** 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 50 50 * @primary: pointer to primary bearer 51 51 * @secondary: pointer to secondary bearer 52 52 * ··· 54 54 * to be paired. 55 55 */ 56 56 57 - struct bcbearer_pair { 57 + struct tipc_bcbearer_pair { 58 58 struct tipc_bearer *primary; 59 59 struct tipc_bearer *secondary; 60 60 }; 61 61 62 62 /** 63 - * struct bcbearer - bearer used by broadcast link 63 + * struct tipc_bcbearer - bearer used by broadcast link 64 64 * @bearer: (non-standard) broadcast bearer structure 65 65 * @media: (non-standard) broadcast media structure 66 66 * @bpairs: array of bearer pairs ··· 74 74 * prevented through use of the spinlock "bc_lock". 75 75 */ 76 76 77 - struct bcbearer { 77 + struct tipc_bcbearer { 78 78 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]; 82 82 struct tipc_node_map remains; 83 83 struct tipc_node_map remains_new; 84 84 }; 85 85 86 86 /** 87 - * struct bclink - link used for broadcast messages 87 + * struct tipc_bclink - link used for broadcast messages 88 88 * @link: (non-standard) broadcast link structure 89 89 * @node: (non-standard) node structure representing b'cast link's peer node 90 90 * @bcast_nodes: map of broadcast-capable nodes ··· 93 93 * Handles sequence numbering, fragmentation, bundling, etc. 94 94 */ 95 95 96 - struct bclink { 97 - struct link link; 96 + struct tipc_bclink { 97 + struct tipc_link link; 98 98 struct tipc_node node; 99 99 struct tipc_node_map bcast_nodes; 100 100 struct tipc_node *retransmit_to; 101 101 }; 102 102 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; 105 105 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; 109 109 110 110 static DEFINE_SPINLOCK(bc_lock); 111 111 ··· 308 308 309 309 static void bclink_send_ack(struct tipc_node *n_ptr) 310 310 { 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]; 312 312 313 313 if (l_ptr != NULL) 314 314 tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); ··· 677 677 678 678 void tipc_bcbearer_sort(void) 679 679 { 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; 682 682 int b_index; 683 683 int pri; 684 684 ··· 893 893 * tipc_port_list_add - add a port to a port list, ensuring no duplicates 894 894 */ 895 895 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) 897 897 { 898 - struct port_list *item = pl_ptr; 898 + struct tipc_port_list *item = pl_ptr; 899 899 int i; 900 900 int item_sz = PLSIZE; 901 901 int cnt = pl_ptr->count; ··· 927 927 * 928 928 */ 929 929 930 - void tipc_port_list_free(struct port_list *pl_ptr) 930 + void tipc_port_list_free(struct tipc_port_list *pl_ptr) 931 931 { 932 - struct port_list *item; 933 - struct port_list *next; 932 + struct tipc_port_list *item; 933 + struct tipc_port_list *next; 934 934 935 935 for (item = pl_ptr->next; item; item = next) { 936 936 next = item->next;
+5 -5
net/tipc/bcast.h
··· 54 54 #define PLSIZE 32 55 55 56 56 /** 57 - * struct port_list - set of node local destination ports 57 + * struct tipc_port_list - set of node local destination ports 58 58 * @count: # of ports in set (only valid for first entry in list) 59 59 * @next: pointer to next entry in list 60 60 * @ports: array of port references 61 61 */ 62 62 63 - struct port_list { 63 + struct tipc_port_list { 64 64 int count; 65 - struct port_list *next; 65 + struct tipc_port_list *next; 66 66 u32 ports[PLSIZE]; 67 67 }; 68 68 ··· 83 83 return !memcmp(nm_a, nm_b, sizeof(*nm_a)); 84 84 } 85 85 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); 88 88 89 89 void tipc_bclink_init(void); 90 90 void tipc_bclink_stop(void);
+22 -20
net/tipc/bearer.c
··· 41 41 42 42 #define MAX_ADDR_STR 32 43 43 44 - static struct media *media_list[MAX_MEDIA]; 44 + static struct tipc_media *media_list[MAX_MEDIA]; 45 45 static u32 media_count; 46 46 47 47 struct tipc_bearer tipc_bearers[MAX_BEARERS]; ··· 68 68 * tipc_media_find - locates specified media object by name 69 69 */ 70 70 71 - struct media *tipc_media_find(const char *name) 71 + struct tipc_media *tipc_media_find(const char *name) 72 72 { 73 73 u32 i; 74 74 ··· 83 83 * media_find_id - locates specified media object by type identifier 84 84 */ 85 85 86 - static struct media *media_find_id(u8 type) 86 + static struct tipc_media *media_find_id(u8 type) 87 87 { 88 88 u32 i; 89 89 ··· 100 100 * Bearers for this media type must be activated separately at a later stage. 101 101 */ 102 102 103 - int tipc_register_media(struct media *m_ptr) 103 + int tipc_register_media(struct tipc_media *m_ptr) 104 104 { 105 105 int res = -EINVAL; 106 106 ··· 138 138 void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) 139 139 { 140 140 char addr_str[MAX_ADDR_STR]; 141 - struct media *m_ptr; 141 + struct tipc_media *m_ptr; 142 142 143 143 m_ptr = media_find_id(a->media_id); 144 144 ··· 185 185 */ 186 186 187 187 static int bearer_name_validate(const char *name, 188 - struct bearer_name *name_parts) 188 + struct tipc_bearer_names *name_parts) 189 189 { 190 190 char name_copy[TIPC_MAX_BEARER_NAME]; 191 191 char *media_name; ··· 318 318 static int bearer_push(struct tipc_bearer *b_ptr) 319 319 { 320 320 u32 res = 0; 321 - struct link *ln, *tln; 321 + struct tipc_link *ln, *tln; 322 322 323 323 if (b_ptr->blocked) 324 324 return 0; ··· 364 364 * bearer.lock is busy 365 365 */ 366 366 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) 368 369 { 369 370 list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); 370 371 } ··· 378 377 * bearer.lock is free 379 378 */ 380 379 381 - void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr) 380 + void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) 382 381 { 383 382 spin_lock_bh(&b_ptr->lock); 384 383 tipc_bearer_schedule_unlocked(b_ptr, l_ptr); ··· 391 390 * and if there is, try to resolve it before returning. 392 391 * 'tipc_net_lock' is read_locked when this function is called 393 392 */ 394 - int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr) 393 + int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, 394 + struct tipc_link *l_ptr) 395 395 { 396 396 int res = 1; 397 397 ··· 411 409 * tipc_bearer_congested - determines if bearer is currently congested 412 410 */ 413 411 414 - int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr) 412 + int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) 415 413 { 416 414 if (unlikely(b_ptr->blocked)) 417 415 return 1; ··· 427 425 int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) 428 426 { 429 427 struct tipc_bearer *b_ptr; 430 - struct media *m_ptr; 431 - struct bearer_name b_name; 428 + struct tipc_media *m_ptr; 429 + struct tipc_bearer_names b_names; 432 430 char addr_string[16]; 433 431 u32 bearer_id; 434 432 u32 with_this_prio; ··· 440 438 name); 441 439 return -ENOPROTOOPT; 442 440 } 443 - if (!bearer_name_validate(name, &b_name)) { 441 + if (!bearer_name_validate(name, &b_names)) { 444 442 warn("Bearer <%s> rejected, illegal name\n", name); 445 443 return -EINVAL; 446 444 } ··· 465 463 466 464 write_lock_bh(&tipc_net_lock); 467 465 468 - m_ptr = tipc_media_find(b_name.media_name); 466 + m_ptr = tipc_media_find(b_names.media_name); 469 467 if (!m_ptr) { 470 468 warn("Bearer <%s> rejected, media <%s> not registered\n", name, 471 - b_name.media_name); 469 + b_names.media_name); 472 470 goto exit; 473 471 } 474 472 ··· 546 544 int tipc_block_bearer(const char *name) 547 545 { 548 546 struct tipc_bearer *b_ptr = NULL; 549 - struct link *l_ptr; 550 - struct link *temp_l_ptr; 547 + struct tipc_link *l_ptr; 548 + struct tipc_link *temp_l_ptr; 551 549 552 550 read_lock_bh(&tipc_net_lock); 553 551 b_ptr = tipc_bearer_find(name); ··· 581 579 582 580 static void bearer_disable(struct tipc_bearer *b_ptr) 583 581 { 584 - struct link *l_ptr; 585 - struct link *temp_l_ptr; 582 + struct tipc_link *l_ptr; 583 + struct tipc_link *temp_l_ptr; 586 584 587 585 info("Disabling bearer <%s>\n", b_ptr->name); 588 586 spin_lock_bh(&b_ptr->lock);
+12 -11
net/tipc/bearer.h
··· 74 74 struct tipc_bearer; 75 75 76 76 /** 77 - * struct media - TIPC media information available to internal users 77 + * struct tipc_media - TIPC media information available to internal users 78 78 * @send_msg: routine which handles buffer transmission 79 79 * @enable_bearer: routine which enables a bearer 80 80 * @disable_bearer: routine which disables a bearer ··· 90 90 * @name: media name 91 91 */ 92 92 93 - struct media { 93 + struct tipc_media { 94 94 int (*send_msg)(struct sk_buff *buf, 95 95 struct tipc_bearer *b_ptr, 96 96 struct tipc_media_addr *dest); ··· 139 139 struct tipc_media_addr addr; /* initalized by media */ 140 140 char name[TIPC_MAX_BEARER_NAME]; 141 141 spinlock_t lock; 142 - struct media *media; 142 + struct tipc_media *media; 143 143 u32 priority; 144 144 u32 window; 145 145 u32 tolerance; 146 146 u32 identity; 147 - struct link_req *link_req; 147 + struct tipc_link_req *link_req; 148 148 struct list_head links; 149 149 struct list_head cong_links; 150 150 int active; ··· 152 152 struct tipc_node_map nodes; 153 153 }; 154 154 155 - struct bearer_name { 155 + struct tipc_bearer_names { 156 156 char media_name[TIPC_MAX_MEDIA_NAME]; 157 157 char if_name[TIPC_MAX_IF_NAME]; 158 158 }; 159 159 160 - struct link; 160 + struct tipc_link; 161 161 162 162 extern struct tipc_bearer tipc_bearers[]; 163 163 164 164 /* 165 165 * TIPC routines available to supported media types 166 166 */ 167 - int tipc_register_media(struct media *m_ptr); 167 + int tipc_register_media(struct tipc_media *m_ptr); 168 168 169 169 void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); 170 170 ··· 188 188 struct sk_buff *tipc_bearer_get_names(void); 189 189 void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest); 190 190 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); 192 192 struct tipc_bearer *tipc_bearer_find(const char *name); 193 193 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); 197 198 void tipc_bearer_stop(void); 198 199 void tipc_bearer_lock_push(struct tipc_bearer *b_ptr); 199 200
+10 -10
net/tipc/discover.c
··· 45 45 46 46 47 47 /** 48 - * struct link_req - information about an ongoing link setup request 48 + * struct tipc_link_req - information about an ongoing link setup request 49 49 * @bearer: bearer issuing requests 50 50 * @dest: destination address for request messages 51 51 * @domain: network domain to which links can be established ··· 54 54 * @timer: timer governing period between requests 55 55 * @timer_intv: current interval between requests (in ms) 56 56 */ 57 - struct link_req { 57 + struct tipc_link_req { 58 58 struct tipc_bearer *bearer; 59 59 struct tipc_media_addr dest; 60 60 u32 domain; ··· 120 120 void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) 121 121 { 122 122 struct tipc_node *n_ptr; 123 - struct link *link; 123 + struct tipc_link *link; 124 124 struct tipc_media_addr media_addr, *addr; 125 125 struct sk_buff *rbuf; 126 126 struct tipc_msg *msg = buf_msg(buf); ··· 218 218 * and is either not currently searching or is searching at a slow rate 219 219 */ 220 220 221 - static void disc_update(struct link_req *req) 221 + static void disc_update(struct tipc_link_req *req) 222 222 { 223 223 if (!req->num_nodes) { 224 224 if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || ··· 234 234 * @req: ptr to link request structure 235 235 */ 236 236 237 - void tipc_disc_add_dest(struct link_req *req) 237 + void tipc_disc_add_dest(struct tipc_link_req *req) 238 238 { 239 239 req->num_nodes++; 240 240 } ··· 244 244 * @req: ptr to link request structure 245 245 */ 246 246 247 - void tipc_disc_remove_dest(struct link_req *req) 247 + void tipc_disc_remove_dest(struct tipc_link_req *req) 248 248 { 249 249 req->num_nodes--; 250 250 disc_update(req); ··· 255 255 * @req: ptr to link request structure 256 256 */ 257 257 258 - static void disc_send_msg(struct link_req *req) 258 + static void disc_send_msg(struct tipc_link_req *req) 259 259 { 260 260 if (!req->bearer->blocked) 261 261 tipc_bearer_send(req->bearer, req->buf, &req->dest); ··· 268 268 * Called whenever a link setup request timer associated with a bearer expires. 269 269 */ 270 270 271 - static void disc_timeout(struct link_req *req) 271 + static void disc_timeout(struct tipc_link_req *req) 272 272 { 273 273 int max_delay; 274 274 ··· 316 316 int tipc_disc_create(struct tipc_bearer *b_ptr, 317 317 struct tipc_media_addr *dest, u32 dest_domain) 318 318 { 319 - struct link_req *req; 319 + struct tipc_link_req *req; 320 320 321 321 req = kmalloc(sizeof(*req), GFP_ATOMIC); 322 322 if (!req) ··· 345 345 * @req: ptr to link request structure 346 346 */ 347 347 348 - void tipc_disc_delete(struct link_req *req) 348 + void tipc_disc_delete(struct tipc_link_req *req) 349 349 { 350 350 k_cancel_timer(&req->timer); 351 351 k_term_timer(&req->timer);
+4 -4
net/tipc/discover.h
··· 37 37 #ifndef _TIPC_DISCOVER_H 38 38 #define _TIPC_DISCOVER_H 39 39 40 - struct link_req; 40 + struct tipc_link_req; 41 41 42 42 int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest, 43 43 u32 dest_domain); 44 - void tipc_disc_delete(struct link_req *req); 45 - void tipc_disc_add_dest(struct link_req *req); 46 - void tipc_disc_remove_dest(struct link_req *req); 44 + void tipc_disc_delete(struct tipc_link_req *req); 45 + void tipc_disc_add_dest(struct tipc_link_req *req); 46 + void tipc_disc_remove_dest(struct tipc_link_req *req); 47 47 void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr); 48 48 49 49 #endif
+2 -2
net/tipc/eth_media.c
··· 56 56 struct work_struct cleanup; 57 57 }; 58 58 59 - static struct media eth_media_info; 59 + static struct tipc_media eth_media_info; 60 60 static struct eth_bearer eth_bearers[MAX_ETH_BEARERS]; 61 61 static int eth_started; 62 62 static struct notifier_block notifier; ··· 340 340 * Ethernet media registration info 341 341 */ 342 342 343 - static struct media eth_media_info = { 343 + static struct tipc_media eth_media_info = { 344 344 .send_msg = send_msg, 345 345 .enable_bearer = enable_bearer, 346 346 .disable_bearer = disable_bearer,
+80 -75
net/tipc/link.c
··· 71 71 #define START_CHANGEOVER 100000u 72 72 73 73 /** 74 - * struct link_name - deconstructed link name 74 + * struct tipc_link_name - deconstructed link name 75 75 * @addr_local: network address of node at this end 76 76 * @if_local: name of interface at this end 77 77 * @addr_peer: network address of node at far end 78 78 * @if_peer: name of interface at far end 79 79 */ 80 80 81 - struct link_name { 81 + struct tipc_link_name { 82 82 u32 addr_local; 83 83 char if_local[TIPC_MAX_IF_NAME]; 84 84 u32 addr_peer; 85 85 char if_peer[TIPC_MAX_IF_NAME]; 86 86 }; 87 87 88 - static void link_handle_out_of_seq_msg(struct link *l_ptr, 88 + static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, 89 89 struct sk_buff *buf); 90 - static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf); 91 - static int link_recv_changeover_msg(struct link **l_ptr, struct sk_buff **buf); 92 - static void link_set_supervision_props(struct link *l_ptr, u32 tolerance); 90 + static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf); 91 + static int link_recv_changeover_msg(struct tipc_link **l_ptr, 92 + struct sk_buff **buf); 93 + static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance); 93 94 static int link_send_sections_long(struct tipc_port *sender, 94 95 struct iovec const *msg_sect, 95 96 u32 num_sect, unsigned int total_len, 96 97 u32 destnode); 97 - static void link_check_defragm_bufs(struct link *l_ptr); 98 - static void link_state_event(struct link *l_ptr, u32 event); 99 - static void link_reset_statistics(struct link *l_ptr); 100 - static void link_print(struct link *l_ptr, const char *str); 101 - static void link_start(struct link *l_ptr); 102 - static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf); 98 + static void link_check_defragm_bufs(struct tipc_link *l_ptr); 99 + static void link_state_event(struct tipc_link *l_ptr, u32 event); 100 + static void link_reset_statistics(struct tipc_link *l_ptr); 101 + static void link_print(struct tipc_link *l_ptr, const char *str); 102 + static void link_start(struct tipc_link *l_ptr); 103 + static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf); 103 104 104 105 /* 105 106 * Simple link routines ··· 111 110 return (i + 3) & ~3u; 112 111 } 113 112 114 - static void link_init_max_pkt(struct link *l_ptr) 113 + static void link_init_max_pkt(struct tipc_link *l_ptr) 115 114 { 116 115 u32 max_pkt; 117 116 ··· 128 127 l_ptr->max_pkt_probes = 0; 129 128 } 130 129 131 - static u32 link_next_sent(struct link *l_ptr) 130 + static u32 link_next_sent(struct tipc_link *l_ptr) 132 131 { 133 132 if (l_ptr->next_out) 134 133 return buf_seqno(l_ptr->next_out); 135 134 return mod(l_ptr->next_out_no); 136 135 } 137 136 138 - static u32 link_last_sent(struct link *l_ptr) 137 + static u32 link_last_sent(struct tipc_link *l_ptr) 139 138 { 140 139 return mod(link_next_sent(l_ptr) - 1); 141 140 } ··· 144 143 * Simple non-static link routines (i.e. referenced outside this file) 145 144 */ 146 145 147 - int tipc_link_is_up(struct link *l_ptr) 146 + int tipc_link_is_up(struct tipc_link *l_ptr) 148 147 { 149 148 if (!l_ptr) 150 149 return 0; 151 150 return link_working_working(l_ptr) || link_working_unknown(l_ptr); 152 151 } 153 152 154 - int tipc_link_is_active(struct link *l_ptr) 153 + int tipc_link_is_active(struct tipc_link *l_ptr) 155 154 { 156 155 return (l_ptr->owner->active_links[0] == l_ptr) || 157 156 (l_ptr->owner->active_links[1] == l_ptr); 158 157 } 159 158 160 159 /** 161 - * link_name_validate - validate & (optionally) deconstruct link name 160 + * link_name_validate - validate & (optionally) deconstruct tipc_link name 162 161 * @name - ptr to link name string 163 162 * @name_parts - ptr to area for link name components (or NULL if not needed) 164 163 * 165 164 * Returns 1 if link name is valid, otherwise 0. 166 165 */ 167 166 168 - static int link_name_validate(const char *name, struct link_name *name_parts) 167 + static int link_name_validate(const char *name, 168 + struct tipc_link_name *name_parts) 169 169 { 170 170 char name_copy[TIPC_MAX_LINK_NAME]; 171 171 char *addr_local; ··· 240 238 * tipc_node_delete() is called.) 241 239 */ 242 240 243 - static void link_timeout(struct link *l_ptr) 241 + static void link_timeout(struct tipc_link *l_ptr) 244 242 { 245 243 tipc_node_lock(l_ptr->owner); 246 244 ··· 289 287 tipc_node_unlock(l_ptr->owner); 290 288 } 291 289 292 - static void link_set_timer(struct link *l_ptr, u32 time) 290 + static void link_set_timer(struct tipc_link *l_ptr, u32 time) 293 291 { 294 292 k_start_timer(&l_ptr->timer, time); 295 293 } ··· 303 301 * Returns pointer to link. 304 302 */ 305 303 306 - struct link *tipc_link_create(struct tipc_node *n_ptr, 304 + struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, 307 305 struct tipc_bearer *b_ptr, 308 306 const struct tipc_media_addr *media_addr) 309 307 { 310 - struct link *l_ptr; 308 + struct tipc_link *l_ptr; 311 309 struct tipc_msg *msg; 312 310 char *if_name; 313 311 char addr_string[16]; ··· 384 382 * to avoid a potential deadlock situation. 385 383 */ 386 384 387 - void tipc_link_delete(struct link *l_ptr) 385 + void tipc_link_delete(struct tipc_link *l_ptr) 388 386 { 389 387 if (!l_ptr) { 390 388 err("Attempt to delete non-existent link\n"); ··· 403 401 kfree(l_ptr); 404 402 } 405 403 406 - static void link_start(struct link *l_ptr) 404 + static void link_start(struct tipc_link *l_ptr) 407 405 { 408 406 tipc_node_lock(l_ptr->owner); 409 407 link_state_event(l_ptr, STARTING_EVT); ··· 420 418 * has abated. 421 419 */ 422 420 423 - static int link_schedule_port(struct link *l_ptr, u32 origport, u32 sz) 421 + static int link_schedule_port(struct tipc_link *l_ptr, u32 origport, u32 sz) 424 422 { 425 423 struct tipc_port *p_ptr; 426 424 ··· 442 440 return -ELINKCONG; 443 441 } 444 442 445 - void tipc_link_wakeup_ports(struct link *l_ptr, int all) 443 + void tipc_link_wakeup_ports(struct tipc_link *l_ptr, int all) 446 444 { 447 445 struct tipc_port *p_ptr; 448 446 struct tipc_port *temp_p_ptr; ··· 477 475 * @l_ptr: pointer to link 478 476 */ 479 477 480 - static void link_release_outqueue(struct link *l_ptr) 478 + static void link_release_outqueue(struct tipc_link *l_ptr) 481 479 { 482 480 struct sk_buff *buf = l_ptr->first_out; 483 481 struct sk_buff *next; ··· 496 494 * @l_ptr: pointer to link 497 495 */ 498 496 499 - void tipc_link_reset_fragments(struct link *l_ptr) 497 + void tipc_link_reset_fragments(struct tipc_link *l_ptr) 500 498 { 501 499 struct sk_buff *buf = l_ptr->defragm_buf; 502 500 struct sk_buff *next; ··· 514 512 * @l_ptr: pointer to link 515 513 */ 516 514 517 - void tipc_link_stop(struct link *l_ptr) 515 + void tipc_link_stop(struct tipc_link *l_ptr) 518 516 { 519 517 struct sk_buff *buf; 520 518 struct sk_buff *next; ··· 539 537 l_ptr->proto_msg_queue = NULL; 540 538 } 541 539 542 - void tipc_link_reset(struct link *l_ptr) 540 + void tipc_link_reset(struct tipc_link *l_ptr) 543 541 { 544 542 struct sk_buff *buf; 545 543 u32 prev_state = l_ptr->state; ··· 599 597 } 600 598 601 599 602 - static void link_activate(struct link *l_ptr) 600 + static void link_activate(struct tipc_link *l_ptr) 603 601 { 604 602 l_ptr->next_in_no = l_ptr->stats.recv_info = 1; 605 603 tipc_node_link_up(l_ptr->owner, l_ptr); ··· 612 610 * @event: state machine event to process 613 611 */ 614 612 615 - static void link_state_event(struct link *l_ptr, unsigned event) 613 + static void link_state_event(struct tipc_link *l_ptr, unsigned event) 616 614 { 617 - struct link *other; 615 + struct tipc_link *other; 618 616 u32 cont_intv = l_ptr->continuity_interval; 619 617 620 618 if (!l_ptr->started && (event != STARTING_EVT)) ··· 786 784 * the tail of an existing one. 787 785 */ 788 786 789 - static int link_bundle_buf(struct link *l_ptr, 787 + static int link_bundle_buf(struct tipc_link *l_ptr, 790 788 struct sk_buff *bundler, 791 789 struct sk_buff *buf) 792 790 { ··· 815 813 return 1; 816 814 } 817 815 818 - static void link_add_to_outqueue(struct link *l_ptr, 816 + static void link_add_to_outqueue(struct tipc_link *l_ptr, 819 817 struct sk_buff *buf, 820 818 struct tipc_msg *msg) 821 819 { ··· 836 834 l_ptr->stats.max_queue_sz = l_ptr->out_queue_size; 837 835 } 838 836 839 - static void link_add_chain_to_outqueue(struct link *l_ptr, 837 + static void link_add_chain_to_outqueue(struct tipc_link *l_ptr, 840 838 struct sk_buff *buf_chain, 841 839 u32 long_msgno) 842 840 { ··· 861 859 * has failed, and from link_send() 862 860 */ 863 861 864 - int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) 862 + int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf) 865 863 { 866 864 struct tipc_msg *msg = buf_msg(buf); 867 865 u32 size = msg_size(msg); ··· 956 954 957 955 int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) 958 956 { 959 - struct link *l_ptr; 957 + struct tipc_link *l_ptr; 960 958 struct tipc_node *n_ptr; 961 959 int res = -ELINKCONG; 962 960 ··· 990 988 void tipc_link_send_names(struct list_head *message_list, u32 dest) 991 989 { 992 990 struct tipc_node *n_ptr; 993 - struct link *l_ptr; 991 + struct tipc_link *l_ptr; 994 992 struct sk_buff *buf; 995 993 struct sk_buff *temp_buf; 996 994 ··· 1029 1027 * Link is locked. Returns user data length. 1030 1028 */ 1031 1029 1032 - static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, 1030 + static int link_send_buf_fast(struct tipc_link *l_ptr, struct sk_buff *buf, 1033 1031 u32 *used_max_pkt) 1034 1032 { 1035 1033 struct tipc_msg *msg = buf_msg(buf); ··· 1063 1061 */ 1064 1062 int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) 1065 1063 { 1066 - struct link *l_ptr; 1064 + struct tipc_link *l_ptr; 1067 1065 struct tipc_node *n_ptr; 1068 1066 int res; 1069 1067 u32 selector = msg_origport(buf_msg(buf)) & 1; ··· 1102 1100 u32 destaddr) 1103 1101 { 1104 1102 struct tipc_msg *hdr = &sender->phdr; 1105 - struct link *l_ptr; 1103 + struct tipc_link *l_ptr; 1106 1104 struct sk_buff *buf; 1107 1105 struct tipc_node *node; 1108 1106 int res; ··· 1197 1195 unsigned int total_len, 1198 1196 u32 destaddr) 1199 1197 { 1200 - struct link *l_ptr; 1198 + struct tipc_link *l_ptr; 1201 1199 struct tipc_node *node; 1202 1200 struct tipc_msg *hdr = &sender->phdr; 1203 1201 u32 dsz = total_len; ··· 1344 1342 /* 1345 1343 * tipc_link_push_packet: Push one unsent packet to the media 1346 1344 */ 1347 - u32 tipc_link_push_packet(struct link *l_ptr) 1345 + u32 tipc_link_push_packet(struct tipc_link *l_ptr) 1348 1346 { 1349 1347 struct sk_buff *buf = l_ptr->first_out; 1350 1348 u32 r_q_size = l_ptr->retransm_queue_size; ··· 1428 1426 * push_queue(): push out the unsent messages of a link where 1429 1427 * congestion has abated. Node is locked 1430 1428 */ 1431 - void tipc_link_push_queue(struct link *l_ptr) 1429 + void tipc_link_push_queue(struct tipc_link *l_ptr) 1432 1430 { 1433 1431 u32 res; 1434 1432 ··· 1472 1470 read_unlock_bh(&tipc_net_lock); 1473 1471 } 1474 1472 1475 - static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) 1473 + static void link_retransmit_failure(struct tipc_link *l_ptr, 1474 + struct sk_buff *buf) 1476 1475 { 1477 1476 struct tipc_msg *msg = buf_msg(buf); 1478 1477 ··· 1517 1514 } 1518 1515 } 1519 1516 1520 - void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *buf, 1517 + void tipc_link_retransmit(struct tipc_link *l_ptr, struct sk_buff *buf, 1521 1518 u32 retransmits) 1522 1519 { 1523 1520 struct tipc_msg *msg; ··· 1574 1571 * link_insert_deferred_queue - insert deferred messages back into receive chain 1575 1572 */ 1576 1573 1577 - static struct sk_buff *link_insert_deferred_queue(struct link *l_ptr, 1574 + static struct sk_buff *link_insert_deferred_queue(struct tipc_link *l_ptr, 1578 1575 struct sk_buff *buf) 1579 1576 { 1580 1577 u32 seq_no; ··· 1656 1653 read_lock_bh(&tipc_net_lock); 1657 1654 while (head) { 1658 1655 struct tipc_node *n_ptr; 1659 - struct link *l_ptr; 1656 + struct tipc_link *l_ptr; 1660 1657 struct sk_buff *crs; 1661 1658 struct sk_buff *buf = head; 1662 1659 struct tipc_msg *msg; ··· 1909 1906 * link_handle_out_of_seq_msg - handle arrival of out-of-sequence packet 1910 1907 */ 1911 1908 1912 - static void link_handle_out_of_seq_msg(struct link *l_ptr, 1909 + static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, 1913 1910 struct sk_buff *buf) 1914 1911 { 1915 1912 u32 seq_no = buf_seqno(buf); ··· 1947 1944 /* 1948 1945 * Send protocol message to the other endpoint. 1949 1946 */ 1950 - void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, 1951 - u32 gap, u32 tolerance, u32 priority, u32 ack_mtu) 1947 + void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, 1948 + int probe_msg, u32 gap, u32 tolerance, 1949 + u32 priority, u32 ack_mtu) 1952 1950 { 1953 1951 struct sk_buff *buf = NULL; 1954 1952 struct tipc_msg *msg = l_ptr->pmsg; ··· 2066 2062 * change at any time. The node with lowest address rules 2067 2063 */ 2068 2064 2069 - static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) 2065 + static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf) 2070 2066 { 2071 2067 u32 rec_gap = 0; 2072 2068 u32 max_pkt_info; ··· 2199 2195 * tipc_link_tunnel(): Send one message via a link belonging to 2200 2196 * another bearer. Owner node is locked. 2201 2197 */ 2202 - static void tipc_link_tunnel(struct link *l_ptr, 2198 + static void tipc_link_tunnel(struct tipc_link *l_ptr, 2203 2199 struct tipc_msg *tunnel_hdr, 2204 2200 struct tipc_msg *msg, 2205 2201 u32 selector) 2206 2202 { 2207 - struct link *tunnel; 2203 + struct tipc_link *tunnel; 2208 2204 struct sk_buff *buf; 2209 2205 u32 length = msg_size(msg); 2210 2206 ··· 2233 2229 * Owner node is locked. 2234 2230 */ 2235 2231 2236 - void tipc_link_changeover(struct link *l_ptr) 2232 + void tipc_link_changeover(struct tipc_link *l_ptr) 2237 2233 { 2238 2234 u32 msgcount = l_ptr->out_queue_size; 2239 2235 struct sk_buff *crs = l_ptr->first_out; 2240 - struct link *tunnel = l_ptr->owner->active_links[0]; 2236 + struct tipc_link *tunnel = l_ptr->owner->active_links[0]; 2241 2237 struct tipc_msg tunnel_hdr; 2242 2238 int split_bundles; 2243 2239 ··· 2296 2292 } 2297 2293 } 2298 2294 2299 - void tipc_link_send_duplicate(struct link *l_ptr, struct link *tunnel) 2295 + void tipc_link_send_duplicate(struct tipc_link *l_ptr, struct tipc_link *tunnel) 2300 2296 { 2301 2297 struct sk_buff *iter; 2302 2298 struct tipc_msg tunnel_hdr; ··· 2360 2356 * via other link. Node is locked. Return extracted buffer. 2361 2357 */ 2362 2358 2363 - static int link_recv_changeover_msg(struct link **l_ptr, 2359 + static int link_recv_changeover_msg(struct tipc_link **l_ptr, 2364 2360 struct sk_buff **buf) 2365 2361 { 2366 2362 struct sk_buff *tunnel_buf = *buf; 2367 - struct link *dest_link; 2363 + struct tipc_link *dest_link; 2368 2364 struct tipc_msg *msg; 2369 2365 struct tipc_msg *tunnel_msg = buf_msg(tunnel_buf); 2370 2366 u32 msg_typ = msg_type(tunnel_msg); ··· 2464 2460 * The buffer is complete, inclusive total message length. 2465 2461 * Returns user data length. 2466 2462 */ 2467 - static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf) 2463 + static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf) 2468 2464 { 2469 2465 struct sk_buff *buf_chain = NULL; 2470 2466 struct sk_buff *buf_chain_tail = (struct sk_buff *)&buf_chain; ··· 2660 2656 * @l_ptr: pointer to link 2661 2657 */ 2662 2658 2663 - static void link_check_defragm_bufs(struct link *l_ptr) 2659 + static void link_check_defragm_bufs(struct tipc_link *l_ptr) 2664 2660 { 2665 2661 struct sk_buff *prev = NULL; 2666 2662 struct sk_buff *next = NULL; ··· 2690 2686 2691 2687 2692 2688 2693 - static void link_set_supervision_props(struct link *l_ptr, u32 tolerance) 2689 + static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance) 2694 2690 { 2695 2691 if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL)) 2696 2692 return; ··· 2702 2698 } 2703 2699 2704 2700 2705 - void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) 2701 + void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window) 2706 2702 { 2707 2703 /* Data messages from this node, inclusive FIRST_FRAGM */ 2708 2704 l_ptr->queue_limit[TIPC_LOW_IMPORTANCE] = window; ··· 2732 2728 * Returns pointer to link (or 0 if invalid link name). 2733 2729 */ 2734 2730 2735 - static struct link *link_find_link(const char *name, struct tipc_node **node) 2731 + static struct tipc_link *link_find_link(const char *name, 2732 + struct tipc_node **node) 2736 2733 { 2737 - struct link_name link_name_parts; 2734 + struct tipc_link_name link_name_parts; 2738 2735 struct tipc_bearer *b_ptr; 2739 - struct link *l_ptr; 2736 + struct tipc_link *l_ptr; 2740 2737 2741 2738 if (!link_name_validate(name, &link_name_parts)) 2742 2739 return NULL; ··· 2796 2791 static int link_cmd_set_value(const char *name, u32 new_value, u16 cmd) 2797 2792 { 2798 2793 struct tipc_node *node; 2799 - struct link *l_ptr; 2794 + struct tipc_link *l_ptr; 2800 2795 struct tipc_bearer *b_ptr; 2801 - struct media *m_ptr; 2796 + struct tipc_media *m_ptr; 2802 2797 2803 2798 l_ptr = link_find_link(name, &node); 2804 2799 if (l_ptr) { ··· 2898 2893 * @l_ptr: pointer to link 2899 2894 */ 2900 2895 2901 - static void link_reset_statistics(struct link *l_ptr) 2896 + static void link_reset_statistics(struct tipc_link *l_ptr) 2902 2897 { 2903 2898 memset(&l_ptr->stats, 0, sizeof(l_ptr->stats)); 2904 2899 l_ptr->stats.sent_info = l_ptr->next_out_no; ··· 2908 2903 struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space) 2909 2904 { 2910 2905 char *link_name; 2911 - struct link *l_ptr; 2906 + struct tipc_link *l_ptr; 2912 2907 struct tipc_node *node; 2913 2908 2914 2909 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) ··· 2956 2951 static int tipc_link_stats(const char *name, char *buf, const u32 buf_size) 2957 2952 { 2958 2953 struct print_buf pb; 2959 - struct link *l_ptr; 2954 + struct tipc_link *l_ptr; 2960 2955 struct tipc_node *node; 2961 2956 char *status; 2962 2957 u32 profile_total = 0; ··· 3078 3073 u32 tipc_link_get_max_pkt(u32 dest, u32 selector) 3079 3074 { 3080 3075 struct tipc_node *n_ptr; 3081 - struct link *l_ptr; 3076 + struct tipc_link *l_ptr; 3082 3077 u32 res = MAX_PKT_DEFAULT; 3083 3078 3084 3079 if (dest == tipc_own_addr) ··· 3097 3092 return res; 3098 3093 } 3099 3094 3100 - static void link_print(struct link *l_ptr, const char *str) 3095 + static void link_print(struct tipc_link *l_ptr, const char *str) 3101 3096 { 3102 3097 char print_area[256]; 3103 3098 struct print_buf pb;
+27 -25
net/tipc/link.h
··· 67 67 #define MAX_PKT_DEFAULT 1500 68 68 69 69 /** 70 - * struct link - TIPC link data structure 70 + * struct tipc_link - TIPC link data structure 71 71 * @addr: network address of link's peer node 72 72 * @name: link name character string 73 73 * @media_addr: media address to use when sending messages over link ··· 115 115 * @stats: collects statistics regarding link activity 116 116 */ 117 117 118 - struct link { 118 + struct tipc_link { 119 119 u32 addr; 120 120 char name[TIPC_MAX_LINK_NAME]; 121 121 struct tipc_media_addr media_addr; ··· 213 213 214 214 struct tipc_port; 215 215 216 - struct link *tipc_link_create(struct tipc_node *n_ptr, 216 + struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, 217 217 struct tipc_bearer *b_ptr, 218 218 const struct tipc_media_addr *media_addr); 219 - void tipc_link_delete(struct link *l_ptr); 220 - void tipc_link_changeover(struct link *l_ptr); 221 - void tipc_link_send_duplicate(struct link *l_ptr, struct link *dest); 222 - void tipc_link_reset_fragments(struct link *l_ptr); 223 - int tipc_link_is_up(struct link *l_ptr); 224 - int tipc_link_is_active(struct link *l_ptr); 225 - u32 tipc_link_push_packet(struct link *l_ptr); 226 - void tipc_link_stop(struct link *l_ptr); 219 + void tipc_link_delete(struct tipc_link *l_ptr); 220 + void tipc_link_changeover(struct tipc_link *l_ptr); 221 + void tipc_link_send_duplicate(struct tipc_link *l_ptr, struct tipc_link *dest); 222 + void tipc_link_reset_fragments(struct tipc_link *l_ptr); 223 + int tipc_link_is_up(struct tipc_link *l_ptr); 224 + int tipc_link_is_active(struct tipc_link *l_ptr); 225 + u32 tipc_link_push_packet(struct tipc_link *l_ptr); 226 + void tipc_link_stop(struct tipc_link *l_ptr); 227 227 struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd); 228 228 struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_space); 229 229 struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space); 230 - void tipc_link_reset(struct link *l_ptr); 230 + void tipc_link_reset(struct tipc_link *l_ptr); 231 231 int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); 232 232 void tipc_link_send_names(struct list_head *message_list, u32 dest); 233 - int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf); 233 + int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf); 234 234 u32 tipc_link_get_max_pkt(u32 dest, u32 selector); 235 235 int tipc_link_send_sections_fast(struct tipc_port *sender, 236 236 struct iovec const *msg_sect, ··· 241 241 int tipc_link_recv_fragment(struct sk_buff **pending, 242 242 struct sk_buff **fb, 243 243 struct tipc_msg **msg); 244 - void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int prob, u32 gap, 245 - u32 tolerance, u32 priority, u32 acked_mtu); 246 - void tipc_link_push_queue(struct link *l_ptr); 244 + void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, int prob, 245 + u32 gap, u32 tolerance, u32 priority, 246 + u32 acked_mtu); 247 + void tipc_link_push_queue(struct tipc_link *l_ptr); 247 248 u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail, 248 249 struct sk_buff *buf); 249 - void tipc_link_wakeup_ports(struct link *l_ptr, int all); 250 - void tipc_link_set_queue_limits(struct link *l_ptr, u32 window); 251 - void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *start, u32 retransmits); 250 + void tipc_link_wakeup_ports(struct tipc_link *l_ptr, int all); 251 + void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window); 252 + void tipc_link_retransmit(struct tipc_link *l_ptr, 253 + struct sk_buff *start, u32 retransmits); 252 254 253 255 /* 254 256 * Link sequence number manipulation routines (uses modulo 2**16 arithmetic) ··· 295 293 * Link status checking routines 296 294 */ 297 295 298 - static inline int link_working_working(struct link *l_ptr) 296 + static inline int link_working_working(struct tipc_link *l_ptr) 299 297 { 300 298 return l_ptr->state == WORKING_WORKING; 301 299 } 302 300 303 - static inline int link_working_unknown(struct link *l_ptr) 301 + static inline int link_working_unknown(struct tipc_link *l_ptr) 304 302 { 305 303 return l_ptr->state == WORKING_UNKNOWN; 306 304 } 307 305 308 - static inline int link_reset_unknown(struct link *l_ptr) 306 + static inline int link_reset_unknown(struct tipc_link *l_ptr) 309 307 { 310 308 return l_ptr->state == RESET_UNKNOWN; 311 309 } 312 310 313 - static inline int link_reset_reset(struct link *l_ptr) 311 + static inline int link_reset_reset(struct tipc_link *l_ptr) 314 312 { 315 313 return l_ptr->state == RESET_RESET; 316 314 } 317 315 318 - static inline int link_blocked(struct link *l_ptr) 316 + static inline int link_blocked(struct tipc_link *l_ptr) 319 317 { 320 318 return l_ptr->exp_msg_count || l_ptr->blocked; 321 319 } 322 320 323 - static inline int link_congested(struct link *l_ptr) 321 + static inline int link_congested(struct tipc_link *l_ptr) 324 322 { 325 323 return l_ptr->out_queue_size >= l_ptr->queue_limit[0]; 326 324 }
+1 -1
net/tipc/name_distr.c
··· 176 176 void tipc_named_node_up(unsigned long nodearg) 177 177 { 178 178 struct tipc_node *n_ptr; 179 - struct link *l_ptr; 179 + struct tipc_link *l_ptr; 180 180 struct publication *publ; 181 181 struct distr_item *item = NULL; 182 182 struct sk_buff *buf = NULL;
+8 -7
net/tipc/name_table.c
··· 251 251 u32 type, u32 lower, u32 upper, 252 252 u32 scope, u32 node, u32 port, u32 key) 253 253 { 254 - struct subscription *s; 255 - struct subscription *st; 254 + struct tipc_subscription *s; 255 + struct tipc_subscription *st; 256 256 struct publication *publ; 257 257 struct sub_seq *sseq; 258 258 struct name_info *info; ··· 381 381 struct sub_seq *sseq = nameseq_find_subseq(nseq, inst); 382 382 struct name_info *info; 383 383 struct sub_seq *free; 384 - struct subscription *s, *st; 384 + struct tipc_subscription *s, *st; 385 385 int removed_subseq = 0; 386 386 387 387 if (!sseq) ··· 448 448 * sequence overlapping with the requested sequence 449 449 */ 450 450 451 - static void tipc_nameseq_subscribe(struct name_seq *nseq, struct subscription *s) 451 + static void tipc_nameseq_subscribe(struct name_seq *nseq, 452 + struct tipc_subscription *s) 452 453 { 453 454 struct sub_seq *sseq = nseq->sseqs; 454 455 ··· 626 625 */ 627 626 628 627 int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit, 629 - struct port_list *dports) 628 + struct tipc_port_list *dports) 630 629 { 631 630 struct name_seq *seq; 632 631 struct sub_seq *sseq; ··· 740 739 * tipc_nametbl_subscribe - add a subscription object to the name table 741 740 */ 742 741 743 - void tipc_nametbl_subscribe(struct subscription *s) 742 + void tipc_nametbl_subscribe(struct tipc_subscription *s) 744 743 { 745 744 u32 type = s->seq.type; 746 745 struct name_seq *seq; ··· 764 763 * tipc_nametbl_unsubscribe - remove a subscription object from name table 765 764 */ 766 765 767 - void tipc_nametbl_unsubscribe(struct subscription *s) 766 + void tipc_nametbl_unsubscribe(struct tipc_subscription *s) 768 767 { 769 768 struct name_seq *seq; 770 769
+5 -5
net/tipc/name_table.h
··· 39 39 40 40 #include "node_subscr.h" 41 41 42 - struct subscription; 43 - struct port_list; 42 + struct tipc_subscription; 43 + struct tipc_port_list; 44 44 45 45 /* 46 46 * TIPC name types reserved for internal TIPC use (both current and planned) ··· 90 90 struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space); 91 91 u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *node); 92 92 int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit, 93 - struct port_list *dports); 93 + struct tipc_port_list *dports); 94 94 int tipc_nametbl_publish_rsv(u32 ref, unsigned int scope, 95 95 struct tipc_name_seq const *seq); 96 96 struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper, ··· 100 100 u32 scope, u32 node, u32 ref, u32 key); 101 101 struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower, 102 102 u32 node, u32 ref, u32 key); 103 - void tipc_nametbl_subscribe(struct subscription *s); 104 - void tipc_nametbl_unsubscribe(struct subscription *s); 103 + void tipc_nametbl_subscribe(struct tipc_subscription *s); 104 + void tipc_nametbl_unsubscribe(struct tipc_subscription *s); 105 105 int tipc_nametbl_init(void); 106 106 void tipc_nametbl_stop(void); 107 107
+9 -9
net/tipc/node.c
··· 136 136 * Link becomes active (alone or shared) or standby, depending on its priority. 137 137 */ 138 138 139 - void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr) 139 + void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) 140 140 { 141 - struct link **active = &n_ptr->active_links[0]; 141 + struct tipc_link **active = &n_ptr->active_links[0]; 142 142 143 143 n_ptr->working_links++; 144 144 ··· 171 171 172 172 static void node_select_active_links(struct tipc_node *n_ptr) 173 173 { 174 - struct link **active = &n_ptr->active_links[0]; 174 + struct tipc_link **active = &n_ptr->active_links[0]; 175 175 u32 i; 176 176 u32 highest_prio = 0; 177 177 178 178 active[0] = active[1] = NULL; 179 179 180 180 for (i = 0; i < MAX_BEARERS; i++) { 181 - struct link *l_ptr = n_ptr->links[i]; 181 + struct tipc_link *l_ptr = n_ptr->links[i]; 182 182 183 183 if (!l_ptr || !tipc_link_is_up(l_ptr) || 184 184 (l_ptr->priority < highest_prio)) ··· 197 197 * tipc_node_link_down - handle loss of link 198 198 */ 199 199 200 - void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr) 200 + void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr) 201 201 { 202 - struct link **active; 202 + struct tipc_link **active; 203 203 204 204 n_ptr->working_links--; 205 205 ··· 239 239 return tipc_node_active_links(n_ptr); 240 240 } 241 241 242 - void tipc_node_attach_link(struct tipc_node *n_ptr, struct link *l_ptr) 242 + void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr) 243 243 { 244 244 n_ptr->links[l_ptr->b_ptr->identity] = l_ptr; 245 245 atomic_inc(&tipc_num_links); 246 246 n_ptr->link_cnt++; 247 247 } 248 248 249 - void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) 249 + void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr) 250 250 { 251 251 n_ptr->links[l_ptr->b_ptr->identity] = NULL; 252 252 atomic_dec(&tipc_num_links); ··· 360 360 361 361 /* Abort link changeover */ 362 362 for (i = 0; i < MAX_BEARERS; i++) { 363 - struct link *l_ptr = n_ptr->links[i]; 363 + struct tipc_link *l_ptr = n_ptr->links[i]; 364 364 if (!l_ptr) 365 365 continue; 366 366 l_ptr->reset_checkpoint = l_ptr->next_in_no;
+6 -6
net/tipc/node.h
··· 79 79 struct hlist_node hash; 80 80 struct list_head list; 81 81 struct list_head nsub; 82 - struct link *active_links[2]; 83 - struct link *links[MAX_BEARERS]; 82 + struct tipc_link *active_links[2]; 83 + struct tipc_link *links[MAX_BEARERS]; 84 84 int link_cnt; 85 85 int working_links; 86 86 int block_setup; ··· 117 117 struct tipc_node *tipc_node_find(u32 addr); 118 118 struct tipc_node *tipc_node_create(u32 addr); 119 119 void tipc_node_delete(struct tipc_node *n_ptr); 120 - void tipc_node_attach_link(struct tipc_node *n_ptr, struct link *l_ptr); 121 - void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr); 122 - void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr); 123 - void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr); 120 + void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 121 + void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 122 + void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 123 + void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 124 124 int tipc_node_active_links(struct tipc_node *n_ptr); 125 125 int tipc_node_redundant_links(struct tipc_node *n_ptr); 126 126 int tipc_node_is_up(struct tipc_node *n_ptr);
+4 -4
net/tipc/port.c
··· 80 80 struct tipc_msg *hdr; 81 81 struct sk_buff *buf; 82 82 struct sk_buff *ibuf = NULL; 83 - struct port_list dports = {0, NULL, }; 83 + struct tipc_port_list dports = {0, NULL, }; 84 84 struct tipc_port *oport = tipc_port_deref(ref); 85 85 int ext_targets; 86 86 int res; ··· 142 142 * If there is no port list, perform a lookup to create one 143 143 */ 144 144 145 - void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp) 145 + void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) 146 146 { 147 147 struct tipc_msg *msg; 148 - struct port_list dports = {0, NULL, }; 149 - struct port_list *item = dp; 148 + struct tipc_port_list dports = {0, NULL, }; 149 + struct tipc_port_list *item = dp; 150 150 int cnt = 0; 151 151 152 152 msg = buf_msg(buf);
+2 -2
net/tipc/port.h
··· 151 151 }; 152 152 153 153 extern spinlock_t tipc_port_list_lock; 154 - struct port_list; 154 + struct tipc_port_list; 155 155 156 156 /* 157 157 * TIPC port manipulation routines ··· 228 228 unsigned int total_len, int err); 229 229 struct sk_buff *tipc_port_get_ports(void); 230 230 void tipc_port_recv_proto_msg(struct sk_buff *buf); 231 - void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp); 231 + void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp); 232 232 void tipc_port_reinit(void); 233 233 234 234 /**
+23 -23
net/tipc/subscr.c
··· 40 40 #include "subscr.h" 41 41 42 42 /** 43 - * struct subscriber - TIPC network topology subscriber 43 + * struct tipc_subscriber - TIPC network topology subscriber 44 44 * @port_ref: object reference to server port connecting to subscriber 45 45 * @lock: pointer to spinlock controlling access to subscriber's server port 46 46 * @subscriber_list: adjacent subscribers in top. server's list of subscribers 47 47 * @subscription_list: list of subscription objects for this subscriber 48 48 */ 49 49 50 - struct subscriber { 50 + struct tipc_subscriber { 51 51 u32 port_ref; 52 52 spinlock_t *lock; 53 53 struct list_head subscriber_list; ··· 92 92 * try to take the lock if the message is rejected and returned! 93 93 */ 94 94 95 - static void subscr_send_event(struct subscription *sub, 95 + static void subscr_send_event(struct tipc_subscription *sub, 96 96 u32 found_lower, 97 97 u32 found_upper, 98 98 u32 event, ··· 118 118 * Returns 1 if there is overlap, otherwise 0. 119 119 */ 120 120 121 - int tipc_subscr_overlap(struct subscription *sub, 121 + int tipc_subscr_overlap(struct tipc_subscription *sub, 122 122 u32 found_lower, 123 123 u32 found_upper) 124 124 ··· 138 138 * Protected by nameseq.lock in name_table.c 139 139 */ 140 140 141 - void tipc_subscr_report_overlap(struct subscription *sub, 141 + void tipc_subscr_report_overlap(struct tipc_subscription *sub, 142 142 u32 found_lower, 143 143 u32 found_upper, 144 144 u32 event, ··· 158 158 * subscr_timeout - subscription timeout has occurred 159 159 */ 160 160 161 - static void subscr_timeout(struct subscription *sub) 161 + static void subscr_timeout(struct tipc_subscription *sub) 162 162 { 163 163 struct tipc_port *server_port; 164 164 ··· 205 205 * Called with subscriber port locked. 206 206 */ 207 207 208 - static void subscr_del(struct subscription *sub) 208 + static void subscr_del(struct tipc_subscription *sub) 209 209 { 210 210 tipc_nametbl_unsubscribe(sub); 211 211 list_del(&sub->subscription_list); ··· 224 224 * simply wait for it to be released, then claim it.) 225 225 */ 226 226 227 - static void subscr_terminate(struct subscriber *subscriber) 227 + static void subscr_terminate(struct tipc_subscriber *subscriber) 228 228 { 229 229 u32 port_ref; 230 - struct subscription *sub; 231 - struct subscription *sub_temp; 230 + struct tipc_subscription *sub; 231 + struct tipc_subscription *sub_temp; 232 232 233 233 /* Invalidate subscriber reference */ 234 234 ··· 278 278 */ 279 279 280 280 static void subscr_cancel(struct tipc_subscr *s, 281 - struct subscriber *subscriber) 281 + struct tipc_subscriber *subscriber) 282 282 { 283 - struct subscription *sub; 284 - struct subscription *sub_temp; 283 + struct tipc_subscription *sub; 284 + struct tipc_subscription *sub_temp; 285 285 int found = 0; 286 286 287 287 /* Find first matching subscription, exit if not found */ ··· 314 314 * Called with subscriber port locked. 315 315 */ 316 316 317 - static struct subscription *subscr_subscribe(struct tipc_subscr *s, 318 - struct subscriber *subscriber) 317 + static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, 318 + struct tipc_subscriber *subscriber) 319 319 { 320 - struct subscription *sub; 320 + struct tipc_subscription *sub; 321 321 int swap; 322 322 323 323 /* Determine subscriber's endianness */ ··· 393 393 unsigned int size, 394 394 int reason) 395 395 { 396 - struct subscriber *subscriber = usr_handle; 396 + struct tipc_subscriber *subscriber = usr_handle; 397 397 spinlock_t *subscriber_lock; 398 398 399 399 if (tipc_port_lock(port_ref) == NULL) ··· 416 416 const unchar *data, 417 417 u32 size) 418 418 { 419 - struct subscriber *subscriber = usr_handle; 419 + struct tipc_subscriber *subscriber = usr_handle; 420 420 spinlock_t *subscriber_lock; 421 - struct subscription *sub; 421 + struct tipc_subscription *sub; 422 422 423 423 /* 424 424 * Lock subscriber's server port (& make a local copy of lock pointer, ··· 471 471 struct tipc_portid const *orig, 472 472 struct tipc_name_seq const *dest) 473 473 { 474 - struct subscriber *subscriber; 474 + struct tipc_subscriber *subscriber; 475 475 u32 server_port_ref; 476 476 477 477 /* Create subscriber object */ 478 478 479 - subscriber = kzalloc(sizeof(struct subscriber), GFP_ATOMIC); 479 + subscriber = kzalloc(sizeof(struct tipc_subscriber), GFP_ATOMIC); 480 480 if (subscriber == NULL) { 481 481 warn("Subscriber rejected, no memory\n"); 482 482 return; ··· 568 568 569 569 void tipc_subscr_stop(void) 570 570 { 571 - struct subscriber *subscriber; 572 - struct subscriber *subscriber_temp; 571 + struct tipc_subscriber *subscriber; 572 + struct tipc_subscriber *subscriber_temp; 573 573 spinlock_t *subscriber_lock; 574 574 575 575 if (topsrv.setup_port) {
+5 -5
net/tipc/subscr.h
··· 37 37 #ifndef _TIPC_SUBSCR_H 38 38 #define _TIPC_SUBSCR_H 39 39 40 - struct subscription; 40 + struct tipc_subscription; 41 41 42 42 /** 43 - * struct subscription - TIPC network topology subscription object 43 + * struct tipc_subscription - TIPC network topology subscription object 44 44 * @seq: name sequence associated with subscription 45 45 * @timeout: duration of subscription (in ms) 46 46 * @filter: event filtering to be done for subscription ··· 52 52 * @evt: template for events generated by subscription 53 53 */ 54 54 55 - struct subscription { 55 + struct tipc_subscription { 56 56 struct tipc_name_seq seq; 57 57 u32 timeout; 58 58 u32 filter; ··· 64 64 struct tipc_event evt; 65 65 }; 66 66 67 - int tipc_subscr_overlap(struct subscription *sub, 67 + int tipc_subscr_overlap(struct tipc_subscription *sub, 68 68 u32 found_lower, 69 69 u32 found_upper); 70 70 71 - void tipc_subscr_report_overlap(struct subscription *sub, 71 + void tipc_subscr_report_overlap(struct tipc_subscription *sub, 72 72 u32 found_lower, 73 73 u32 found_upper, 74 74 u32 event,