diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-04-06 21:57:27 +0000 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-04-08 18:16:22 -0700 |
commit | 1f20d47753e5f18d8953b4405e2ffc06e05c0890 (patch) | |
tree | 2a73098fa9457d51b015b6e659c98a0436b69480 | |
parent | 41a296cccfc3a1b01f2d62aab7e283c624ff51fd (diff) |
backports: complete backport of frag size accessors
These are just helpers so carry them over, this was added via commit
9e903e0852 through v3.2. The skb frag size was in place for a long time but
was changed from __u16 to __u32 via commit a309bb072b through v2.6.23 and
since we backport for >= 2.6.25 just leave this as is. This was already
only partly backported, this adds the missing helpers.
mcgrof@ergon ~/linux-next (git::master)$ git describe --contains 9e903e0852
v3.2-rc1~182^2~85
mcgrof@ergon ~/linux-next (git::master)$ git describe --contains a309bb072b
v2.6.23-rc2~35^2~11
commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue Oct 18 21:00:24 2011 +0000
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.
Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | backport/backport-include/linux/skbuff.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h index bc67f452..2f7d57b4 100644 --- a/backport/backport-include/linux/skbuff.h +++ b/backport/backport-include/linux/skbuff.h @@ -313,6 +313,18 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri) #if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) +#define skb_frag_size_set LINUX_BACKPORT(skb_frag_size_set) +static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size) +{ + frag->size = size; +} + +#define skb_frag_size_add LINUX_BACKPORT(skb_frag_size_add) +static inline void skb_frag_size_add(skb_frag_t *frag, int delta) +{ + frag->size += delta; +} + #define __skb_fill_page_desc LINUX_BACKPORT(__skb_fill_page_desc) /** * __skb_fill_page_desc - initialise a paged fragment in an skb |