diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-18 07:07:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 07:07:44 -0400 |
commit | b6fcbdb4f283f7ba67cec3cda6be23da8e959031 (patch) | |
tree | 45d72a4a5d0cce9ab2c98321f4d7d122bf982a55 /net/ipv6 | |
parent | de05c557b24c7dffc6d392e3db120cf11c9f6ae7 (diff) |
proc: consolidate per-net single-release callers
They are symmetrical to single_open ones :)
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/proc.c | 10 | ||||
-rw-r--r-- | net/ipv6/route.c | 20 |
2 files changed, 3 insertions, 27 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 29c5a79444c2..70940b3654a1 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -186,20 +186,12 @@ static int sockstat6_seq_open(struct inode *inode, struct file *file) | |||
186 | return single_open_net(inode, file, sockstat6_seq_show); | 186 | return single_open_net(inode, file, sockstat6_seq_show); |
187 | } | 187 | } |
188 | 188 | ||
189 | static int sockstat6_seq_release(struct inode *inode, struct file *file) | ||
190 | { | ||
191 | struct net *net = ((struct seq_file *)file->private_data)->private; | ||
192 | |||
193 | put_net(net); | ||
194 | return single_release(inode, file); | ||
195 | } | ||
196 | |||
197 | static const struct file_operations sockstat6_seq_fops = { | 189 | static const struct file_operations sockstat6_seq_fops = { |
198 | .owner = THIS_MODULE, | 190 | .owner = THIS_MODULE, |
199 | .open = sockstat6_seq_open, | 191 | .open = sockstat6_seq_open, |
200 | .read = seq_read, | 192 | .read = seq_read, |
201 | .llseek = seq_lseek, | 193 | .llseek = seq_lseek, |
202 | .release = sockstat6_seq_release, | 194 | .release = single_release_net, |
203 | }; | 195 | }; |
204 | 196 | ||
205 | static int snmp6_seq_open(struct inode *inode, struct file *file) | 197 | static int snmp6_seq_open(struct inode *inode, struct file *file) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index fb7ff8f0c6db..cb8a51271b67 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2419,20 +2419,12 @@ static int ipv6_route_open(struct inode *inode, struct file *file) | |||
2419 | return single_open_net(inode, file, ipv6_route_show); | 2419 | return single_open_net(inode, file, ipv6_route_show); |
2420 | } | 2420 | } |
2421 | 2421 | ||
2422 | static int ipv6_route_release(struct inode *inode, struct file *file) | ||
2423 | { | ||
2424 | struct seq_file *seq = file->private_data; | ||
2425 | struct net *net = seq->private; | ||
2426 | put_net(net); | ||
2427 | return single_release(inode, file); | ||
2428 | } | ||
2429 | |||
2430 | static const struct file_operations ipv6_route_proc_fops = { | 2422 | static const struct file_operations ipv6_route_proc_fops = { |
2431 | .owner = THIS_MODULE, | 2423 | .owner = THIS_MODULE, |
2432 | .open = ipv6_route_open, | 2424 | .open = ipv6_route_open, |
2433 | .read = seq_read, | 2425 | .read = seq_read, |
2434 | .llseek = seq_lseek, | 2426 | .llseek = seq_lseek, |
2435 | .release = ipv6_route_release, | 2427 | .release = single_release_net, |
2436 | }; | 2428 | }; |
2437 | 2429 | ||
2438 | static int rt6_stats_seq_show(struct seq_file *seq, void *v) | 2430 | static int rt6_stats_seq_show(struct seq_file *seq, void *v) |
@@ -2455,20 +2447,12 @@ static int rt6_stats_seq_open(struct inode *inode, struct file *file) | |||
2455 | return single_open_net(inode, file, rt6_stats_seq_show); | 2447 | return single_open_net(inode, file, rt6_stats_seq_show); |
2456 | } | 2448 | } |
2457 | 2449 | ||
2458 | static int rt6_stats_seq_release(struct inode *inode, struct file *file) | ||
2459 | { | ||
2460 | struct seq_file *seq = file->private_data; | ||
2461 | struct net *net = (struct net *)seq->private; | ||
2462 | put_net(net); | ||
2463 | return single_release(inode, file); | ||
2464 | } | ||
2465 | |||
2466 | static const struct file_operations rt6_stats_seq_fops = { | 2450 | static const struct file_operations rt6_stats_seq_fops = { |
2467 | .owner = THIS_MODULE, | 2451 | .owner = THIS_MODULE, |
2468 | .open = rt6_stats_seq_open, | 2452 | .open = rt6_stats_seq_open, |
2469 | .read = seq_read, | 2453 | .read = seq_read, |
2470 | .llseek = seq_lseek, | 2454 | .llseek = seq_lseek, |
2471 | .release = rt6_stats_seq_release, | 2455 | .release = single_release_net, |
2472 | }; | 2456 | }; |
2473 | #endif /* CONFIG_PROC_FS */ | 2457 | #endif /* CONFIG_PROC_FS */ |
2474 | 2458 | ||