Commit 6f191efe authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[UDP]: Replace struct net on udp_iter_state with seq_net_private.


Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0f55e0e
...@@ -194,7 +194,7 @@ struct udp_seq_afinfo { ...@@ -194,7 +194,7 @@ struct udp_seq_afinfo {
}; };
struct udp_iter_state { struct udp_iter_state {
struct net *net; struct seq_net_private p;
sa_family_t family; sa_family_t family;
struct hlist_head *hashtable; struct hlist_head *hashtable;
int bucket; int bucket;
......
...@@ -1503,7 +1503,7 @@ static struct sock *udp_get_first(struct seq_file *seq) ...@@ -1503,7 +1503,7 @@ static struct sock *udp_get_first(struct seq_file *seq)
{ {
struct sock *sk; struct sock *sk;
struct udp_iter_state *state = seq->private; struct udp_iter_state *state = seq->private;
struct net *net = state->net; struct net *net = seq_file_net(seq);
for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) {
struct hlist_node *node; struct hlist_node *node;
...@@ -1522,7 +1522,7 @@ found: ...@@ -1522,7 +1522,7 @@ found:
static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
{ {
struct udp_iter_state *state = seq->private; struct udp_iter_state *state = seq->private;
struct net *net = state->net; struct net *net = seq_file_net(seq);
do { do {
sk = sk_next(sk); sk = sk_next(sk);
...@@ -1595,7 +1595,7 @@ static int udp_seq_open(struct inode *inode, struct file *file) ...@@ -1595,7 +1595,7 @@ static int udp_seq_open(struct inode *inode, struct file *file)
s->seq_ops.next = udp_seq_next; s->seq_ops.next = udp_seq_next;
s->seq_ops.show = afinfo->seq_show; s->seq_ops.show = afinfo->seq_show;
s->seq_ops.stop = udp_seq_stop; s->seq_ops.stop = udp_seq_stop;
s->net = net; s->p.net = net;
rc = seq_open(file, &s->seq_ops); rc = seq_open(file, &s->seq_ops);
if (rc) if (rc)
...@@ -1617,7 +1617,7 @@ static int udp_seq_release(struct inode *inode, struct file *file) ...@@ -1617,7 +1617,7 @@ static int udp_seq_release(struct inode *inode, struct file *file)
struct seq_file *seq = file->private_data; struct seq_file *seq = file->private_data;
struct udp_iter_state *s = seq->private; struct udp_iter_state *s = seq->private;
put_net(s->net); put_net(s->p.net);
seq_release_private(inode, file); seq_release_private(inode, file);
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment