batman-adv: compat-code for skb_abort_seq_read()
Commit Message
Since skb_abort_seq_read() has been removed in the patch "net: Unmap
fragment page once iterator is done" in linux, but is still needed for
older kernel, add compat code to call it after the iteration is done.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
compat.h | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Wednesday, June 26, 2013 17:37:51 Simon Wunderlich wrote:
> Since skb_abort_seq_read() has been removed in the patch "net: Unmap
> fragment page once iterator is done" in linux, but is still needed for
> older kernel, add compat code to call it after the iteration is done.
>
> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> ---
> compat.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
Applied in revision 0d941e8.
Thanks,
Marek
@@ -326,6 +326,14 @@ static int __batadv_interface_set_mac_addr(x, y)
#define netdev_notifier_info_to_dev(ptr) ptr
+/* older kernels still need to call skb_abort_seq_read() */
+#define skb_seq_read(consumed, data, st) \
+ ({ \
+ int len = skb_seq_read(consumed, data, st); \
+ if (len == 0) \
+ skb_abort_seq_read(st); \
+ len; \
+ })
#endif /* < KERNEL_VERSION(3, 11, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */