File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2585,7 +2585,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
2585
2585
kfree_skb (skb );
2586
2586
}
2587
2587
2588
- void skb_rbtree_purge (struct rb_root * root );
2588
+ unsigned int skb_rbtree_purge (struct rb_root * root );
2589
2589
2590
2590
void * netdev_alloc_frag (unsigned int fragsz );
2591
2591
Original file line number Diff line number Diff line change @@ -2858,23 +2858,27 @@ EXPORT_SYMBOL(skb_queue_purge);
2858
2858
/**
2859
2859
* skb_rbtree_purge - empty a skb rbtree
2860
2860
* @root: root of the rbtree to empty
2861
+ * Return value: the sum of truesizes of all purged skbs.
2861
2862
*
2862
2863
* Delete all buffers on an &sk_buff rbtree. Each buffer is removed from
2863
2864
* the list and one reference dropped. This function does not take
2864
2865
* any lock. Synchronization should be handled by the caller (e.g., TCP
2865
2866
* out-of-order queue is protected by the socket lock).
2866
2867
*/
2867
- void skb_rbtree_purge (struct rb_root * root )
2868
+ unsigned int skb_rbtree_purge (struct rb_root * root )
2868
2869
{
2869
2870
struct rb_node * p = rb_first (root );
2871
+ unsigned int sum = 0 ;
2870
2872
2871
2873
while (p ) {
2872
2874
struct sk_buff * skb = rb_entry (p , struct sk_buff , rbnode );
2873
2875
2874
2876
p = rb_next (p );
2875
2877
rb_erase (& skb -> rbnode , root );
2878
+ sum += skb -> truesize ;
2876
2879
kfree_skb (skb );
2877
2880
}
2881
+ return sum ;
2878
2882
}
2879
2883
2880
2884
/**
You can’t perform that action at this time.
0 commit comments