batman-adv: Make bat_priv->primary_if an rcu protected pointer
[pandora-kernel.git] / net / batman-adv / types.h
index 83445cf..947bafc 100644 (file)
@@ -67,7 +67,7 @@ struct hard_iface {
 struct orig_node {
        uint8_t orig[ETH_ALEN];
        uint8_t primary_addr[ETH_ALEN];
-       struct neigh_node *router;
+       struct neigh_node __rcu *router; /* rcu protected pointer */
        unsigned long *bcast_own;
        uint8_t *bcast_own_sum;
        unsigned long last_valid;
@@ -83,7 +83,7 @@ struct orig_node {
        uint32_t last_bcast_seqno;
        struct hlist_head neigh_list;
        struct list_head frag_list;
-       spinlock_t neigh_list_lock; /* protects neighbor list */
+       spinlock_t neigh_list_lock; /* protects neigh_list and router */
        atomic_t refcount;
        struct rcu_head rcu;
        struct hlist_node hash_entry;
@@ -125,6 +125,7 @@ struct neigh_node {
        struct rcu_head rcu;
        struct orig_node *orig_node;
        struct hard_iface *if_incoming;
+       spinlock_t tq_lock;     /* protects: tq_recv, tq_index */
 };
 
 
@@ -146,9 +147,8 @@ struct bat_priv {
        atomic_t batman_queue_left;
        char num_ifaces;
        struct hlist_head softif_neigh_list;
-       struct softif_neigh *softif_neigh;
+       struct softif_neigh __rcu *softif_neigh;
        struct debug_log *debug_log;
-       struct hard_iface *primary_if;
        struct kobject *mesh_obj;
        struct dentry *debug_dir;
        struct hlist_head forw_bat_list;
@@ -173,6 +173,7 @@ struct bat_priv {
        struct delayed_work orig_work;
        struct delayed_work vis_work;
        struct gw_node __rcu *curr_gw;  /* rcu protected pointer */
+       struct hard_iface __rcu *primary_if;  /* rcu protected pointer */
        struct vis_info *my_vis_info;
 };