Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22219
b: refs/heads/master
c: 231d06a
h: refs/heads/master
i:
  22217: e92a1b2
  22215: 651192c
v: v3
  • Loading branch information
J�rn Engel authored and David S. Miller committed Mar 21, 2006
1 parent ad4b9d2 commit e0ff113
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e1f47c74c26a591fc490eb339f1b3167361158b
refs/heads/master: 231d06ae826664b83369166449144304859a62fa
17 changes: 1 addition & 16 deletions trunk/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -403,22 +404,6 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb)
* atomic change.
*/

/**
* 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
Expand Down
19 changes: 19 additions & 0 deletions trunk/net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,24 @@ void __kfree_skb(struct sk_buff *skb)
kfree_skbmem(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
Expand Down Expand Up @@ -1799,6 +1817,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);
Expand Down

0 comments on commit e0ff113

Please sign in to comment.