route.c (fd0b45dfd1858c6b49d06355a460bcf36d654c06) route.c (0bcceadceb0907094ba4e40bf9a7cd9b080f13fb)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

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

278
279 for (st->bucket = rt_hash_mask; st->bucket >= 0; --st->bucket) {
280 rcu_read_lock_bh();
281 r = rt_hash_table[st->bucket].chain;
282 if (r)
283 break;
284 rcu_read_unlock_bh();
285 }
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

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

278
279 for (st->bucket = rt_hash_mask; st->bucket >= 0; --st->bucket) {
280 rcu_read_lock_bh();
281 r = rt_hash_table[st->bucket].chain;
282 if (r)
283 break;
284 rcu_read_unlock_bh();
285 }
286 return r;
286 return rcu_dereference(r);
287}
288
289static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
290{
287}
288
289static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
290{
291 struct rt_cache_iter_state *st = rcu_dereference(seq->private);
291 struct rt_cache_iter_state *st = seq->private;
292
293 r = r->u.dst.rt_next;
294 while (!r) {
295 rcu_read_unlock_bh();
296 if (--st->bucket < 0)
297 break;
298 rcu_read_lock_bh();
299 r = rt_hash_table[st->bucket].chain;
300 }
292
293 r = r->u.dst.rt_next;
294 while (!r) {
295 rcu_read_unlock_bh();
296 if (--st->bucket < 0)
297 break;
298 rcu_read_lock_bh();
299 r = rt_hash_table[st->bucket].chain;
300 }
301 return r;
301 return rcu_dereference(r);
302}
303
304static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)
305{
306 struct rtable *r = rt_cache_get_first(seq);
307
308 if (r)
309 while (pos && (r = rt_cache_get_next(seq, r)))

--- 2698 unchanged lines hidden ---
302}
303
304static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)
305{
306 struct rtable *r = rt_cache_get_first(seq);
307
308 if (r)
309 while (pos && (r = rt_cache_get_next(seq, r)))

--- 2698 unchanged lines hidden ---