Date: Sun, 10 May 2020 13:12:05 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360871 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202005101312.04ADC52j040725@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005101312.04ADC52j040725>