aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/skbuff.h47
1 files changed, 16 insertions, 31 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e517701c25ba..c2116200580a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -734,35 +734,6 @@ static inline void __skb_queue_tail(struct sk_buff_head *list,
734 next->prev = prev->next = newsk; 734 next->prev = prev->next = newsk;
735} 735}
736 736
737
738/**
739 * __skb_dequeue - remove from the head of the queue
740 * @list: list to dequeue from
741 *
742 * Remove the head of the list. This function does not take any locks
743 * so must be used with appropriate locks held only. The head item is
744 * returned or %NULL if the list is empty.
745 */
746extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);
747static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
748{
749 struct sk_buff *next, *prev, *result;
750
751 prev = (struct sk_buff *) list;
752 next = prev->next;
753 result = NULL;
754 if (next != prev) {
755 result = next;
756 next = next->next;
757 list->qlen--;
758 next->prev = prev;
759 prev->next = next;
760 result->next = result->prev = NULL;
761 }
762 return result;
763}
764
765
766/* 737/*
767 * Insert a packet on a list. 738 * Insert a packet on a list.
768 */ 739 */
@@ -803,8 +774,22 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
803 prev->next = next; 774 prev->next = next;
804} 775}
805 776
806 777/**
807/* XXX: more streamlined implementation */ 778 * __skb_dequeue - remove from the head of the queue
779 * @list: list to dequeue from
780 *
781 * Remove the head of the list. This function does not take any locks
782 * so must be used with appropriate locks held only. The head item is
783 * returned or %NULL if the list is empty.
784 */
785extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);
786static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
787{
788 struct sk_buff *skb = skb_peek(list);
789 if (skb)
790 __skb_unlink(skb, list);
791 return skb;
792}
808 793
809/** 794/**
810 * __skb_dequeue_tail - remove from the tail of the queue 795 * __skb_dequeue_tail - remove from the tail of the queue