netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/15] [SCTP]: Use proc_create() to setup ->proc_fops first
@ 2008-02-28 10:57 Wang Chen
  2008-02-28 22:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Chen @ 2008-02-28 10:57 UTC (permalink / raw)
  To: David S. Miller, NETDEV

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>
---
 net/sctp/objcnt.c |    5 ++---
 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 14e294e..cfeb07e 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -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.  */
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 69bb5a6..9e214da 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -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;
 }
 
-- 
WCN



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-28 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 10:57 [PATCH 10/15] [SCTP]: Use proc_create() to setup ->proc_fops first Wang Chen
2008-02-28 22:13 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).