diff options
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r-- | lib/bitmap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index 5be6651941..dfc0f06b13 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -837,3 +837,13 @@ void bitmap_copy_le(void *dst, const unsigned long *src, int nbits) } } EXPORT_SYMBOL(bitmap_copy_le); + +unsigned long *bitmap_zalloc(unsigned int nbits) +{ + return calloc(BITS_TO_LONGS(nbits), sizeof(unsigned long)); +} + +unsigned long *bitmap_xzalloc(unsigned int nbits) +{ + return xzalloc(BITS_TO_LONGS(nbits) * sizeof(unsigned long)); +} |