Merge remote-tracking branch 'keys/keys-next'
[deliverable/linux.git] / net / core / skbuff.c
index 3864b4b68fa1ee0af153c420c2eecebb908a5e99..1e329d4112426df0c2c2097ce645cf2bbc3155a7 100644 (file)
@@ -2444,6 +2444,25 @@ void skb_queue_purge(struct sk_buff_head *list)
 }
 EXPORT_SYMBOL(skb_queue_purge);
 
+/**
+ *     skb_rbtree_purge - empty a skb rbtree
+ *     @root: root of the rbtree to empty
+ *
+ *     Delete all buffers on an &sk_buff rbtree. Each buffer is removed from
+ *     the list and one reference dropped. This function does not take
+ *     any lock. Synchronization should be handled by the caller (e.g., TCP
+ *     out-of-order queue is protected by the socket lock).
+ */
+void skb_rbtree_purge(struct rb_root *root)
+{
+       struct sk_buff *skb, *next;
+
+       rbtree_postorder_for_each_entry_safe(skb, next, root, rbnode)
+               kfree_skb(skb);
+
+       *root = RB_ROOT;
+}
+
 /**
  *     skb_queue_head - queue a buffer at the list head
  *     @list: list to use
This page took 0.025542 seconds and 5 git commands to generate.