From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, "Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 1/6 net-2.6.26] [UDP]: Replace struct net on udp_iter_state with seq_net_private.
Date: Thu, 27 Mar 2008 17:11:33 +0300 [thread overview]
Message-ID: <1206627098-2456-1-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1206627041.2109.15.camel@iris.sw.ru>
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
include/net/udp.h | 2 +-
net/ipv4/udp.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/net/udp.h b/include/net/udp.h
index 635940d..77af7d4 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -194,7 +194,7 @@ struct udp_seq_afinfo {
};
struct udp_iter_state {
- struct net *net;
+ struct seq_net_private p;
sa_family_t family;
struct hlist_head *hashtable;
int bucket;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 80007c7..6d740ad 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1506,7 +1506,7 @@ static struct sock *udp_get_first(struct seq_file *seq)
{
struct sock *sk;
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) {
struct hlist_node *node;
@@ -1525,7 +1525,7 @@ found:
static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
{
struct udp_iter_state *state = seq->private;
- struct net *net = state->net;
+ struct net *net = seq_file_net(seq);
do {
sk = sk_next(sk);
@@ -1598,7 +1598,7 @@ static int udp_seq_open(struct inode *inode, struct file *file)
s->seq_ops.next = udp_seq_next;
s->seq_ops.show = afinfo->seq_show;
s->seq_ops.stop = udp_seq_stop;
- s->net = net;
+ s->p.net = net;
rc = seq_open(file, &s->seq_ops);
if (rc)
@@ -1620,7 +1620,7 @@ static int udp_seq_release(struct inode *inode, struct file *file)
struct seq_file *seq = file->private_data;
struct udp_iter_state *s = seq->private;
- put_net(s->net);
+ put_net(s->p.net);
seq_release_private(inode, file);
return 0;
}
--
1.5.3.rc5
next prev parent reply other threads:[~2008-03-27 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-27 14:10 [PATCH 0/6 net-2.6.26] [UDP]: udp_proc_register simplification Denis V. Lunev
2008-03-27 14:11 ` Denis V. Lunev [this message]
2008-03-27 14:11 ` [PATCH 2/6 net-2.6.26] [UDP]: No need to check afinfo != NULL in udp_proc_(un)register Denis V. Lunev
2008-03-27 14:11 ` [PATCH 3/6 net-2.6.26] [UDP]: Move seq_ops from udp_iter_state to udp_seq_afinfo Denis V. Lunev
2008-03-27 14:11 ` [PATCH 4/6 net-2.6.26] [UDP]: Cleanup /proc/udp[6] creation/removal Denis V. Lunev
2008-03-27 14:11 ` [PATCH 5/6 net-2.6.26] [UDP]: Place file operations directly into udp_seq_afinfo Denis V. Lunev
2008-03-27 14:11 ` [PATCH 6/6 net-2.6.26] [UDP]: Remove owner from udp_seq_afinfo Denis V. Lunev
2008-03-29 1:26 ` [PATCH 0/6 net-2.6.26] [UDP]: udp_proc_register simplification David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1206627098-2456-1-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).