diff options
| author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-02-28 17:13:16 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-02-28 17:13:16 -0500 |
| commit | 160f17e345f5b50484d6cdc985b8686a05bf015d (patch) | |
| tree | 3e455929c0b53b90ed08f123147ed52aa115c5bf | |
| parent | 25296d599ccc7e06af217329729e4d7154fa79a2 (diff) | |
[SCTP]: Use proc_create() to setup ->proc_fops first
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>
| -rw-r--r-- | net/sctp/objcnt.c | 5 | ||||
| -rw-r--r-- | net/sctp/proc.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c index 14e294e37626..cfeb07ea1b04 100644 --- a/net/sctp/objcnt.c +++ b/net/sctp/objcnt.c | |||
| @@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void) | |||
| 132 | { | 132 | { |
| 133 | struct proc_dir_entry *ent; | 133 | struct proc_dir_entry *ent; |
| 134 | 134 | ||
| 135 | ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp); | 135 | ent = proc_create("sctp_dbg_objcnt", 0, |
| 136 | proc_net_sctp, &sctp_objcnt_ops); | ||
| 136 | if (!ent) | 137 | if (!ent) |
| 137 | printk(KERN_WARNING | 138 | printk(KERN_WARNING |
| 138 | "sctp_dbg_objcnt: Unable to create /proc entry.\n"); | 139 | "sctp_dbg_objcnt: Unable to create /proc entry.\n"); |
| 139 | else | ||
| 140 | ent->proc_fops = &sctp_objcnt_ops; | ||
| 141 | } | 140 | } |
| 142 | 141 | ||
| 143 | /* Cleanup the objcount entry in the proc filesystem. */ | 142 | /* Cleanup the objcount entry in the proc filesystem. */ |
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 69bb5a63fd8b..9e214da82d9e 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
| @@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void) | |||
| 108 | { | 108 | { |
| 109 | struct proc_dir_entry *p; | 109 | struct proc_dir_entry *p; |
| 110 | 110 | ||
| 111 | p = create_proc_entry("snmp", S_IRUGO, proc_net_sctp); | 111 | p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops); |
| 112 | if (!p) | 112 | if (!p) |
| 113 | return -ENOMEM; | 113 | return -ENOMEM; |
| 114 | 114 | ||
| 115 | p->proc_fops = &sctp_snmp_seq_fops; | ||
| 116 | |||
| 117 | return 0; | 115 | return 0; |
| 118 | } | 116 | } |
| 119 | 117 | ||
