From f1aa567bfe73634a685e44d7e9cbdbb87da1229f Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 31 May 2018 13:13:08 +0000 Subject: [PATCH] Implement support for the kvmalloc_array() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies --- sys/compat/linuxkpi/common/include/linux/slab.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index f779faeb89a..9664eebf39e 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -131,6 +131,12 @@ kmalloc_array(size_t n, size_t size, gfp_t flags) return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } +static inline void * +kvmalloc_array(size_t n, size_t size, gfp_t flags) +{ + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); +} + static inline void * krealloc(void *ptr, size_t size, gfp_t flags) {