From 368e8c51a59629ea7d681f5b96d4f5a9f89ad1a6 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 16 Nov 2019 14:26:18 +0100 Subject: backports: Add kvcalloc() kvcalloc() was added in kernel commit 1c542f38ab8d ("mm: Introduce kvcalloc()") and is now used by the fq header filers. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h index b28156d3..8ff7d6a6 100644 --- a/backport/backport-include/linux/mm.h +++ b/backport/backport-include/linux/mm.h @@ -50,4 +50,12 @@ static inline void *kvzalloc(size_t size, gfp_t flags) } #endif +#if LINUX_VERSION_IS_LESS(4,18,0) +#define kvcalloc LINUX_BACKPORT(kvcalloc) +static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) +{ + return kvmalloc_array(n, size, flags | __GFP_ZERO); +} +#endif /* < 4.18 */ + #endif /* __BACKPORT_MM_H */ -- cgit v1.2.3