summaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9da99520ccd5..ca6ee7d93edb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -804,6 +804,16 @@ static inline int skb_cloned(const struct sk_buff *skb)
804 (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; 804 (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1;
805} 805}
806 806
807static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
808{
809 might_sleep_if(pri & __GFP_WAIT);
810
811 if (skb_cloned(skb))
812 return pskb_expand_head(skb, 0, 0, pri);
813
814 return 0;
815}
816
807/** 817/**
808 * skb_header_cloned - is the header a clone 818 * skb_header_cloned - is the header a clone
809 * @skb: buffer to check 819 * @skb: buffer to check