From: Pavel Emelyanov Date: Tue, 21 Feb 2012 07:31:18 +0000 (+0000) Subject: skb: Add skb_peek_next helper X-Git-Tag: upstream/snapshot3+hdmi~7954^2~235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da5ef6e51b327b41180b5d1000c06e8d3595a936;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git skb: Add skb_peek_next helper Signed-off-by: Pavel Emelyanov Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f3cf43d..c11a44e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -877,6 +877,24 @@ static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_) } /** + * skb_peek_next - peek skb following the given one from a queue + * @skb: skb to start from + * @list_: list to peek at + * + * Returns %NULL when the end of the list is met or a pointer to the + * next element. The reference count is not incremented and the + * reference is therefore volatile. Use with caution. + */ +static inline struct sk_buff *skb_peek_next(struct sk_buff *skb, + const struct sk_buff_head *list_) +{ + struct sk_buff *next = skb->next; + if (next == (struct sk_buff *)list_) + next = NULL; + return next; +} + +/** * skb_peek_tail - peek at the tail of an &sk_buff_head * @list_: list to peek at *