backports: backport skb_unclone()
Pravin added this via commit 14bbd6a565 through v3.9. This is
a straight forward backport using the LINUX_BACKPORT() namespace.
mcgrof@ergon ~/linux-next (git::master)$ git describe --contains 14bbd6a565
v3.9-rc1~139^2~56
commit 14bbd6a565e1bcdc240d44687edb93f721cfdf99
Author: Pravin B Shelar <pshelar@nicira.com>
Date: Thu Feb 14 09:44:49 2013 +0000
net: Add skb_unclone() helper function.
This function will be used in next GRE_GSO patch. This patch does
not change any functionality.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 7ea44f5..2a63e95 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -300,4 +300,15 @@
#endif
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#define skb_unclone LINUX_BACKPORT(skb_unclone)
+static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
+{
+ might_sleep_if(pri & __GFP_WAIT);
+ if (skb_cloned(skb))
+ return pskb_expand_head(skb, 0, 0, pri);
+ return 0;
+}
+#endif
+
#endif /* __BACKPORT_SKBUFF_H */