svn commit: r334428 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Thu May 31 13:13:09 UTC 2018


Author: hselasky
Date: Thu May 31 13:13:08 2018
New Revision: 334428
URL: https://svnweb.freebsd.org/changeset/base/334428

Log:
  Implement support for the kvmalloc_array() function in the LinuxKPI.
  
  Submitted by:	Johannes Lundberg <johalun0 at gmail.com>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/slab.h

Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/slab.h	Thu May 31 12:55:38 2018	(r334427)
+++ head/sys/compat/linuxkpi/common/include/linux/slab.h	Thu May 31 13:13:08 2018	(r334428)
@@ -132,6 +132,12 @@ kmalloc_array(size_t n, size_t size, gfp_t 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)
 {
 	return (realloc(ptr, size, M_KMALLOC, linux_check_m_flags(flags)));


More information about the svn-src-head mailing list