Re: [PATCH net-next] netem: Introduce skb_orphan_partial() helper
From: Eric Dumazet <hidden>
Date: 2013-07-31 03:27:05
On Wed, 2013-07-31 at 03:21 +0000, Cong Wang wrote:
On Wed, 31 Jul 2013 at 00:55 GMT, Eric Dumazet [off-list ref] wrote:quoted
diff --git a/include/net/sock.h b/include/net/sock.h index b9f2b09..53d4714 100644 --- a/include/net/sock.h +++ b/include/net/sock.h@@ -1520,6 +1520,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force, gfp_t priority); extern void sock_wfree(struct sk_buff *skb); +extern void skb_orphan_partial(struct sk_buff *skb); extern void sock_rfree(struct sk_buff *skb); extern void sock_edemux(struct sk_buff *skb);diff --git a/net/core/sock.c b/net/core/sock.c index 85e8de1..a753d97 100644 --- a/net/core/sock.c +++ b/net/core/sock.c@@ -1576,6 +1576,25 @@ void sock_wfree(struct sk_buff *skb) } EXPORT_SYMBOL(sock_wfree); +void skb_orphan_partial(struct sk_buff *skb)I think net/core/skbuff.c is a better place to put this (or skbuff.h if it can be inlined).
I put it right after sock_wfree() because this stuff really has to make the same thing than sock_wfree(). I do not want to inline it because EXPORTing tcp_wfree() looks ugly.