summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/linux/list.h')
-rw-r--r--kernel/include/linux/list.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/include/linux/list.h b/kernel/include/linux/list.h
index feb773c76..993395a2e 100644
--- a/kernel/include/linux/list.h
+++ b/kernel/include/linux/list.h
@@ -87,7 +87,7 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
static inline void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
- prev->next = next;
+ WRITE_ONCE(prev->next, next);
}
/**
@@ -615,7 +615,8 @@ static inline void __hlist_del(struct hlist_node *n)
{
struct hlist_node *next = n->next;
struct hlist_node **pprev = n->pprev;
- *pprev = next;
+
+ WRITE_ONCE(*pprev, next);
if (next)
next->pprev = pprev;
}
@@ -672,6 +673,11 @@ static inline void hlist_add_fake(struct hlist_node *n)
n->pprev = &n->next;
}
+static inline bool hlist_fake(struct hlist_node *h)
+{
+ return h->pprev == &h->next;
+}
+
/*
* Move a list from one list head to another. Fixup the pprev
* reference of the first entry if it exists.