diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-14 01:11:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-14 01:11:14 -0400 |
commit | a4146b1b2c6ba995db08b1a2aef5af1b17b151e6 (patch) | |
tree | 972901fbb5dcc41eddd403e811cd4fbbab3ab149 /net/ipv4/tcp_ipv4.c | |
parent | 2cf83afe902fd72ef4b211774e48ab39890fb328 (diff) |
[TCP]: Replace struct net on tcp_iter_state with seq_net_private.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 52e3ae603ca9..86148cdfb21f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1954,7 +1954,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
1954 | struct hlist_node *node; | 1954 | struct hlist_node *node; |
1955 | struct sock *sk = cur; | 1955 | struct sock *sk = cur; |
1956 | struct tcp_iter_state* st = seq->private; | 1956 | struct tcp_iter_state* st = seq->private; |
1957 | struct net *net = st->net; | 1957 | struct net *net = seq_file_net(seq); |
1958 | 1958 | ||
1959 | if (!sk) { | 1959 | if (!sk) { |
1960 | st->bucket = 0; | 1960 | st->bucket = 0; |
@@ -2035,7 +2035,7 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos) | |||
2035 | static void *established_get_first(struct seq_file *seq) | 2035 | static void *established_get_first(struct seq_file *seq) |
2036 | { | 2036 | { |
2037 | struct tcp_iter_state* st = seq->private; | 2037 | struct tcp_iter_state* st = seq->private; |
2038 | struct net *net = st->net; | 2038 | struct net *net = seq_file_net(seq); |
2039 | void *rc = NULL; | 2039 | void *rc = NULL; |
2040 | 2040 | ||
2041 | for (st->bucket = 0; st->bucket < tcp_hashinfo.ehash_size; ++st->bucket) { | 2041 | for (st->bucket = 0; st->bucket < tcp_hashinfo.ehash_size; ++st->bucket) { |
@@ -2076,7 +2076,7 @@ static void *established_get_next(struct seq_file *seq, void *cur) | |||
2076 | struct inet_timewait_sock *tw; | 2076 | struct inet_timewait_sock *tw; |
2077 | struct hlist_node *node; | 2077 | struct hlist_node *node; |
2078 | struct tcp_iter_state* st = seq->private; | 2078 | struct tcp_iter_state* st = seq->private; |
2079 | struct net *net = st->net; | 2079 | struct net *net = seq_file_net(seq); |
2080 | 2080 | ||
2081 | ++st->num; | 2081 | ++st->num; |
2082 | 2082 | ||
@@ -2233,7 +2233,7 @@ static int tcp_seq_open(struct inode *inode, struct file *file) | |||
2233 | s->seq_ops.next = tcp_seq_next; | 2233 | s->seq_ops.next = tcp_seq_next; |
2234 | s->seq_ops.show = afinfo->seq_show; | 2234 | s->seq_ops.show = afinfo->seq_show; |
2235 | s->seq_ops.stop = tcp_seq_stop; | 2235 | s->seq_ops.stop = tcp_seq_stop; |
2236 | s->net = net; | 2236 | s->p.net = net; |
2237 | 2237 | ||
2238 | rc = seq_open(file, &s->seq_ops); | 2238 | rc = seq_open(file, &s->seq_ops); |
2239 | if (rc) | 2239 | if (rc) |
@@ -2252,9 +2252,8 @@ out_kfree: | |||
2252 | static int tcp_seq_release(struct inode *inode, struct file *file) | 2252 | static int tcp_seq_release(struct inode *inode, struct file *file) |
2253 | { | 2253 | { |
2254 | struct seq_file *seq = file->private_data; | 2254 | struct seq_file *seq = file->private_data; |
2255 | struct tcp_iter_state *s = seq->private; | ||
2256 | 2255 | ||
2257 | put_net(s->net); | 2256 | put_net(seq_file_net(seq)); |
2258 | seq_release_private(inode, file); | 2257 | seq_release_private(inode, file); |
2259 | return 0; | 2258 | return 0; |
2260 | } | 2259 | } |