]> err.no Git - linux-2.6/commitdiff
[SCTP]: Use proc_create() to setup ->proc_fops first
authorWang Chen <wangchen@cn.fujitsu.com>
Thu, 28 Feb 2008 22:13:16 +0000 (14:13 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Feb 2008 22:13:16 +0000 (14:13 -0800)
Use proc_create() to make sure that ->proc_fops be setup before gluing
PDE to main tree.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/objcnt.c
net/sctp/proc.c

index 14e294e3762665759c514846334551d82a1e9ddf..cfeb07ea1b046a814592207e1da3e6b3e387f498 100644 (file)
@@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void)
 {
        struct proc_dir_entry *ent;
 
-       ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp);
+       ent = proc_create("sctp_dbg_objcnt", 0,
+                         proc_net_sctp, &sctp_objcnt_ops);
        if (!ent)
                printk(KERN_WARNING
                        "sctp_dbg_objcnt: Unable to create /proc entry.\n");
-       else
-               ent->proc_fops = &sctp_objcnt_ops;
 }
 
 /* Cleanup the objcount entry in the proc filesystem.  */
index 69bb5a63fd8bc3774817e67f2e80d3857f87768d..9e214da82d9eb0aff64f7844d219d2689cb4a475 100644 (file)
@@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("snmp", S_IRUGO, proc_net_sctp);
+       p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops);
        if (!p)
                return -ENOMEM;
 
-       p->proc_fops = &sctp_snmp_seq_fops;
-
        return 0;
 }