Commit 160f17e345f5b50484d6cdc985b8686a05bf015d

Authored by Wang Chen
Committed by David S. Miller
1 parent 25296d599c

[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>

Showing 2 changed files with 3 additions and 6 deletions Side-by-side Diff

... ... @@ -132,12 +132,11 @@
132 132 {
133 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 137 if (!ent)
137 138 printk(KERN_WARNING
138 139 "sctp_dbg_objcnt: Unable to create /proc entry.\n");
139   - else
140   - ent->proc_fops = &sctp_objcnt_ops;
141 140 }
142 141  
143 142 /* Cleanup the objcount entry in the proc filesystem. */
... ... @@ -108,11 +108,9 @@
108 108 {
109 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 112 if (!p)
113 113 return -ENOMEM;
114   -
115   - p->proc_fops = &sctp_snmp_seq_fops;
116 114  
117 115 return 0;
118 116 }