aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-10 05:29:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:33 -0400
commitcf7732e4cc14b56d593ff53352673e1fd5e3ba52 (patch)
tree3479e278b72f9d535a58066bc2a26238806252ce /net/ipv4/ipvs
parent39699037a5c94d7cd1363dfe48a50c78c643fd9a (diff)
[NET]: Make core networking code use seq_open_private
This concerns the ipv4 and ipv6 code mostly, but also the netlink and unix sockets. The netlink code is an example of how to use the __seq_open_private() call - it saves the net namespace on this private. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs')
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 61d023d58b5d..7345fc252a23 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -1792,24 +1792,8 @@ static const struct seq_operations ip_vs_info_seq_ops = {
1792 1792
1793static int ip_vs_info_open(struct inode *inode, struct file *file) 1793static int ip_vs_info_open(struct inode *inode, struct file *file)
1794{ 1794{
1795 struct seq_file *seq; 1795 return seq_open_private(file, &ip_vs_info_seq_ops,
1796 int rc = -ENOMEM; 1796 sizeof(struct ip_vs_iter));
1797 struct ip_vs_iter *s = kzalloc(sizeof(*s), GFP_KERNEL);
1798
1799 if (!s)
1800 goto out;
1801
1802 rc = seq_open(file, &ip_vs_info_seq_ops);
1803 if (rc)
1804 goto out_kfree;
1805
1806 seq = file->private_data;
1807 seq->private = s;
1808out:
1809 return rc;
1810out_kfree:
1811 kfree(s);
1812 goto out;
1813} 1797}
1814 1798
1815static const struct file_operations ip_vs_info_fops = { 1799static const struct file_operations ip_vs_info_fops = {