summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorNikos Tsironis <ntsironis@arrikto.com>2019-03-17 14:22:53 +0200
committerMike Snitzer <snitzer@redhat.com>2019-04-18 16:18:26 -0400
commitae325dcd1905925557dfdd03ae4b97e7ac6cd6a6 (patch)
tree591d4b5fee5df80217fa84d580fafe8d3be40f4c /include/linux/list.h
parente28adc3bf34e434b30e8d063df4823ba0f3e0529 (diff)
list: Don't use WRITE_ONCE() in hlist_add_behind()
Commit 1c97be677f72b3 ("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: Ilias Tsitsimpis <iliastsi@arrikto.com> Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com> Reviewed-by: Paul E. McKenney <paulmck@linux.ibm.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 58aa3adf94e6..e137b98cd31a 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -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)