提交 6440cc9e 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

[IPV4] fib_trie: fix warning from rcu_assign_poinger

This gets rid of a warning caused by the test in rcu_assign_pointer.
I tried to fix rcu_assign_pointer, but that devolved into a long set
of discussions about doing it right that came to no real solution.
Since the test in rcu_assign_pointer for constant NULL would never
succeed in fib_trie, just open code instead.
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 69d15067
...@@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node) ...@@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
return rcu_dereference(ret); return rcu_dereference(ret);
} }
/* Same as rcu_assign_pointer
* but that macro() assumes that value is a pointer.
*/
static inline void node_set_parent(struct node *node, struct tnode *ptr) static inline void node_set_parent(struct node *node, struct tnode *ptr)
{ {
rcu_assign_pointer(node->parent, smp_wmb();
(unsigned long)ptr | NODE_TYPE(node)); node->parent = (unsigned long)ptr | NODE_TYPE(node);
} }
static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i) static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册