* llist_add - add a new entry
* @new: new entry to be added
* @head: the head for your lock-less list
+ *
+ * Return whether list is empty before adding.
*/
-static inline void llist_add(struct llist_node *new, struct llist_head *head)
+static inline bool llist_add(struct llist_node *new, struct llist_head *head)
{
struct llist_node *entry, *old_entry;
break;
cpu_relax();
}
+
+ return old_entry == NULL;
}
/**
* @new_first: first entry in batch to be added
* @new_last: last entry in batch to be added
* @head: the head for your lock-less list
+ *
+ * Return whether list is empty before adding.
*/
-static inline void llist_add_batch(struct llist_node *new_first,
+static inline bool llist_add_batch(struct llist_node *new_first,
struct llist_node *new_last,
struct llist_head *head)
{
break;
cpu_relax();
}
+
+ return old_entry == NULL;
}
/**