diff options
Diffstat (limited to 'lib/llist.c')
-rw-r--r-- | lib/llist.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/llist.c b/lib/llist.c index da445724fa1f..3e3fa9139c41 100644 --- a/lib/llist.c +++ b/lib/llist.c | |||
@@ -30,28 +30,6 @@ | |||
30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * llist_add - add a new entry | ||
34 | * @new: new entry to be added | ||
35 | * @head: the head for your lock-less list | ||
36 | */ | ||
37 | void llist_add(struct llist_node *new, struct llist_head *head) | ||
38 | { | ||
39 | struct llist_node *entry, *old_entry; | ||
40 | |||
41 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
42 | BUG_ON(in_nmi()); | ||
43 | #endif | ||
44 | |||
45 | entry = head->first; | ||
46 | do { | ||
47 | old_entry = entry; | ||
48 | new->next = entry; | ||
49 | cpu_relax(); | ||
50 | } while ((entry = cmpxchg(&head->first, old_entry, new)) != old_entry); | ||
51 | } | ||
52 | EXPORT_SYMBOL_GPL(llist_add); | ||
53 | |||
54 | /** | ||
55 | * llist_add_batch - add several linked entries in batch | 33 | * llist_add_batch - add several linked entries in batch |
56 | * @new_first: first entry in batch to be added | 34 | * @new_first: first entry in batch to be added |
57 | * @new_last: last entry in batch to be added | 35 | * @new_last: last entry in batch to be added |
@@ -109,21 +87,3 @@ struct llist_node *llist_del_first(struct llist_head *head) | |||
109 | return entry; | 87 | return entry; |
110 | } | 88 | } |
111 | EXPORT_SYMBOL_GPL(llist_del_first); | 89 | EXPORT_SYMBOL_GPL(llist_del_first); |
112 | |||
113 | /** | ||
114 | * llist_del_all - delete all entries from lock-less list | ||
115 | * @head: the head of lock-less list to delete all entries | ||
116 | * | ||
117 | * If list is empty, return NULL, otherwise, delete all entries and | ||
118 | * return the pointer to the first entry. The order of entries | ||
119 | * deleted is from the newest to the oldest added one. | ||
120 | */ | ||
121 | struct llist_node *llist_del_all(struct llist_head *head) | ||
122 | { | ||
123 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
124 | BUG_ON(in_nmi()); | ||
125 | #endif | ||
126 | |||
127 | return xchg(&head->first, NULL); | ||
128 | } | ||
129 | EXPORT_SYMBOL_GPL(llist_del_all); | ||