The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] list.h: implement list_for_each_entry_safe
Date: Sun, 4 May 2003 04:57:48 -0300	[thread overview]
Message-ID: <20030504075748.GD12549@conectiva.com.br> (raw)

Hi Linus,

	Please consider pulling from:

bk://kernel.bkbits.net/acme/list-2.5

	I started converting IPX to struct list_head and also to use
list_for_eache_entry to simplify the code in the network families I maintain,
and in IPX I need the _safe variation for list_for_eache_entry.

- Arnaldo

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@1.1219, 2003-05-04 04:39:21-03:00, acme@conectiva.com.br
  o list.h: implement list_for_each_entry_safe


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


diff -Nru a/include/linux/list.h b/include/linux/list.h
--- a/include/linux/list.h	Sun May  4 04:43:59 2003
+++ b/include/linux/list.h	Sun May  4 04:43:59 2003
@@ -297,6 +297,19 @@
 		     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))
+
+/**
  * list_for_each_rcu	-	iterate over an rcu-protected list
  * @pos:	the &struct list_head to use as a loop counter.
  * @head:	the head for your list.

===================================================================


This BitKeeper patch contains the following changesets:
1.1219
## Wrapped with gzip_uu ##


M'XL( +_$M#X  \U5T6K;,!1]MK[BCL)HLMB1+#N)75*R=F,;':QT]*T05%N.
MS6PIR$K:@#]^D@QMUS8M*WN8XP=S=8[.N4<7Y0 N6ZY2CV4-1P?P5;8Z]3(I
M>*:K+0LRV037RBQ<2&D6QJ5L^/CD;%Q7K?;#($9FZ9SIK(0M5VWJD8#>5?1N
MS5/OXO.7R^\?+Q":S^&T9&+%?W(-\SG24FU9G;<+ILM:BD K)MJ&:R?:W4&[
M$./0_&(RI3B>=&2"HVF7D9P0%A&>XS":32*D9,U$OE \+YE^NH.AX@B3&).D
M"RFE!'T"$I"0)(#I&,=C' &.4IJD(?$Q33$&F\CB<1+P@8"/T0G\6_>G* ,)
M-M2@3*%JUC5ON-"NLBRD6G*6E4M34;MERPJ.SB"D492@\_M,D?^7#T*8873\
M2BN5R.I-SLV)B\WMN+?XL*N$FD0)H7$7QEF>7<<XGX5QP2EY/L&]&_9'-*41
MG77A))E2-S+/H5^?GK>;1FW)FZ8RD:J%;/,ZD&KU@N6(8CR-9YAT4823R$U5
M^&BFS#M[9:;H_S)4+O<?X*L;]YHA.7_V"-XP;-_") %"$0SW.@ ?*LT5TQRD
MN4\<#F0!JVK+A;M/P,'8BE7"+"G>2!.8A3BHV\D*+-;27$:ZY#UI:)*%36N(
M+3"HI5Q#)C?"2 4.+5+/8T(:O'I*T+Q92\74#EIS/FS%':7D+.\5[!>89F G
M-[WE?M.&-]?V9K48P1IN7=IOUWRKU2;3<%/ILA*NW%<L=8P.<EY4@N_-Z="T
M-P(Q<MHCZ)4&GN==(<\ZL>LP[^F.=7AHD0/_6/!;/7(]RN)P:&"#._K(LCWQ
M)\\@_.,>$+S /;)<L,_[!PQX-X=>^ @\K[?G0+T]X_^1FMBC)>Z5!N@*C8?#
:^_^=K.39KW;3S*=LQHIBDJ#?TWDGY=,&    
 

             reply	other threads:[~2003-05-04  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-04  7:57 Arnaldo Carvalho de Melo [this message]
2003-05-04 12:50 ` [PATCH] list.h: implement list_for_each_entry_safe David S. Miller
2003-05-04 21:24   ` Arnaldo Carvalho de Melo
2003-05-04 20:19     ` David S. Miller

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=20030504075748.GD12549@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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