Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/list.h
Context not available. | |||||
hlist_empty(const struct hlist_head *h) | hlist_empty(const struct hlist_head *h) | ||||
{ | { | ||||
return !h->first; | return !READ_ONCE(h->first); | ||||
} | |||||
static inline void | |||||
__hlist_del(struct hlist_node *n) | |||||
{ | |||||
WRITE_ONCE(*(n->pprev), n->next); | |||||
if (n->next) | |||||
n->next->pprev = n->pprev; | |||||
} | } | ||||
static inline void | static inline void | ||||
hlist_del(struct hlist_node *n) | hlist_del(struct hlist_node *n) | ||||
{ | { | ||||
if (n->next) | __hlist_del(n); | ||||
n->next->pprev = n->pprev; | |||||
*n->pprev = n->next; | |||||
} | } | ||||
static inline void | static inline void | ||||
Context not available. | |||||
n->next = h->first; | n->next = h->first; | ||||
if (h->first) | if (h->first) | ||||
h->first->pprev = &n->next; | h->first->pprev = &n->next; | ||||
h->first = n; | WRITE_ONCE(h->first, n); | ||||
n->pprev = &h->first; | n->pprev = &h->first; | ||||
} | } | ||||
Context not available. | |||||
n->pprev = next->pprev; | n->pprev = next->pprev; | ||||
n->next = next; | n->next = next; | ||||
next->pprev = &n->next; | next->pprev = &n->next; | ||||
*(n->pprev) = n; | WRITE_ONCE(*(n->pprev), n); | ||||
} | } | ||||
static inline void | static inline void | ||||
hlist_add_after(struct hlist_node *n, struct hlist_node *next) | hlist_add_behind(struct hlist_node *n, struct hlist_node *prev) | ||||
{ | { | ||||
next->next = n->next; | n->next = prev->next; | ||||
n->next = next; | WRITE_ONCE(prev->next, n); | ||||
next->pprev = &n->next; | n->pprev = &prev->next; | ||||
if (next->next) | |||||
next->next->pprev = &next->next; | if (n->next) | ||||
n->next->pprev = &n->next; | |||||
} | } | ||||
static inline void | static inline void | ||||
Context not available. |