Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18756
b: refs/heads/master
c: 2f970d8
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 17, 2006
1 parent 644d368 commit c80fead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8243126c5e29030bf1a3fb75187a513966dcba62
refs/heads/master: 2f970d83576cf4938fd75551c465050f6a16c33c
14 changes: 4 additions & 10 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,8 @@ static unsigned rt_hash_mask;
static int rt_hash_log;
static unsigned int rt_hash_rnd;

static struct rt_cache_stat *rt_cache_stat;
#define RT_CACHE_STAT_INC(field) \
(per_cpu_ptr(rt_cache_stat, raw_smp_processor_id())->field++)
static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat);
#define RT_CACHE_STAT_INC(field) (__get_cpu_var(rt_cache_stat).field++)

static int rt_intern_hash(unsigned hash, struct rtable *rth,
struct rtable **res);
Expand Down Expand Up @@ -401,7 +400,7 @@ static void *rt_cpu_seq_start(struct seq_file *seq, loff_t *pos)
if (!cpu_possible(cpu))
continue;
*pos = cpu+1;
return per_cpu_ptr(rt_cache_stat, cpu);
return &per_cpu(rt_cache_stat, cpu);
}
return NULL;
}
Expand All @@ -414,7 +413,7 @@ static void *rt_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
if (!cpu_possible(cpu))
continue;
*pos = cpu+1;
return per_cpu_ptr(rt_cache_stat, cpu);
return &per_cpu(rt_cache_stat, cpu);
}
return NULL;

Expand Down Expand Up @@ -3160,10 +3159,6 @@ int __init ip_rt_init(void)
ipv4_dst_ops.gc_thresh = (rt_hash_mask + 1);
ip_rt_max_size = (rt_hash_mask + 1) * 16;

rt_cache_stat = alloc_percpu(struct rt_cache_stat);
if (!rt_cache_stat)
return -ENOMEM;

devinet_init();
ip_fib_init();

Expand Down Expand Up @@ -3191,7 +3186,6 @@ int __init ip_rt_init(void)
if (!proc_net_fops_create("rt_cache", S_IRUGO, &rt_cache_seq_fops) ||
!(rtstat_pde = create_proc_entry("rt_cache", S_IRUGO,
proc_net_stat))) {
free_percpu(rt_cache_stat);
return -ENOMEM;
}
rtstat_pde->proc_fops = &rt_cpu_seq_fops;
Expand Down

0 comments on commit c80fead

Please sign in to comment.