From: Shmulik Hen <shmulik.hen@intel.com>
To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com
Subject: [SET 1][PATCH 1/6][bonding] backport 2.6 changes to 2.4
Date: Fri, 8 Aug 2003 17:44:16 +0300 [thread overview]
Message-ID: <200308081744.16738.shmulik.hen@intel.com> (raw)
Add list_for_each_entry_safe().
diff -Nuarp linux-2.4.22-rc1/include/linux/list.h linux-2.4.22-rc1-devel/include/linux/list.h
--- linux-2.4.22-rc1/include/linux/list.h Fri Aug 8 14:02:24 2003
+++ linux-2.4.22-rc1-devel/include/linux/list.h Fri Aug 8 14:02:25 2003
@@ -227,6 +227,19 @@ static inline void list_splice_init(stru
pos = list_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
+/**
+ * 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
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_safe(pos, n, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member), \
+ n = list_entry(pos->member.next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
#endif /* __KERNEL__ || _LVM_H_INCLUDE */
#endif
--
| Shmulik Hen Advanced Network Services |
| Israel Design Center, Jerusalem |
| LAN Access Division, Platform Networking |
| Intel Communications Group, Intel corp. |
reply other threads:[~2003-08-08 14:44 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=200308081744.16738.shmulik.hen@intel.com \
--to=shmulik.hen@intel.com \
--cc=bonding-devel@lists.sourceforge.net \
--cc=netdev@oss.sgi.com \
/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;
as well as URLs for NNTP newsgroup(s).