batman-adv: compat-code for skb_abort_seq_read()

Message ID 1372239472-13217-1-git-send-email-siwu@hrz.tu-chemnitz.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Simon Wunderlich June 26, 2013, 9:37 a.m. UTC
  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

Marek Lindner Aug. 17, 2013, 6:04 p.m. UTC | #1
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
  

Patch

diff --git a/compat.h b/compat.h
index ddc1b29..e9b531f 100644
--- a/compat.h
+++ b/compat.h
@@ -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_ */