Commit a0abe4c8 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[NET]: Use proc_net_fops_create() and proc_net_remove() in net/ipv6.

parent 5d45f59f
...@@ -2259,16 +2259,11 @@ static struct file_operations if6_fops = { ...@@ -2259,16 +2259,11 @@ static struct file_operations if6_fops = {
int __init if6_proc_init(void) int __init if6_proc_init(void)
{ {
struct proc_dir_entry *p; if (!proc_net_fops_create("if_inet6", S_IRUGO, &if6_fops))
int rc = 0; return -ENOMEM;
return 0;
p = create_proc_entry("if_inet6", S_IRUGO, proc_net);
if (p)
p->proc_fops = &if6_fops;
else
rc = -ENOMEM;
return rc;
} }
void if6_proc_exit(void) void if6_proc_exit(void)
{ {
proc_net_remove("if_inet6"); proc_net_remove("if_inet6");
......
...@@ -581,11 +581,9 @@ static struct file_operations ac6_seq_fops = { ...@@ -581,11 +581,9 @@ static struct file_operations ac6_seq_fops = {
int __init ac6_proc_init(void) int __init ac6_proc_init(void)
{ {
struct proc_dir_entry *p; if (!proc_net_fops_create("anycast6", S_IRUGO, &ac6_seq_fops))
return -ENOMEM;
p = create_proc_entry("anycast6", S_IRUGO, proc_net);
if (p)
p->proc_fops = &ac6_seq_fops;
return 0; return 0;
} }
......
...@@ -695,12 +695,7 @@ static struct file_operations ip6fl_seq_fops = { ...@@ -695,12 +695,7 @@ static struct file_operations ip6fl_seq_fops = {
void ip6_flowlabel_init() void ip6_flowlabel_init()
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *p; proc_net_fops_create("ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops);
#endif
#ifdef CONFIG_PROC_FS
p = create_proc_entry("ip6_flowlabel", S_IRUGO, proc_net);
if (p)
p->proc_fops = &ip6fl_seq_fops;
#endif #endif
} }
......
...@@ -2378,9 +2378,6 @@ int __init igmp6_init(struct net_proto_family *ops) ...@@ -2378,9 +2378,6 @@ int __init igmp6_init(struct net_proto_family *ops)
struct ipv6_pinfo *np; struct ipv6_pinfo *np;
struct sock *sk; struct sock *sk;
int err; int err;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *p;
#endif
err = sock_create(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &igmp6_socket); err = sock_create(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &igmp6_socket);
if (err < 0) { if (err < 0) {
...@@ -2399,12 +2396,8 @@ int __init igmp6_init(struct net_proto_family *ops) ...@@ -2399,12 +2396,8 @@ int __init igmp6_init(struct net_proto_family *ops)
np->hop_limit = 1; np->hop_limit = 1;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
p = create_proc_entry("igmp6", S_IRUGO, proc_net); proc_net_fops_create("igmp6", S_IRUGO, &igmp6_mc_seq_fops);
if (p) proc_net_fops_create("mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops);
p->proc_fops = &igmp6_mc_seq_fops;
p = create_proc_entry("mcfilter6", S_IRUGO, proc_net);
if (p)
p->proc_fops = &igmp6_mcf_seq_fops;
#endif #endif
return 0; return 0;
...@@ -2414,6 +2407,7 @@ void igmp6_cleanup(void) ...@@ -2414,6 +2407,7 @@ void igmp6_cleanup(void)
{ {
sock_release(igmp6_socket); sock_release(igmp6_socket);
igmp6_socket = NULL; /* for safety */ igmp6_socket = NULL; /* for safety */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_net_remove("mcfilter6"); proc_net_remove("mcfilter6");
proc_net_remove("igmp6"); proc_net_remove("igmp6");
......
...@@ -273,21 +273,16 @@ int snmp6_unregister_dev(struct inet6_dev *idev) ...@@ -273,21 +273,16 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
int __init ipv6_misc_proc_init(void) int __init ipv6_misc_proc_init(void)
{ {
int rc = 0; int rc = 0;
struct proc_dir_entry *p;
p = create_proc_entry("snmp6", S_IRUGO, proc_net); if (!proc_net_fops_create("snmp6", S_IRUGO, &snmp6_seq_fops))
if (!p)
goto proc_snmp6_fail; goto proc_snmp6_fail;
else
p->proc_fops = &snmp6_seq_fops;
proc_net_devsnmp6 = proc_mkdir("dev_snmp6", proc_net); proc_net_devsnmp6 = proc_mkdir("dev_snmp6", proc_net);
if (!proc_net_devsnmp6) if (!proc_net_devsnmp6)
goto proc_dev_snmp6_fail; goto proc_dev_snmp6_fail;
p = create_proc_entry("sockstat6", S_IRUGO, proc_net);
if (!p) if (!proc_net_fops_create("sockstat6", S_IRUGO, &sockstat6_seq_fops))
goto proc_sockstat6_fail; goto proc_sockstat6_fail;
else
p->proc_fops = &sockstat6_seq_fops;
out: out:
return rc; return rc;
......
...@@ -1059,12 +1059,8 @@ static struct file_operations raw6_seq_fops = { ...@@ -1059,12 +1059,8 @@ static struct file_operations raw6_seq_fops = {
int __init raw6_proc_init(void) int __init raw6_proc_init(void)
{ {
struct proc_dir_entry *p = create_proc_entry("raw6", S_IRUGO, proc_net); if (!proc_net_fops_create("raw6", S_IRUGO, &raw6_seq_fops))
if (!p)
return -ENOMEM; return -ENOMEM;
p->proc_fops = &raw6_seq_fops;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment