name_distr.c (a909804f7c6cb83b7365ed23e9fd4c1267ee9ef0) name_distr.c (1110b8d33a54d1b91131e2a70ef0c3c26425b800)
1/*
2 * net/tipc/name_distr.c: TIPC name distribution code
3 *
4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, 2010-2011, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 146 unchanged lines hidden (view full) ---

155void tipc_named_publish(struct publication *publ)
156{
157 struct sk_buff *buf;
158 struct distr_item *item;
159
160 list_add_tail(&publ->local_list, &publ_lists[publ->scope]->list);
161 publ_lists[publ->scope]->size++;
162
1/*
2 * net/tipc/name_distr.c: TIPC name distribution code
3 *
4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, 2010-2011, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 146 unchanged lines hidden (view full) ---

155void tipc_named_publish(struct publication *publ)
156{
157 struct sk_buff *buf;
158 struct distr_item *item;
159
160 list_add_tail(&publ->local_list, &publ_lists[publ->scope]->list);
161 publ_lists[publ->scope]->size++;
162
163 if (publ->scope == TIPC_NODE_SCOPE)
164 return;
165
163 buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
164 if (!buf) {
165 warn("Publication distribution failure\n");
166 return;
167 }
168
169 item = (struct distr_item *)msg_data(buf_msg(buf));
170 publ_to_item(item, publ);

--- 7 unchanged lines hidden (view full) ---

178void tipc_named_withdraw(struct publication *publ)
179{
180 struct sk_buff *buf;
181 struct distr_item *item;
182
183 list_del(&publ->local_list);
184 publ_lists[publ->scope]->size--;
185
166 buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
167 if (!buf) {
168 warn("Publication distribution failure\n");
169 return;
170 }
171
172 item = (struct distr_item *)msg_data(buf_msg(buf));
173 publ_to_item(item, publ);

--- 7 unchanged lines hidden (view full) ---

181void tipc_named_withdraw(struct publication *publ)
182{
183 struct sk_buff *buf;
184 struct distr_item *item;
185
186 list_del(&publ->local_list);
187 publ_lists[publ->scope]->size--;
188
189 if (publ->scope == TIPC_NODE_SCOPE)
190 return;
191
186 buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
187 if (!buf) {
188 warn("Withdrawal distribution failure\n");
189 return;
190 }
191
192 item = (struct distr_item *)msg_data(buf_msg(buf));
193 publ_to_item(item, publ);

--- 150 unchanged lines hidden (view full) ---

344 }
345 item++;
346 }
347 write_unlock_bh(&tipc_nametbl_lock);
348 kfree_skb(buf);
349}
350
351/**
192 buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
193 if (!buf) {
194 warn("Withdrawal distribution failure\n");
195 return;
196 }
197
198 item = (struct distr_item *)msg_data(buf_msg(buf));
199 publ_to_item(item, publ);

--- 150 unchanged lines hidden (view full) ---

350 }
351 item++;
352 }
353 write_unlock_bh(&tipc_nametbl_lock);
354 kfree_skb(buf);
355}
356
357/**
352 * tipc_named_reinit - re-initialize local publication list
358 * tipc_named_reinit - re-initialize local publications
353 *
354 * This routine is called whenever TIPC networking is enabled.
359 *
360 * This routine is called whenever TIPC networking is enabled.
355 * All existing publications by this node that have "cluster" or "zone" scope
356 * are updated to reflect the node's new network address.
361 * All name table entries published by this node are updated to reflect
362 * the node's new network address.
357 */
358
359void tipc_named_reinit(void)
360{
361 struct publication *publ;
362 int scope;
363
364 write_lock_bh(&tipc_nametbl_lock);
365
363 */
364
365void tipc_named_reinit(void)
366{
367 struct publication *publ;
368 int scope;
369
370 write_lock_bh(&tipc_nametbl_lock);
371
366 for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_CLUSTER_SCOPE; scope++)
372 for (scope = TIPC_ZONE_SCOPE; scope <= TIPC_NODE_SCOPE; scope++)
367 list_for_each_entry(publ, &publ_lists[scope]->list, local_list)
368 publ->node = tipc_own_addr;
369
370 write_unlock_bh(&tipc_nametbl_lock);
371}
373 list_for_each_entry(publ, &publ_lists[scope]->list, local_list)
374 publ->node = tipc_own_addr;
375
376 write_unlock_bh(&tipc_nametbl_lock);
377}