aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-10 05:29:58 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:34 -0400
commite2da59133880976586b2d9d81d798222ecafa566 (patch)
tree03cb1c61318992437e3bc040b34fa437b957c662 /net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
parentcf7732e4cc14b56d593ff53352673e1fd5e3ba52 (diff)
[NETFILTER]: Make netfilter code use the seq_open_private
Just switch to the consolidated calls. ipt_recent() has to initialize the private, so use the __seq_open_private() helper. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c')
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
index a5ae2eabf0f..741f3dfaa5a 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
@@ -174,22 +174,8 @@ static const struct seq_operations ct_seq_ops = {
174 174
175static int ct_open(struct inode *inode, struct file *file) 175static int ct_open(struct inode *inode, struct file *file)
176{ 176{
177 struct seq_file *seq; 177 return seq_open_private(file, &ct_seq_ops,
178 struct ct_iter_state *st; 178 sizeof(struct ct_iter_state));
179 int ret;
180
181 st = kzalloc(sizeof(struct ct_iter_state), GFP_KERNEL);
182 if (st == NULL)
183 return -ENOMEM;
184 ret = seq_open(file, &ct_seq_ops);
185 if (ret)
186 goto out_free;
187 seq = file->private_data;
188 seq->private = st;
189 return ret;
190out_free:
191 kfree(st);
192 return ret;
193} 179}
194 180
195static const struct file_operations ct_file_ops = { 181static const struct file_operations ct_file_ops = {
@@ -291,22 +277,8 @@ static const struct seq_operations exp_seq_ops = {
291 277
292static int exp_open(struct inode *inode, struct file *file) 278static int exp_open(struct inode *inode, struct file *file)
293{ 279{
294 struct seq_file *seq; 280 return seq_open_private(file, &exp_seq_ops,
295 struct ct_expect_iter_state *st; 281 sizeof(struct ct_expect_iter_state));
296 int ret;
297
298 st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
299 if (!st)
300 return -ENOMEM;
301 ret = seq_open(file, &exp_seq_ops);
302 if (ret)
303 goto out_free;
304 seq = file->private_data;
305 seq->private = st;
306 return ret;
307out_free:
308 kfree(st);
309 return ret;
310} 282}
311 283
312static const struct file_operations ip_exp_file_ops = { 284static const struct file_operations ip_exp_file_ops = {