linuxkpi: Really add bitmap_alloc and bitmap_zalloc

This was missing in r360870

Sponsored-by: The FreeBSD Foundation
This commit is contained in:
Emmanuel Vadot 2020-05-10 13:12:05 +00:00
parent ce03b3013f
commit 3d84874da0

View File

@ -310,6 +310,19 @@ bitmap_xor(unsigned long *dst, const unsigned long *src1,
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)
{