[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] linux-2.6.18: add list_first_entry()



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1288805674 0
# Node ID 09de232364470674de0d5a3d63e2c181eb0f62f8
# Parent  f14221afcebeac623197f7b68f6ff3262c58083f
linux-2.6.18: add list_first_entry()
... to address build failure after c/s 1045:bd2bf7a84686.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 include/linux/list.h |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -r f14221afcebe -r 09de23236447 include/linux/list.h
--- a/include/linux/list.h      Wed Nov 03 08:21:08 2010 +0000
+++ b/include/linux/list.h      Wed Nov 03 17:34:34 2010 +0000
@@ -352,6 +352,17 @@ static inline void list_splice_init(stru
  */
 #define list_entry(ptr, type, member) \
        container_of(ptr, type, member)
+
+/**
+ * list_first_entry - get the first element from a list
+ * @ptr:       the list head to take the element from.
+ * @type:      the type of the struct this is embedded in.
+ * @member:    the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_first_entry(ptr, type, member) \
+       list_entry((ptr)->next, type, member)
 
 /**
  * list_for_each       -       iterate over a list

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.