aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-04-14 03:04:51 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 03:04:51 -0400
commitbf299275882624b1908521ee8074df85160e9679 (patch)
treef35ff7ad85ca54f3028bda5fe125c0e7bd291d59 /include/linux/skbuff.h
parentf525c06d12b72cddb085df7f6f348c3c5a39b3ce (diff)
[SKB]: __skb_queue_after(prev) = __skb_insert(prev, prev->next)
By reordering, __skb_queue_after() is expressed in terms of __skb_insert(). Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h34
1 files changed, 12 insertions, 22 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c2116200580a..bb107ab675fc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -663,11 +663,21 @@ static inline void skb_queue_head_init_class(struct sk_buff_head *list,
663} 663}
664 664
665/* 665/*
666 * Insert an sk_buff at the start of a list. 666 * Insert an sk_buff on a list.
667 * 667 *
668 * The "__skb_xxxx()" functions are the non-atomic ones that 668 * The "__skb_xxxx()" functions are the non-atomic ones that
669 * can only be called with interrupts disabled. 669 * can only be called with interrupts disabled.
670 */ 670 */
671extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
672static inline void __skb_insert(struct sk_buff *newsk,
673 struct sk_buff *prev, struct sk_buff *next,
674 struct sk_buff_head *list)
675{
676 newsk->next = next;
677 newsk->prev = prev;
678 next->prev = prev->next = newsk;
679 list->qlen++;
680}
671 681
672/** 682/**
673 * __skb_queue_after - queue a buffer at the list head 683 * __skb_queue_after - queue a buffer at the list head
@@ -684,13 +694,7 @@ static inline void __skb_queue_after(struct sk_buff_head *list,
684 struct sk_buff *prev, 694 struct sk_buff *prev,
685 struct sk_buff *newsk) 695 struct sk_buff *newsk)
686{ 696{
687 struct sk_buff *next; 697 __skb_insert(newsk, prev, prev->next, list);
688 list->qlen++;
689
690 next = prev->next;
691 newsk->next = next;
692 newsk->prev = prev;
693 next->prev = prev->next = newsk;
694} 698}
695 699
696/** 700/**
@@ -735,20 +739,6 @@ static inline void __skb_queue_tail(struct sk_buff_head *list,
735} 739}
736 740
737/* 741/*
738 * Insert a packet on a list.
739 */
740extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
741static inline void __skb_insert(struct sk_buff *newsk,
742 struct sk_buff *prev, struct sk_buff *next,
743 struct sk_buff_head *list)
744{
745 newsk->next = next;
746 newsk->prev = prev;
747 next->prev = prev->next = newsk;
748 list->qlen++;
749}
750
751/*
752 * Place a packet after a given packet in a list. 742 * Place a packet after a given packet in a list.
753 */ 743 */
754extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); 744extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);