diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-09-10 18:09:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-18 15:57:03 -0400 |
commit | b42664f898c976247f7f609b8bb9c94d7475ca10 (patch) | |
tree | b98e4d5d57b21d0a9dc8882bdc29e7cc7c6beccf /net | |
parent | 2885da72966fcb89f48d554339d347fb02b5ea78 (diff) |
netns: move net->ipv4.rt_genid to net->rt_genid
This commit prepares the use of rt_genid by both IPv4 and IPv6.
Initialization is left in IPv4 part.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index be27cfa96e88..fd9af60397b5 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -202,11 +202,6 @@ EXPORT_SYMBOL(ip_tos2prio); | |||
202 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); | 202 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); |
203 | #define RT_CACHE_STAT_INC(field) __this_cpu_inc(rt_cache_stat.field) | 203 | #define RT_CACHE_STAT_INC(field) __this_cpu_inc(rt_cache_stat.field) |
204 | 204 | ||
205 | static inline int rt_genid(struct net *net) | ||
206 | { | ||
207 | return atomic_read(&net->ipv4.rt_genid); | ||
208 | } | ||
209 | |||
210 | #ifdef CONFIG_PROC_FS | 205 | #ifdef CONFIG_PROC_FS |
211 | static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) | 206 | static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) |
212 | { | 207 | { |
@@ -449,7 +444,7 @@ static inline bool rt_is_expired(const struct rtable *rth) | |||
449 | 444 | ||
450 | void rt_cache_flush(struct net *net) | 445 | void rt_cache_flush(struct net *net) |
451 | { | 446 | { |
452 | atomic_inc(&net->ipv4.rt_genid); | 447 | rt_genid_bump(net); |
453 | } | 448 | } |
454 | 449 | ||
455 | static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, | 450 | static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, |
@@ -2506,7 +2501,7 @@ static __net_initdata struct pernet_operations sysctl_route_ops = { | |||
2506 | 2501 | ||
2507 | static __net_init int rt_genid_init(struct net *net) | 2502 | static __net_init int rt_genid_init(struct net *net) |
2508 | { | 2503 | { |
2509 | atomic_set(&net->ipv4.rt_genid, 0); | 2504 | atomic_set(&net->rt_genid, 0); |
2510 | get_random_bytes(&net->ipv4.dev_addr_genid, | 2505 | get_random_bytes(&net->ipv4.dev_addr_genid, |
2511 | sizeof(net->ipv4.dev_addr_genid)); | 2506 | sizeof(net->ipv4.dev_addr_genid)); |
2512 | return 0; | 2507 | return 0; |