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>
This commit is contained in:
Ricardo Martinez 2022-05-06 11:12:58 -07:00 committed by David S. Miller
parent 2fbdf45d7d
commit a4ff365346

View File

@ -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);