From: David S. Miller Date: Tue, 23 Sep 2008 07:49:44 +0000 (-0700) Subject: net: Add skb_queue_walk_from() and skb_queue_walk_from_safe(). X-Git-Tag: v2.6.28-rc1~717^2~205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1164f52a244204830c7625b3c22812781996d7b4;p=profile%2Fivi%2Fkernel-x86-ivi.git net: Add skb_queue_walk_from() and skb_queue_walk_from_safe(). These will be used by TCP write queue handling and elsewhere. Signed-off-by: David S. Miller --- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d2f1778..a19ea43 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1571,6 +1571,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) skb != (struct sk_buff *)(queue); \ skb = tmp, tmp = skb->next) +#define skb_queue_walk_from(queue, skb) \ + for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ + skb = skb->next) + +#define skb_queue_walk_from_safe(queue, skb, tmp) \ + for (tmp = skb->next; \ + skb != (struct sk_buff *)(queue); \ + skb = tmp, tmp = skb->next) + #define skb_queue_reverse_walk(queue, skb) \ for (skb = (queue)->prev; \ prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \