svn commit: r360871 - head/sys/compat/linuxkpi/common/include/linux
Emmanuel Vadot
manu at FreeBSD.org
Sun May 10 13:12:05 UTC 2020
Author: manu
Date: Sun May 10 13:12:05 2020
New Revision: 360871
URL: https://svnweb.freebsd.org/changeset/base/360871
Log:
linuxkpi: Really add bitmap_alloc and bitmap_zalloc
This was missing in r360870
Sponsored-by: The FreeBSD Foundation
Modified:
head/sys/compat/linuxkpi/common/include/linux/bitmap.h
Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:07:00 2020 (r360870)
+++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:12:05 2020 (r360871)
@@ -310,6 +310,19 @@ bitmap_xor(unsigned long *dst, const unsigned long *sr
dst[i] = src1[i] ^ src2[i];
}
+static inline unsigned long *
+bitmap_alloc(unsigned int size, gfp_t flags)
+{
+ return (kmalloc_array(BITS_TO_LONGS(size),
+ sizeof(unsigned long), flags));
+}
+
+static inline unsigned long *
+bitmap_zalloc(unsigned int size, gfp_t flags)
+{
+ return (bitmap_alloc(size, flags | __GFP_ZERO));
+}
+
static inline void
bitmap_free(const unsigned long *bitmap)
{
More information about the svn-src-head
mailing list