diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-07 22:50:00 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 05:20:27 +0200 |
commit | 390f012f41d60215a4eed92a8d19ce7efd3707ff (patch) | |
tree | 1d236364428c650968bcad0306eae79a46c84f99 /src/compat/dst_cache/dst_cache.c | |
parent | dfed22fb89b2a776ad4977d9d00ea319a6089d93 (diff) |
compat: support 3.16
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/dst_cache/dst_cache.c')
-rw-r--r-- | src/compat/dst_cache/dst_cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compat/dst_cache/dst_cache.c b/src/compat/dst_cache/dst_cache.c index 145f112..24f1e90 100644 --- a/src/compat/dst_cache/dst_cache.c +++ b/src/compat/dst_cache/dst_cache.c @@ -152,8 +152,13 @@ EXPORT_SYMBOL_GPL(dst_cache_get_ip6); int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) + BUG_ON(gfp & GFP_ATOMIC); + dst_cache->cache = alloc_percpu(struct dst_cache_pcpu); +#else dst_cache->cache = alloc_percpu_gfp(struct dst_cache_pcpu, gfp | __GFP_ZERO); +#endif if (!dst_cache->cache) return -ENOMEM; |