[PATCH 04/12] backports: complete backport of frag size accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
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@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>

Cc: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
 backport/backport-include/linux/skbuff.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index bc67f45..2f7d57b 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
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux