From 7187a69ee79657ff619ad5ee9bc1cb21e5ede1ef Mon Sep 17 00:00:00 2001 From: Stefan Assmann Date: Wed, 29 Jan 2014 10:18:59 +0100 Subject: [PATCH] backports: igb fixes for linux-3.12 - refactor u64_stats_sync.h a bit - add u64_stats_init define Signed-off-by: Stefan Assmann Signed-off-by: Hauke Mehrtens --- .../backport-include/linux/u64_stats_sync.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/backport/backport-include/linux/u64_stats_sync.h b/backport/backport-include/linux/u64_stats_sync.h index f15116c28279..4fefb3c56af4 100644 --- a/backport/backport-include/linux/u64_stats_sync.h +++ b/backport/backport-include/linux/u64_stats_sync.h @@ -1,8 +1,10 @@ +#ifndef __BACKPORT_LINUX_U64_STATS_SYNC_H +#define __BACKPORT_LINUX_U64_STATS_SYNC_H + +#include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) #include_next #else -#ifndef _LINUX_U64_STATS_SYNC_H -#define _LINUX_U64_STATS_SYNC_H /* * To properly implement 64bits network statistics on 32bit and 64bit hosts, @@ -140,5 +142,14 @@ static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, #endif } -#endif /* _LINUX_U64_STATS_SYNC_H */ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) +#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) +# define u64_stats_init(syncp) seqcount_init(syncp.seq) +#else +# define u64_stats_init(syncp) do { } while (0) +#endif +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) */ + +#endif /* __BACKPORT_LINUX_U64_STATS_SYNC_H */ -- 2.30.2