On Fri, 24 February 2006 00:32:04 -0800, David S. Miller wrote: > > One more problem :-) Please export the kfree_skb() symbol so > networking modules don't break.
Doh! Done. Any more reasons to wear a brown paperbag? Jörn -- When in doubt, punt. When somebody actually complains, go back and fix it... The 90% solution is a good thing. -- Rob Landley o Uninline kfree_skb, which saves some 15k of object code on my notebook. o Allow kfree_skb to be called with a NULL argument. Subsequent patches can remove conditional from drivers and further reduce source and object size. Signed-off-by: Jörn Engel <[EMAIL PROTECTED]> --- include/linux/skbuff.h | 17 +---------------- net/core/skbuff.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) --- kfree_skb/include/linux/skbuff.h~kfree_skb_uninline_null 2006-02-23 13:35:05.000000000 +0100 +++ kfree_skb/include/linux/skbuff.h 2006-02-24 09:35:47.000000000 +0100 @@ -306,6 +306,7 @@ struct sk_buff { #include <asm/system.h> +extern void kfree_skb(struct sk_buff *skb); extern void __kfree_skb(struct sk_buff *skb); extern struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int fclone); @@ -406,22 +407,6 @@ static inline struct sk_buff *skb_get(st */ /** - * kfree_skb - free an sk_buff - * @skb: buffer to free - * - * Drop a reference to the buffer and free it if the usage count has - * hit zero. - */ -static inline void kfree_skb(struct sk_buff *skb) -{ - if (likely(atomic_read(&skb->users) == 1)) - smp_rmb(); - else if (likely(!atomic_dec_and_test(&skb->users))) - return; - __kfree_skb(skb); -} - -/** * skb_cloned - is the buffer a clone * @skb: buffer to check * --- kfree_skb/net/core/skbuff.c~kfree_skb_uninline_null 2006-02-23 13:35:05.000000000 +0100 +++ kfree_skb/net/core/skbuff.c 2006-02-24 09:36:15.000000000 +0100 @@ -355,6 +355,24 @@ void __kfree_skb(struct sk_buff *skb) } /** + * kfree_skb - free an sk_buff + * @skb: buffer to free + * + * Drop a reference to the buffer and free it if the usage count has + * hit zero. + */ +void kfree_skb(struct sk_buff *skb) +{ + if (unlikely(!skb)) + return; + if (likely(atomic_read(&skb->users) == 1)) + smp_rmb(); + else if (likely(!atomic_dec_and_test(&skb->users))) + return; + __kfree_skb(skb); +} + +/** * skb_clone - duplicate an sk_buff * @skb: buffer to clone * @gfp_mask: allocation priority @@ -1807,6 +1825,7 @@ void __init skb_init(void) EXPORT_SYMBOL(___pskb_trim); EXPORT_SYMBOL(__kfree_skb); +EXPORT_SYMBOL(kfree_skb); EXPORT_SYMBOL(__pskb_pull_tail); EXPORT_SYMBOL(__alloc_skb); EXPORT_SYMBOL(pskb_copy); - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html