netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv4 -- proc_net_fops_create
@ 2003-09-11 22:43 Stephen Hemminger
  2003-09-11 22:50 ` YOSHIFUJI Hideaki / 吉藤英明
       [not found] ` <20030911235405.GA74116@compsoc.man.ac.uk>
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2003-09-11 22:43 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Use proc_net_fops_create it is cleaner.

diff -Nru a/net/ipv4/proc.c b/net/ipv4/proc.c
--- a/net/ipv4/proc.c	Thu Sep 11 15:36:06 2003
+++ b/net/ipv4/proc.c	Thu Sep 11 15:36:06 2003
@@ -240,20 +240,12 @@
 	int rc = 0;
 	struct proc_dir_entry *p;
 
-	p = create_proc_entry("netstat", S_IRUGO, proc_net);
-	if (!p)
+	if (!proc_net_fops_create("netstat", S_IRUGO, &netstat_seq_fops))
 		goto out_netstat;
-	p->proc_fops = &netstat_seq_fops;
-
-	p = create_proc_entry("snmp", S_IRUGO, proc_net);
-	if (!p)
+	if (!proc_net_fops_create("snmp", S_IRUGO, &snmp_seq_fops))
 		goto out_snmp;
-	p->proc_fops = &snmp_seq_fops;
-
-	p = create_proc_entry("sockstat", S_IRUGO, proc_net);
-	if (!p)
+	if (!proc_net_fops_create("sockstat", S_IRUGO, &sockstat_seq_fops))
 		goto out_sockstat;
-	p->proc_fops = &sockstat_seq_fops;
 out:
 	return rc;
 out_sockstat:

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

end of thread, other threads:[~2003-09-13  0:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-11 22:43 [PATCH] ipv4 -- proc_net_fops_create Stephen Hemminger
2003-09-11 22:50 ` YOSHIFUJI Hideaki / 吉藤英明
2003-09-11 23:03   ` David S. Miller
     [not found] ` <20030911235405.GA74116@compsoc.man.ac.uk>
2003-09-12 18:21   ` [PATCH] proc_net macro's for non-proc-fs case Stephen Hemminger
2003-09-13  0:13     ` David S. 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).