diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2019-11-16 14:26:18 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-11-21 23:04:39 +0100 |
commit | 368e8c51a59629ea7d681f5b96d4f5a9f89ad1a6 (patch) | |
tree | 1c49635732c13c3e5030d257317eb95f8fe7f8cf | |
parent | 7eb087cb342f2c1a351b32366738898015c95cd8 (diff) |
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 <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/mm.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 */ |