Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112089
b: refs/heads/master
c: 8e9df80
h: refs/heads/master
i:
  112087: 1aa8b55
v: v3
  • Loading branch information
Alexey Dobriyan authored and Patrick McHardy committed Oct 8, 2008
1 parent 1b3728e commit 3025f6c
Show file tree
Hide file tree
Showing 3 changed files with 19 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: 0d55af8791bfb42e04cc456b348910582f230343
refs/heads/master: 8e9df80180b73d4107bf8fbf28b1633c541d2770
14 changes: 9 additions & 5 deletions trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ static const struct file_operations ip_exp_file_ops = {

static void *ct_cpu_seq_start(struct seq_file *seq, loff_t *pos)
{
struct net *net = seq_file_net(seq);
int cpu;

if (*pos == 0)
Expand All @@ -294,21 +295,22 @@ static void *ct_cpu_seq_start(struct seq_file *seq, loff_t *pos)
if (!cpu_possible(cpu))
continue;
*pos = cpu+1;
return per_cpu_ptr(init_net.ct.stat, cpu);
return per_cpu_ptr(net->ct.stat, cpu);
}

return NULL;
}

static void *ct_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct net *net = seq_file_net(seq);
int cpu;

for (cpu = *pos; cpu < NR_CPUS; ++cpu) {
if (!cpu_possible(cpu))
continue;
*pos = cpu+1;
return per_cpu_ptr(init_net.ct.stat, cpu);
return per_cpu_ptr(net->ct.stat, cpu);
}

return NULL;
Expand All @@ -320,7 +322,8 @@ static void ct_cpu_seq_stop(struct seq_file *seq, void *v)

static int ct_cpu_seq_show(struct seq_file *seq, void *v)
{
unsigned int nr_conntracks = atomic_read(&init_net.ct.count);
struct net *net = seq_file_net(seq);
unsigned int nr_conntracks = atomic_read(&net->ct.count);
const struct ip_conntrack_stat *st = v;

if (v == SEQ_START_TOKEN) {
Expand Down Expand Up @@ -360,15 +363,16 @@ static const struct seq_operations ct_cpu_seq_ops = {

static int ct_cpu_seq_open(struct inode *inode, struct file *file)
{
return seq_open(file, &ct_cpu_seq_ops);
return seq_open_net(inode, file, &ct_cpu_seq_ops,
sizeof(struct seq_net_private));
}

static const struct file_operations ct_cpu_seq_fops = {
.owner = THIS_MODULE,
.open = ct_cpu_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.release = seq_release_net,
};

static int __net_init ip_conntrack_net_init(struct net *net)
Expand Down
14 changes: 9 additions & 5 deletions trunk/net/netfilter/nf_conntrack_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static const struct file_operations ct_file_ops = {

static void *ct_cpu_seq_start(struct seq_file *seq, loff_t *pos)
{
struct net *net = seq_file_net(seq);
int cpu;

if (*pos == 0)
Expand All @@ -203,21 +204,22 @@ static void *ct_cpu_seq_start(struct seq_file *seq, loff_t *pos)
if (!cpu_possible(cpu))
continue;
*pos = cpu + 1;
return per_cpu_ptr(init_net.ct.stat, cpu);
return per_cpu_ptr(net->ct.stat, cpu);
}

return NULL;
}

static void *ct_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct net *net = seq_file_net(seq);
int cpu;

for (cpu = *pos; cpu < NR_CPUS; ++cpu) {
if (!cpu_possible(cpu))
continue;
*pos = cpu + 1;
return per_cpu_ptr(init_net.ct.stat, cpu);
return per_cpu_ptr(net->ct.stat, cpu);
}

return NULL;
Expand All @@ -229,7 +231,8 @@ static void ct_cpu_seq_stop(struct seq_file *seq, void *v)

static int ct_cpu_seq_show(struct seq_file *seq, void *v)
{
unsigned int nr_conntracks = atomic_read(&init_net.ct.count);
struct net *net = seq_file_net(seq);
unsigned int nr_conntracks = atomic_read(&net->ct.count);
const struct ip_conntrack_stat *st = v;

if (v == SEQ_START_TOKEN) {
Expand Down Expand Up @@ -269,15 +272,16 @@ static const struct seq_operations ct_cpu_seq_ops = {

static int ct_cpu_seq_open(struct inode *inode, struct file *file)
{
return seq_open(file, &ct_cpu_seq_ops);
return seq_open_net(inode, file, &ct_cpu_seq_ops,
sizeof(struct seq_net_private));
}

static const struct file_operations ct_cpu_seq_fops = {
.owner = THIS_MODULE,
.open = ct_cpu_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.release = seq_release_net,
};

static int nf_conntrack_standalone_init_proc(struct net *net)
Expand Down

0 comments on commit 3025f6c

Please sign in to comment.