aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/raw.c
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/ipv6/raw.c
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/ipv6/raw.c')
-rw-r--r--net/ipv6/raw.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index bdd0974e6775..ca24ef19cd8f 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1289,21 +1289,8 @@ static const struct seq_operations raw6_seq_ops = {
1289 1289
1290static int raw6_seq_open(struct inode *inode, struct file *file) 1290static int raw6_seq_open(struct inode *inode, struct file *file)
1291{ 1291{
1292 struct seq_file *seq; 1292 return seq_open_private(file, &raw6_seq_ops,
1293 int rc = -ENOMEM; 1293 sizeof(struct raw6_iter_state));
1294 struct raw6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1295 if (!s)
1296 goto out;
1297 rc = seq_open(file, &raw6_seq_ops);
1298 if (rc)
1299 goto out_kfree;
1300 seq = file->private_data;
1301 seq->private = s;
1302out:
1303 return rc;
1304out_kfree:
1305 kfree(s);
1306 goto out;
1307} 1294}
1308 1295
1309static const struct file_operations raw6_seq_fops = { 1296static const struct file_operations raw6_seq_fops = {