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 = {
int __init if6_proc_init(void)
{
struct proc_dir_entry *p;
int rc = 0;
p = create_proc_entry("if_inet6", S_IRUGO, proc_net);
if (p)
p->proc_fops = &if6_fops;
else
rc = -ENOMEM;
return rc;
if (!proc_net_fops_create("if_inet6", S_IRUGO, &if6_fops))
return -ENOMEM;
return 0;
}
void if6_proc_exit(void)
{
proc_net_remove("if_inet6");
......
......@@ -581,11 +581,9 @@ static struct file_operations ac6_seq_fops = {
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;
}
......
......@@ -695,12 +695,7 @@ static struct file_operations ip6fl_seq_fops = {
void ip6_flowlabel_init()
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *p;
#endif
#ifdef CONFIG_PROC_FS
p = create_proc_entry("ip6_flowlabel", S_IRUGO, proc_net);
if (p)
p->proc_fops = &ip6fl_seq_fops;
proc_net_fops_create("ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops);
#endif
}
......
......@@ -2378,9 +2378,6 @@ int __init igmp6_init(struct net_proto_family *ops)
struct ipv6_pinfo *np;
struct sock *sk;
int err;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *p;
#endif
err = sock_create(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &igmp6_socket);
if (err < 0) {
......@@ -2399,12 +2396,8 @@ int __init igmp6_init(struct net_proto_family *ops)
np->hop_limit = 1;
#ifdef CONFIG_PROC_FS
p = create_proc_entry("igmp6", S_IRUGO, proc_net);
if (p)
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;
proc_net_fops_create("igmp6", S_IRUGO, &igmp6_mc_seq_fops);
proc_net_fops_create("mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops);
#endif
return 0;
......@@ -2414,6 +2407,7 @@ void igmp6_cleanup(void)
{
sock_release(igmp6_socket);
igmp6_socket = NULL; /* for safety */
#ifdef CONFIG_PROC_FS
proc_net_remove("mcfilter6");
proc_net_remove("igmp6");
......
......@@ -273,21 +273,16 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
int __init ipv6_misc_proc_init(void)
{
int rc = 0;
struct proc_dir_entry *p;
p = create_proc_entry("snmp6", S_IRUGO, proc_net);
if (!p)
if (!proc_net_fops_create("snmp6", S_IRUGO, &snmp6_seq_fops))
goto proc_snmp6_fail;
else
p->proc_fops = &snmp6_seq_fops;
proc_net_devsnmp6 = proc_mkdir("dev_snmp6", proc_net);
if (!proc_net_devsnmp6)
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;
else
p->proc_fops = &sockstat6_seq_fops;
out:
return rc;
......
......@@ -1059,12 +1059,8 @@ static struct file_operations raw6_seq_fops = {
int __init raw6_proc_init(void)
{
struct proc_dir_entry *p = create_proc_entry("raw6", S_IRUGO, proc_net);
if (!p)
if (!proc_net_fops_create("raw6", S_IRUGO, &raw6_seq_fops))
return -ENOMEM;
p->proc_fops = &raw6_seq_fops;
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