Re: [PATCH 10/13] net: add paged frag destructor to skb_fill_page_desc()
From: Michał Mirosław <hidden>
Date: 2011-07-22 19:58:51
2011/7/22 Ian Campbell [off-list ref]:
quoted hunk
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 9818fe2..faee8d3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h@@ -1134,12 +1134,14 @@ static inline int skb_pagelen(const struct sk_buff *skb)* Does not take any additional reference on the fragment. */ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, - struct page *page, int off, int size) + struct page *page, + struct skb_frag_destructor *destroy, + int off, int size) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; frag->page.p = page; - frag->page.destructor = NULL; + frag->page.destructor = destroy; frag->page_offset = off; frag->size = size; }
You could just rename this function to e.g.
__skb_fill_fragile_page_desc() (or whatever name) add an inline
wrapper calling it with destroy == NULL. This will avoid touching all
those drivers which won't ever need this functionality.
Best Regards,
Michał Mirosław
�{.n�+�������+%��lzwm��b�맲��r��zX��ݙ�����ܨ}���Ơz�&j:+v����n�r��6;靫3��\
nnX��f�z��2�ޙ���&�)ߡ�a����
�G���h��j:+v���w�٥