提交 ae325dcd 编写于 作者: N Nikos Tsironis 提交者: Mike Snitzer

list: Don't use WRITE_ONCE() in hlist_add_behind()

Commit 1c97be67 ("list: Use WRITE_ONCE() when adding to lists and
hlists") introduced the use of WRITE_ONCE() to atomically write the list
head's ->next pointer.

hlist_add_behind() doesn't touch the hlist head's ->first pointer so
there is no reason to use WRITE_ONCE() in this case.
Co-developed-by: NIlias Tsitsimpis <iliastsi@arrikto.com>
Signed-off-by: NNikos Tsironis <ntsironis@arrikto.com>
Reviewed-by: NPaul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 e28adc3b
......@@ -754,7 +754,7 @@ static inline void hlist_add_behind(struct hlist_node *n,
struct hlist_node *prev)
{
n->next = prev->next;
WRITE_ONCE(prev->next, n);
prev->next = n;
n->pprev = &prev->next;
if (n->next)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册