From 3f685a1f904daf5fe29adcabf9474c1c35f85db1 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 20 Jan 2020 19:59:43 +0100 Subject: Add compatibility support for bitmap_zalloc() and bitmap_zero() Signed-off-by: Jozsef Kadlecsik --- kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'kernel') diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in index d71c3fd..57c9996 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in +++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in @@ -26,6 +26,8 @@ #@HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE@ HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE #@HAVE_KVCALLOC@ HAVE_KVCALLOC #@HAVE_KVFREE@ HAVE_KVFREE +#@HAVE_BITMAP_ZALLOC@ HAVE_BITMAP_ZALLOC +#@HAVE_BITMAP_ZERO@ HAVE_BITMAP_ZERO #@HAVE_XT_MTCHK_PARAM_STRUCT_NET@ HAVE_XT_MTCHK_PARAM_STRUCT_NET #@HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET@ HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET #@HAVE_TCF_EMATCH_STRUCT_NET@ HAVE_TCF_EMATCH_STRUCT_NET @@ -253,6 +255,16 @@ static inline void kvfree(const void *addr) } #endif +#ifndef HAVE_BITMAP_ZALLOC +#define bitmap_zalloc(nbits, flags) \ + kmalloc(BITS_TO_LONGS(nbits) * sizeof(unsigned long), (flags) | __GFP_ZERO) +#endif + +#ifndef HAVE_BITMAP_ZERO +#define bitmap_zero(dst, nbits) \ + memset(dst, 0, BITS_TO_LONGS(nbits) * sizeof(unsigned long)) +#endif + #ifndef HAVE_NLA_PUT_BE16 static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) { -- cgit v1.2.3