diff options
author | Jörn Engel <joern@wohnheim.fh-wedel.de> | 2006-03-20 21:28:35 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 21:28:35 -0800 |
commit | 231d06ae826664b83369166449144304859a62fa (patch) | |
tree | 1c761b91405573f4e787454b454ead8354c3ba23 /include | |
parent | 2e1f47c74c26a591fc490eb339f1b3167361158b (diff) | |
download | linux-3.10-231d06ae826664b83369166449144304859a62fa.tar.gz linux-3.10-231d06ae826664b83369166449144304859a62fa.tar.bz2 linux-3.10-231d06ae826664b83369166449144304859a62fa.zip |
[NET]: Uninline kfree_skb and allow NULL argument
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 <joern@wohnheim.fh-wedel.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1a2611030d3..75c963103b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -304,6 +304,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); @@ -404,22 +405,6 @@ static inline struct sk_buff *skb_get(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. - */ -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 * |