compat: add skb_walk_frags() and skb_has_frag_list()
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 2 Aug 2011 21:14:19 +0000 (23:14 +0200)
committerLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Tue, 2 Aug 2011 21:26:41 +0000 (14:26 -0700)
These functions are needed for ./net/bluetooth/l2cap_core.c and ./net/bluetooth/af_bluetooth.c.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.31.h
include/linux/compat-2.6.37.h

index d2e0f01bb910c22944a02670c5c53edeff7210cc..ce944bb833d29ec859db3afe305d6c3c907eb7a9 100644 (file)
@@ -199,6 +199,9 @@ void compat_synchronize_threaded_irq(struct compat_threaded_irq *comp)
 #define list_entry_rcu(ptr, type, member) \
        container_of(rcu_dereference(ptr), type, member)
 
+#define skb_walk_frags(skb, iter)      \
+       for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
 
 #endif /* LINUX_26_31_COMPAT_H */
index e0dd6b43b3e727b4a4e233c71eb3ea4e56a910d2..d375746f5dd37d0035d824bd41001d37894b29ab 100644 (file)
@@ -124,6 +124,11 @@ extern void *vzalloc(unsigned long size);
 #define RCU_INIT_POINTER(p, v) \
                p = (typeof(*v) __force __rcu *)(v)
 
+static inline bool skb_has_frag_list(const struct sk_buff *skb)
+{
+       return skb_shinfo(skb)->frag_list != NULL;
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */
 
 #endif /* LINUX_26_37_COMPAT_H */