summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2010-02-18 09:13:30 +0100
committerDavid S. Miller <davem@davemloft.net>2010-02-18 23:30:17 +0100
commitbbef49daca35d4fd21bf606a10b6980f17d9df5d (patch)
tree44b7df91941c3266286b8046890ddc7c0dfa26ec
parentipv6: remove stale MIB definitions (diff)
downloadlinux-bbef49daca35d4fd21bf606a10b6980f17d9df5d.tar.xz
linux-bbef49daca35d4fd21bf606a10b6980f17d9df5d.zip
ipv6: use standard lists for FIB walks
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--net/ipv6/ip6_fib.c17
2 files changed, 5 insertions, 14 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 8f279ddb3593..86f46c49e318 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -124,7 +124,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
}
struct fib6_walker_t {
- struct fib6_walker_t *prev, *next;
+ struct list_head lh;
struct fib6_node *root, *node;
struct rt6_info *leaf;
unsigned char state;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 77e122f53ea6..2f9847924fa5 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -93,29 +93,20 @@ static __u32 rt_sernum;
static void fib6_gc_timer_cb(unsigned long arg);
-static struct fib6_walker_t fib6_walker_list = {
- .prev = &fib6_walker_list,
- .next = &fib6_walker_list,
-};
-
-#define FOR_WALKERS(w) for ((w)=fib6_walker_list.next; (w) != &fib6_walker_list; (w)=(w)->next)
+static LIST_HEAD(fib6_walkers);
+#define FOR_WALKERS(w) list_for_each_entry(w, &fib6_walkers, lh)
static inline void fib6_walker_link(struct fib6_walker_t *w)
{
write_lock_bh(&fib6_walker_lock);
- w->next = fib6_walker_list.next;
- w->prev = &fib6_walker_list;
- w->next->prev = w;
- w->prev->next = w;
+ list_add(&w->lh, &fib6_walkers);
write_unlock_bh(&fib6_walker_lock);
}
static inline void fib6_walker_unlink(struct fib6_walker_t *w)
{
write_lock_bh(&fib6_walker_lock);
- w->next->prev = w->prev;
- w->prev->next = w->next;
- w->prev = w->next = w;
+ list_del(&w->lh);
write_unlock_bh(&fib6_walker_lock);
}
static __inline__ u32 fib6_new_sernum(void)