diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-18 07:07:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 07:07:21 -0400 |
commit | de05c557b24c7dffc6d392e3db120cf11c9f6ae7 (patch) | |
tree | d1d6fe1323657afd7d416c6af8a62d6a9e1e1e66 /net/ipv6/route.c | |
parent | 60bdde95807e982a824be9cfdd35055cc721a88a (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.c | 26 |
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 | ||
2417 | static int ipv6_route_open(struct inode *inode, struct file *file) | 2417 | static 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 | ||
2433 | static int ipv6_route_release(struct inode *inode, struct file *file) | 2422 | static 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 | ||
2464 | static int rt6_stats_seq_open(struct inode *inode, struct file *file) | 2453 | static 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 | ||
2480 | static int rt6_stats_seq_release(struct inode *inode, struct file *file) | 2458 | static int rt6_stats_seq_release(struct inode *inode, struct file *file) |