From: Stephen Hemminger <shemminger@osdl.org>
To: David Miller <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] ipv4 -- proc_net_fops_create
Date: Thu, 11 Sep 2003 15:43:57 -0700 [thread overview]
Message-ID: <20030911154357.6b31891c.shemminger@osdl.org> (raw)
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:
next reply other threads:[~2003-09-11 22:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-11 22:43 Stephen Hemminger [this message]
2003-09-11 22:50 ` [PATCH] ipv4 -- proc_net_fops_create 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030911154357.6b31891c.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).