@@ -113,8 +113,8 @@ struct sk_buff *tipc_named_publish(struct publication *publ)
113
113
struct sk_buff * buf ;
114
114
struct distr_item * item ;
115
115
116
- list_add_tail (& publ -> local_list ,
117
- & tipc_nametbl -> publ_list [publ -> scope ]);
116
+ list_add_tail_rcu (& publ -> local_list ,
117
+ & tipc_nametbl -> publ_list [publ -> scope ]);
118
118
119
119
if (publ -> scope == TIPC_NODE_SCOPE )
120
120
return NULL ;
@@ -208,12 +208,12 @@ void tipc_named_node_up(u32 dnode)
208
208
209
209
__skb_queue_head_init (& head );
210
210
211
- read_lock_bh ( & tipc_nametbl_lock );
211
+ rcu_read_lock ( );
212
212
named_distribute (& head , dnode ,
213
213
& tipc_nametbl -> publ_list [TIPC_CLUSTER_SCOPE ]);
214
214
named_distribute (& head , dnode ,
215
215
& tipc_nametbl -> publ_list [TIPC_ZONE_SCOPE ]);
216
- read_unlock_bh ( & tipc_nametbl_lock );
216
+ rcu_read_unlock ( );
217
217
218
218
tipc_link_xmit (& head , dnode , dnode );
219
219
}
@@ -260,12 +260,12 @@ static void tipc_publ_purge(struct publication *publ, u32 addr)
260
260
{
261
261
struct publication * p ;
262
262
263
- write_lock_bh (& tipc_nametbl_lock );
263
+ spin_lock_bh (& tipc_nametbl_lock );
264
264
p = tipc_nametbl_remove_publ (publ -> type , publ -> lower ,
265
265
publ -> node , publ -> ref , publ -> key );
266
266
if (p )
267
267
tipc_publ_unsubscribe (p , addr );
268
- write_unlock_bh (& tipc_nametbl_lock );
268
+ spin_unlock_bh (& tipc_nametbl_lock );
269
269
270
270
if (p != publ ) {
271
271
pr_err ("Unable to remove publication from failed node\n"
@@ -274,7 +274,7 @@ static void tipc_publ_purge(struct publication *publ, u32 addr)
274
274
publ -> key );
275
275
}
276
276
277
- kfree ( p );
277
+ kfree_rcu ( p , rcu );
278
278
}
279
279
280
280
void tipc_publ_notify (struct list_head * nsub_list , u32 addr )
@@ -311,7 +311,7 @@ static bool tipc_update_nametbl(struct distr_item *i, u32 node, u32 dtype)
311
311
ntohl (i -> key ));
312
312
if (publ ) {
313
313
tipc_publ_unsubscribe (publ , node );
314
- kfree (publ );
314
+ kfree_rcu (publ , rcu );
315
315
return true;
316
316
}
317
317
} else {
@@ -376,14 +376,14 @@ void tipc_named_rcv(struct sk_buff *buf)
376
376
u32 count = msg_data_sz (msg ) / ITEM_SIZE ;
377
377
u32 node = msg_orignode (msg );
378
378
379
- write_lock_bh (& tipc_nametbl_lock );
379
+ spin_lock_bh (& tipc_nametbl_lock );
380
380
while (count -- ) {
381
381
if (!tipc_update_nametbl (item , node , msg_type (msg )))
382
382
tipc_named_add_backlog (item , msg_type (msg ), node );
383
383
item ++ ;
384
384
}
385
385
tipc_named_process_backlog ();
386
- write_unlock_bh (& tipc_nametbl_lock );
386
+ spin_unlock_bh (& tipc_nametbl_lock );
387
387
kfree_skb (buf );
388
388
}
389
389
@@ -399,12 +399,12 @@ void tipc_named_reinit(void)
399
399
struct publication * publ ;
400
400
int scope ;
401
401
402
- write_lock_bh (& tipc_nametbl_lock );
402
+ spin_lock_bh (& tipc_nametbl_lock );
403
403
404
404
for (scope = TIPC_ZONE_SCOPE ; scope <= TIPC_NODE_SCOPE ; scope ++ )
405
- list_for_each_entry (publ , & tipc_nametbl -> publ_list [scope ],
406
- local_list )
405
+ list_for_each_entry_rcu (publ , & tipc_nametbl -> publ_list [scope ],
406
+ local_list )
407
407
publ -> node = tipc_own_addr ;
408
408
409
- write_unlock_bh (& tipc_nametbl_lock );
409
+ spin_unlock_bh (& tipc_nametbl_lock );
410
410
}
0 commit comments