#include <asm/system.h>
-/**
- * llist_add_batch - add several linked entries in batch
- * @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.
- */
-bool llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
- struct llist_head *head)
-{
- struct llist_node *entry, *old_entry;
-
- entry = head->first;
- for (;;) {
- old_entry = entry;
- new_last->next = entry;
- entry = cmpxchg(&head->first, old_entry, new_first);
- if (entry == old_entry)
- break;
- }
-
- return old_entry == NULL;
-}
-EXPORT_SYMBOL_GPL(llist_add_batch);
-
/**
* llist_del_first - delete the first entry of lock-less list
* @head: the head for your lock-less list
#include <linux/device.h>
#include <linux/ethtool.h>
#include <linux/rtnetlink.h>
+#include <linux/llist.h>
int __netdev_printk(const char *level, const struct net_device *dev,
struct va_format *vaf)
return dev->ethtool_ops->get_settings(dev, cmd);
}
EXPORT_SYMBOL(__ethtool_get_settings);
+
+/**
+ * llist_add_batch - add several linked entries in batch
+ * @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.
+ */
+bool llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
+ struct llist_head *head)
+{
+ struct llist_node *entry, *old_entry;
+
+ entry = head->first;
+ for (;;) {
+ old_entry = entry;
+ new_last->next = entry;
+ entry = cmpxchg(&head->first, old_entry, new_first);
+ if (entry == old_entry)
+ break;
+ }
+
+ return old_entry == NULL;
+}
+EXPORT_SYMBOL_GPL(llist_add_batch);
+
#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
#include_next <linux/llist.h>
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#include_next <linux/llist.h>
+extern bool llist_add_batch(struct llist_node *new_first,
+ struct llist_node *new_last,
+ struct llist_head *head);
#else
#ifndef LLIST_H
extern struct llist_node *llist_del_first(struct llist_head *head);
#endif /* LLIST_H */
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) */
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */