diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/skbuff.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 262efdbc346b..d8f7d74d5a4d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -781,6 +781,31 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len, | |||
| 781 | int *errcode, | 781 | int *errcode, |
| 782 | gfp_t gfp_mask); | 782 | gfp_t gfp_mask); |
| 783 | 783 | ||
| 784 | /* Layout of fast clones : [skb1][skb2][fclone_ref] */ | ||
| 785 | struct sk_buff_fclones { | ||
| 786 | struct sk_buff skb1; | ||
| 787 | |||
| 788 | struct sk_buff skb2; | ||
| 789 | |||
| 790 | atomic_t fclone_ref; | ||
| 791 | }; | ||
| 792 | |||
| 793 | /** | ||
| 794 | * skb_fclone_busy - check if fclone is busy | ||
| 795 | * @skb: buffer | ||
| 796 | * | ||
| 797 | * Returns true is skb is a fast clone, and its clone is not freed. | ||
| 798 | */ | ||
| 799 | static inline bool skb_fclone_busy(const struct sk_buff *skb) | ||
| 800 | { | ||
| 801 | const struct sk_buff_fclones *fclones; | ||
| 802 | |||
| 803 | fclones = container_of(skb, struct sk_buff_fclones, skb1); | ||
| 804 | |||
| 805 | return skb->fclone == SKB_FCLONE_ORIG && | ||
| 806 | fclones->skb2.fclone == SKB_FCLONE_CLONE; | ||
| 807 | } | ||
| 808 | |||
| 784 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 809 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
| 785 | gfp_t priority) | 810 | gfp_t priority) |
| 786 | { | 811 | { |
