Commit 6e79d85d authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

netfilter: assign PDE->data before gluing PDE into /proc tree

Simply replace proc_create and further data assigned with proc_create_data.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Acked-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7fe2336
...@@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip, ...@@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip,
/* create proc dir entry */ /* create proc dir entry */
sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
c->pde = proc_create(buffer, S_IWUSR|S_IRUSR, c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
clusterip_procdir, &clusterip_proc_fops); clusterip_procdir,
&clusterip_proc_fops, c);
if (!c->pde) { if (!c->pde) {
kfree(c); kfree(c);
return NULL; return NULL;
} }
} }
c->pde->data = c;
#endif #endif
write_lock_bh(&clusterip_lock); write_lock_bh(&clusterip_lock);
......
...@@ -237,15 +237,15 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family) ...@@ -237,15 +237,15 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family)
hinfo->family = family; hinfo->family = family;
hinfo->rnd_initialized = 0; hinfo->rnd_initialized = 0;
spin_lock_init(&hinfo->lock); spin_lock_init(&hinfo->lock);
hinfo->pde = proc_create(minfo->name, 0, hinfo->pde =
proc_create_data(minfo->name, 0,
family == AF_INET ? hashlimit_procdir4 : family == AF_INET ? hashlimit_procdir4 :
hashlimit_procdir6, hashlimit_procdir6,
&dl_file_ops); &dl_file_ops, hinfo);
if (!hinfo->pde) { if (!hinfo->pde) {
vfree(hinfo); vfree(hinfo);
return -1; return -1;
} }
hinfo->pde->data = hinfo;
setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo);
hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
...@@ -301,15 +301,15 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo, ...@@ -301,15 +301,15 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo,
hinfo->rnd_initialized = 0; hinfo->rnd_initialized = 0;
spin_lock_init(&hinfo->lock); spin_lock_init(&hinfo->lock);
hinfo->pde = proc_create(minfo->name, 0, hinfo->pde =
proc_create_data(minfo->name, 0,
family == AF_INET ? hashlimit_procdir4 : family == AF_INET ? hashlimit_procdir4 :
hashlimit_procdir6, hashlimit_procdir6,
&dl_file_ops); &dl_file_ops, hinfo);
if (hinfo->pde == NULL) { if (hinfo->pde == NULL) {
vfree(hinfo); vfree(hinfo);
return -1; return -1;
} }
hinfo->pde->data = hinfo;
setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo);
hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment