[PATCH 6/5] llist: Add llist_next()

Peter Zijlstra
2011-09-12T14:06:15Z

Subject: llist: Add llist_next()
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Mon Sep 12 13:12:28 CEST 2011

So we don't have to expose the struct list_node members

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/llist.h | 5 +++++
kernel/irq_work.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/llist.h
===================================================================
--- linux-2.6.orig/include/linux/llist.h
+++ linux-2.6/include/linux/llist.h
@@ -144,6 +144,11 @@ static inline bool llist_empty(const str
return ACCESS_ONCE(head->first) == NULL;
}

+static inline struct llist_node *llist_next(struct llist_node *node)
+{
+ return node->next;
+}
+
/**
* llist_add - add a new entry
* @new: new entry to be added
Index: linux-2.6/kernel/irq_work.c
===================================================================
--- linux-2.6.orig/kernel/irq_work.c
+++ linux-2.6/kernel/irq_work.c
@@ -110,7 +110,7 @@ void irq_work_run(void)
while (llnode != NULL) {
work = llist_entry(llnode, struct irq_work, llnode);

- llnode = llnode->next;
+ llnode = llist_next(llnode);

/*
* Clear the PENDING bit, after this point the @work