From: Patrick McHardy <kaber@trash.net>
To: Wang Chen <wangchen@cn.fujitsu.com>
Cc: David Miller <davem@davemloft.net>, netfilter-devel@vger.kernel.org
Subject: Re: Fw: [PATCH 04/15] [NETFILTER]: Use proc_create() to setup ->proc_fops first
Date: Fri, 29 Feb 2008 13:30:35 +0100 [thread overview]
Message-ID: <47C7FAEB.7060908@trash.net> (raw)
In-Reply-To: <20080228.140543.209766510.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
David Miller wrote:
> Use proc_create() and proc_net_fops_create() to
> make sure that ->proc_fops be setup before gluing
> PDE to main tree.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
> ---
> +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> @@ -162,19 +162,16 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
> atomic_set(&c->entries, 1);
>
> #ifdef CONFIG_PROC_FS
> - {
> - char buffer[16];
> -
> - /* create proc dir entry */
> - sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
> - c->pde = create_proc_entry(buffer, S_IWUSR|S_IRUSR,
> - clusterip_procdir);
> - if (!c->pde) {
> - kfree(c);
> - return NULL;
> - }
> + char buffer[16];
Applied with this change on top to fix a compiler warning:
net/ipv4/netfilter/ipt_CLUSTERIP.c: In function 'clusterip_config_init':
net/ipv4/netfilter/ipt_CLUSTERIP.c:165: warning: ISO C90 forbids mixed
declarations and code
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 933 bytes --]
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index af44818..c20383e 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -162,17 +162,19 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
atomic_set(&c->entries, 1);
#ifdef CONFIG_PROC_FS
- char buffer[16];
-
- /* create proc dir entry */
- sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
- c->pde = proc_create(buffer, S_IWUSR|S_IRUSR,
- clusterip_procdir, &clusterip_proc_fops);
- if (!c->pde) {
- kfree(c);
- return NULL;
+ {
+ char buffer[16];
+
+ /* create proc dir entry */
+ sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
+ c->pde = proc_create(buffer, S_IWUSR|S_IRUSR,
+ clusterip_procdir, &clusterip_proc_fops);
+ if (!c->pde) {
+ kfree(c);
+ return NULL;
+ }
+ c->pde->data = c;
}
- c->pde->data = c;
#endif
write_lock_bh(&clusterip_lock);
prev parent reply other threads:[~2008-02-29 12:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-28 22:05 Fw: [PATCH 04/15] [NETFILTER]: Use proc_create() to setup ->proc_fops first David Miller
2008-02-29 12:30 ` Patrick McHardy [this message]
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=47C7FAEB.7060908@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=wangchen@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.