]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/llist.h
Merge branch 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux
[karo-tx-linux.git] / include / linux / llist.h
index a5199f6d0e82592dde0e4ba7908b1d1b70323483..cdaa7f0238993655e251fb933a01a69b8bd1fbad 100644 (file)
@@ -142,6 +142,9 @@ static inline struct llist_node *llist_next(struct llist_node *node)
        return node->next;
 }
 
+extern bool llist_add_batch(struct llist_node *new_first,
+                           struct llist_node *new_last,
+                           struct llist_head *head);
 /**
  * llist_add - add a new entry
  * @new:       new entry to be added
@@ -151,18 +154,7 @@ static inline struct llist_node *llist_next(struct llist_node *node)
  */
 static inline bool llist_add(struct llist_node *new, struct llist_head *head)
 {
-       struct llist_node *entry, *old_entry;
-
-       entry = head->first;
-       for (;;) {
-               old_entry = entry;
-               new->next = entry;
-               entry = cmpxchg(&head->first, old_entry, new);
-               if (entry == old_entry)
-                       break;
-       }
-
-       return old_entry == NULL;
+       return llist_add_batch(new, new, head);
 }
 
 /**
@@ -178,9 +170,6 @@ 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 */