[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070212202200.GB28704@rere.qmqm.pl>
Date: Mon, 12 Feb 2007 21:22:00 +0100
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: netfilter-devel@...ts.netfilter.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 2.6.20 11/14] 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: Michał Mirosław <mirq-linux@...e.qmqm.pl>
--- linux-2.6.20/net/netfilter/nfnetlink_log.c.9 2007-02-12 00:19:16.000000000 +0100
+++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-12 17:05:14.000000000 +0100
@@ -929,10 +929,8 @@ struct iter_state {
unsigned int bucket;
};
-static struct hlist_node *get_first(struct seq_file *seq)
+static struct hlist_node *get_first(struct iter_state *st)
{
- struct iter_state *st = seq->private;
-
if (!st)
return NULL;
@@ -943,10 +941,8 @@ static struct hlist_node *get_first(stru
return NULL;
}
-static struct hlist_node *get_next(struct seq_file *seq, struct hlist_node *h)
+static struct hlist_node *get_next(struct iter_state *st, struct hlist_node *h)
{
- struct iter_state *st = seq->private;
-
h = h->next;
while (!h) {
if (++st->bucket >= INSTANCE_BUCKETS)
@@ -957,13 +953,13 @@ static struct hlist_node *get_next(struc
return h;
}
-static struct hlist_node *get_idx(struct seq_file *seq, loff_t pos)
+static struct hlist_node *get_idx(struct iter_state *st, loff_t pos)
{
struct hlist_node *head;
- head = get_first(seq);
+ head = get_first(st);
if (head)
- while (pos && (head = get_next(seq, head)))
+ while (pos && (head = get_next(st, head)))
pos--;
return pos ? NULL : head;
}
@@ -971,13 +967,13 @@ static struct hlist_node *get_idx(struct
static void *seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock_bh(&instances_lock);
- return get_idx(seq, *pos);
+ return get_idx(seq->private, *pos);
}
static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
{
(*pos)++;
- return get_next(s, v);
+ return get_next(s->private, v);
}
static void seq_stop(struct seq_file *s, void *v)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists