mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] [Patch 1/8] statistics infrastructure - prerequisite: list operation
@ 2006-05-16 17:44 Martin Peschke
  0 siblings, 0 replies; only message in thread
From: Martin Peschke @ 2006-05-16 17:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, ak, hch, arjan, James.Smart, James.Bottomley

This patch adds another list_for_each_* derivate. I can't work around it
because there is a list that I need to search both ways.

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
---

  list.h |   12 ++++++++++++
  1 files changed, 12 insertions(+)

diff -Nurp a/include/linux/list.h b/include/linux/list.h
--- a/include/linux/list.h	2006-05-15 12:42:12.000000000 +0200
+++ b/include/linux/list.h	2006-05-15 17:26:16.000000000 +0200
@@ -411,6 +411,18 @@ static inline void list_splice_init(stru
  	     pos = list_entry(pos->member.next, typeof(*pos), member))

  /**
+ * list_for_each_entry_continue_reverse -	iterate backwards over list
+ *			of given type continuing before existing point
+ * @pos:	the type * to use as a loop counter.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_continue_reverse(pos, head, member) 	\
+	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head);	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
   * list_for_each_entry_from -	iterate over list of given type
   *			continuing from existing point
   * @pos:	the type * to use as a loop counter.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-16 17:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-16 17:44 [RFC] [Patch 1/8] statistics infrastructure - prerequisite: list operation Martin Peschke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®