aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-18 07:07:21 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 07:07:21 -0400
commitde05c557b24c7dffc6d392e3db120cf11c9f6ae7 (patch)
treed1d6fe1323657afd7d416c6af8a62d6a9e1e1e66 /net/ipv6/route.c
parent60bdde95807e982a824be9cfdd35055cc721a88a (diff)
proc: consolidate per-net single_open callers
There are already 7 of them - time to kill some duplicate code. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5d6c166dfbb6..fb7ff8f0c6db 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2416,18 +2416,7 @@ static int ipv6_route_show(struct seq_file *m, void *v)
2416 2416
2417static int ipv6_route_open(struct inode *inode, struct file *file) 2417static int ipv6_route_open(struct inode *inode, struct file *file)
2418{ 2418{
2419 int err; 2419 return single_open_net(inode, file, ipv6_route_show);
2420 struct net *net = get_proc_net(inode);
2421 if (!net)
2422 return -ENXIO;
2423
2424 err = single_open(file, ipv6_route_show, net);
2425 if (err < 0) {
2426 put_net(net);
2427 return err;
2428 }
2429
2430 return 0;
2431} 2420}
2432 2421
2433static int ipv6_route_release(struct inode *inode, struct file *file) 2422static int ipv6_route_release(struct inode *inode, struct file *file)
@@ -2463,18 +2452,7 @@ static int rt6_stats_seq_show(struct seq_file *seq, void *v)
2463 2452
2464static int rt6_stats_seq_open(struct inode *inode, struct file *file) 2453static int rt6_stats_seq_open(struct inode *inode, struct file *file)
2465{ 2454{
2466 int err; 2455 return single_open_net(inode, file, rt6_stats_seq_show);
2467 struct net *net = get_proc_net(inode);
2468 if (!net)
2469 return -ENXIO;
2470
2471 err = single_open(file, rt6_stats_seq_show, net);
2472 if (err < 0) {
2473 put_net(net);
2474 return err;
2475 }
2476
2477 return 0;
2478} 2456}
2479 2457
2480static int rt6_stats_seq_release(struct inode *inode, struct file *file) 2458static int rt6_stats_seq_release(struct inode *inode, struct file *file)