diff options
author | Ricardo Martinez <ricardo.martinez@linux.intel.com> | 2022-05-06 11:12:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-09 10:51:58 +0100 |
commit | a4ff365346c98081311c299955d91d657123e8aa (patch) | |
tree | 5743bc5303072f646d14be7c40f67ac7fbd5deda /include/linux/skbuff.h | |
parent | 2fbdf45d7d26361a0c3ec8833fd96edf0f5812da (diff) |
net: skb: introduce skb_data_area_size()
Helper to calculate the linear data space in the skb.
Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5c2599e3fe7d..d58669d6cb91 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1665,6 +1665,11 @@ static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset) } #endif +static inline unsigned int skb_data_area_size(struct sk_buff *skb) +{ + return skb_end_pointer(skb) - skb->data; +} + struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size, struct ubuf_info *uarg); |