public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Peschke <mp3@de.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [patch 3/6] statistics infrastructure - prerequisite: list operation
Date: Wed, 14 Dec 2005 17:14:01 +0100	[thread overview]
Message-ID: <43A044C9.2050204@de.ibm.com> (raw)

[patch 3/6] statistics infrastructure - prerequisite: list operation

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 c/include/linux/list.h d/include/linux/list.h
--- c/include/linux/list.h	2005-12-14 12:51:52.000000000 +0100
+++ d/include/linux/list.h	2005-12-14 13:56:08.000000000 +0100
@@ -409,6 +409,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_safe - iterate over list of given type safe against removal of list entry
   * @pos:	the type * to use as a loop counter.
   * @n:		another type * to use as temporary storage

                 reply	other threads:[~2005-12-14 16:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43A044C9.2050204@de.ibm.com \
    --to=mp3@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox