diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-01-18 02:14:50 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-01-18 02:14:50 -0500 |
commit | a1004d8e3d463012f231bab104325ecb15637f78 (patch) | |
tree | cefeb049cf04a6fff8c0bf1645e78007b277e3f3 /net | |
parent | e9d3897cc2205eec8b7afcc022e4730914b4f48c (diff) |
netfilter: xt_hashlimit: simplify seqfile code
Simply pass hashtable to seqfile iterators, proc entry itself is not needed.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 5bdc1fbf3ad7..944fd11c8989 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -841,8 +841,7 @@ static struct xt_match hashlimit_mt_reg[] __read_mostly = { | |||
841 | static void *dl_seq_start(struct seq_file *s, loff_t *pos) | 841 | static void *dl_seq_start(struct seq_file *s, loff_t *pos) |
842 | __acquires(htable->lock) | 842 | __acquires(htable->lock) |
843 | { | 843 | { |
844 | struct proc_dir_entry *pde = s->private; | 844 | struct xt_hashlimit_htable *htable = s->private; |
845 | struct xt_hashlimit_htable *htable = pde->data; | ||
846 | unsigned int *bucket; | 845 | unsigned int *bucket; |
847 | 846 | ||
848 | spin_lock_bh(&htable->lock); | 847 | spin_lock_bh(&htable->lock); |
@@ -859,8 +858,7 @@ static void *dl_seq_start(struct seq_file *s, loff_t *pos) | |||
859 | 858 | ||
860 | static void *dl_seq_next(struct seq_file *s, void *v, loff_t *pos) | 859 | static void *dl_seq_next(struct seq_file *s, void *v, loff_t *pos) |
861 | { | 860 | { |
862 | struct proc_dir_entry *pde = s->private; | 861 | struct xt_hashlimit_htable *htable = s->private; |
863 | struct xt_hashlimit_htable *htable = pde->data; | ||
864 | unsigned int *bucket = (unsigned int *)v; | 862 | unsigned int *bucket = (unsigned int *)v; |
865 | 863 | ||
866 | *pos = ++(*bucket); | 864 | *pos = ++(*bucket); |
@@ -874,8 +872,7 @@ static void *dl_seq_next(struct seq_file *s, void *v, loff_t *pos) | |||
874 | static void dl_seq_stop(struct seq_file *s, void *v) | 872 | static void dl_seq_stop(struct seq_file *s, void *v) |
875 | __releases(htable->lock) | 873 | __releases(htable->lock) |
876 | { | 874 | { |
877 | struct proc_dir_entry *pde = s->private; | 875 | struct xt_hashlimit_htable *htable = s->private; |
878 | struct xt_hashlimit_htable *htable = pde->data; | ||
879 | unsigned int *bucket = (unsigned int *)v; | 876 | unsigned int *bucket = (unsigned int *)v; |
880 | 877 | ||
881 | kfree(bucket); | 878 | kfree(bucket); |
@@ -917,8 +914,7 @@ static int dl_seq_real_show(struct dsthash_ent *ent, u_int8_t family, | |||
917 | 914 | ||
918 | static int dl_seq_show(struct seq_file *s, void *v) | 915 | static int dl_seq_show(struct seq_file *s, void *v) |
919 | { | 916 | { |
920 | struct proc_dir_entry *pde = s->private; | 917 | struct xt_hashlimit_htable *htable = s->private; |
921 | struct xt_hashlimit_htable *htable = pde->data; | ||
922 | unsigned int *bucket = (unsigned int *)v; | 918 | unsigned int *bucket = (unsigned int *)v; |
923 | struct dsthash_ent *ent; | 919 | struct dsthash_ent *ent; |
924 | struct hlist_node *pos; | 920 | struct hlist_node *pos; |
@@ -944,7 +940,7 @@ static int dl_proc_open(struct inode *inode, struct file *file) | |||
944 | 940 | ||
945 | if (!ret) { | 941 | if (!ret) { |
946 | struct seq_file *sf = file->private_data; | 942 | struct seq_file *sf = file->private_data; |
947 | sf->private = PDE(inode); | 943 | sf->private = PDE(inode)->data; |
948 | } | 944 | } |
949 | return ret; | 945 | return ret; |
950 | } | 946 | } |