aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>2007-03-23 14:12:03 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:40 -0400
commitf76cdcee5ba4a3fb41de93d5f1c17fb6ab4d0820 (patch)
tree269c52133ad18a8775d11fda41ac4bbc3e23bdd8 /net
parent9a36e8c2b337c424ed77f5dea0a67dc8039d351b (diff)
[NETFILTER]: nfnetlink_log: iterator functions need iter_state * only
get_*() don't need access to seq_file - iter_state is enough for them. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_log.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 441f0fbcfb26..e934770339d3 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -919,10 +919,8 @@ struct iter_state {
919 unsigned int bucket; 919 unsigned int bucket;
920}; 920};
921 921
922static struct hlist_node *get_first(struct seq_file *seq) 922static struct hlist_node *get_first(struct iter_state *st)
923{ 923{
924 struct iter_state *st = seq->private;
925
926 if (!st) 924 if (!st)
927 return NULL; 925 return NULL;
928 926
@@ -933,10 +931,8 @@ static struct hlist_node *get_first(struct seq_file *seq)
933 return NULL; 931 return NULL;
934} 932}
935 933
936static struct hlist_node *get_next(struct seq_file *seq, struct hlist_node *h) 934static struct hlist_node *get_next(struct iter_state *st, struct hlist_node *h)
937{ 935{
938 struct iter_state *st = seq->private;
939
940 h = h->next; 936 h = h->next;
941 while (!h) { 937 while (!h) {
942 if (++st->bucket >= INSTANCE_BUCKETS) 938 if (++st->bucket >= INSTANCE_BUCKETS)
@@ -947,13 +943,13 @@ static struct hlist_node *get_next(struct seq_file *seq, struct hlist_node *h)
947 return h; 943 return h;
948} 944}
949 945
950static struct hlist_node *get_idx(struct seq_file *seq, loff_t pos) 946static struct hlist_node *get_idx(struct iter_state *st, loff_t pos)
951{ 947{
952 struct hlist_node *head; 948 struct hlist_node *head;
953 head = get_first(seq); 949 head = get_first(st);
954 950
955 if (head) 951 if (head)
956 while (pos && (head = get_next(seq, head))) 952 while (pos && (head = get_next(st, head)))
957 pos--; 953 pos--;
958 return pos ? NULL : head; 954 return pos ? NULL : head;
959} 955}
@@ -961,13 +957,13 @@ static struct hlist_node *get_idx(struct seq_file *seq, loff_t pos)
961static void *seq_start(struct seq_file *seq, loff_t *pos) 957static void *seq_start(struct seq_file *seq, loff_t *pos)
962{ 958{
963 read_lock_bh(&instances_lock); 959 read_lock_bh(&instances_lock);
964 return get_idx(seq, *pos); 960 return get_idx(seq->private, *pos);
965} 961}
966 962
967static void *seq_next(struct seq_file *s, void *v, loff_t *pos) 963static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
968{ 964{
969 (*pos)++; 965 (*pos)++;
970 return get_next(s, v); 966 return get_next(s->private, v);
971} 967}
972 968
973static void seq_stop(struct seq_file *s, void *v) 969static void seq_stop(struct seq_file *s, void *v)