llist-return-whether-list-is-empty-before-adding-in-llist_add-fix
[pandora-kernel.git] / include / linux / llist.h
index e2e96d0..801b44b 100644 (file)
@@ -148,7 +148,7 @@ static inline struct llist_node *llist_next(struct llist_node *node)
  * @new:       new entry to be added
  * @head:      the head for your lock-less list
  *
- * Return whether list is empty before adding.
+ * Returns true if the list was empty prior to adding this entry.
  */
 static inline bool llist_add(struct llist_node *new, struct llist_head *head)
 {
@@ -161,7 +161,6 @@ static inline bool llist_add(struct llist_node *new, struct llist_head *head)
                entry = cmpxchg(&head->first, old_entry, new);
                if (entry == old_entry)
                        break;
-               cpu_relax();
        }
 
        return old_entry == NULL;
@@ -179,4 +178,10 @@ static inline struct llist_node *llist_del_all(struct llist_head *head)
 {
        return xchg(&head->first, NULL);
 }
+
+extern bool llist_add_batch(struct llist_node *new_first,
+                           struct llist_node *new_last,
+                           struct llist_head *head);
+extern struct llist_node *llist_del_first(struct llist_head *head);
+
 #endif /* LLIST_H */