Commit 886214f0 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[BRIDGE]: RCU fix

Follow up to earlier RCU patch.  Since now using RCU, need to use
deferred free.  
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 2f7b3472
......@@ -217,11 +217,18 @@ struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
return fdb;
}
static void fdb_rcu_free(struct rcu_head *head)
{
struct net_bridge_fdb_entry *ent
= container_of(head, struct net_bridge_fdb_entry, rcu);
kmem_cache_free(br_fdb_cache, ent);
}
/* Set entry up for deletion with RCU */
void br_fdb_put(struct net_bridge_fdb_entry *ent)
{
if (atomic_dec_and_test(&ent->use_count))
kmem_cache_free(br_fdb_cache, ent);
call_rcu(&ent->rcu, fdb_rcu_free);
}
/*
......
......@@ -46,7 +46,10 @@ struct net_bridge_fdb_entry
{
struct hlist_node hlist;
struct net_bridge_port *dst;
struct list_head age_list;
union {
struct list_head age_list;
struct rcu_head rcu;
};
atomic_t use_count;
unsigned long ageing_timer;
mac_addr addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment