Commit 8dea982a authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Pablo Neira Ayuso

netfilter: ipset: remove inline from static functions in .c files.

The inline function-specifier should not be used for static functions
defined in .c files since it bloats the kernel.  Instead leave the
compiler to decide which functions to inline.

While a couple of the files affected (ip_set_*_gen.h) are technically
headers, they contain templates for generating the common parts of
particular set-types and so we treat them like .c files.
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Acked-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 017f77c0
...@@ -192,7 +192,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext, ...@@ -192,7 +192,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext,
} }
#ifndef IP_SET_BITMAP_STORED_TIMEOUT #ifndef IP_SET_BITMAP_STORED_TIMEOUT
static inline bool static bool
mtype_is_filled(const struct mtype_elem *x) mtype_is_filled(const struct mtype_elem *x)
{ {
return true; return true;
......
...@@ -55,7 +55,7 @@ struct bitmap_ip_adt_elem { ...@@ -55,7 +55,7 @@ struct bitmap_ip_adt_elem {
u16 id; u16 id;
}; };
static inline u32 static u32
ip_to_id(const struct bitmap_ip *m, u32 ip) ip_to_id(const struct bitmap_ip *m, u32 ip)
{ {
return ((ip & ip_set_hostmask(m->netmask)) - m->first_ip) / m->hosts; return ((ip & ip_set_hostmask(m->netmask)) - m->first_ip) / m->hosts;
...@@ -63,33 +63,33 @@ ip_to_id(const struct bitmap_ip *m, u32 ip) ...@@ -63,33 +63,33 @@ ip_to_id(const struct bitmap_ip *m, u32 ip)
/* Common functions */ /* Common functions */
static inline int static int
bitmap_ip_do_test(const struct bitmap_ip_adt_elem *e, bitmap_ip_do_test(const struct bitmap_ip_adt_elem *e,
struct bitmap_ip *map, size_t dsize) struct bitmap_ip *map, size_t dsize)
{ {
return !!test_bit(e->id, map->members); return !!test_bit(e->id, map->members);
} }
static inline int static int
bitmap_ip_gc_test(u16 id, const struct bitmap_ip *map, size_t dsize) bitmap_ip_gc_test(u16 id, const struct bitmap_ip *map, size_t dsize)
{ {
return !!test_bit(id, map->members); return !!test_bit(id, map->members);
} }
static inline int static int
bitmap_ip_do_add(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map, bitmap_ip_do_add(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map,
u32 flags, size_t dsize) u32 flags, size_t dsize)
{ {
return !!test_bit(e->id, map->members); return !!test_bit(e->id, map->members);
} }
static inline int static int
bitmap_ip_do_del(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map) bitmap_ip_do_del(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map)
{ {
return !test_and_clear_bit(e->id, map->members); return !test_and_clear_bit(e->id, map->members);
} }
static inline int static int
bitmap_ip_do_list(struct sk_buff *skb, const struct bitmap_ip *map, u32 id, bitmap_ip_do_list(struct sk_buff *skb, const struct bitmap_ip *map, u32 id,
size_t dsize) size_t dsize)
{ {
...@@ -97,7 +97,7 @@ bitmap_ip_do_list(struct sk_buff *skb, const struct bitmap_ip *map, u32 id, ...@@ -97,7 +97,7 @@ bitmap_ip_do_list(struct sk_buff *skb, const struct bitmap_ip *map, u32 id,
htonl(map->first_ip + id * map->hosts)); htonl(map->first_ip + id * map->hosts));
} }
static inline int static int
bitmap_ip_do_head(struct sk_buff *skb, const struct bitmap_ip *map) bitmap_ip_do_head(struct sk_buff *skb, const struct bitmap_ip *map)
{ {
return nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) || return nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) ||
......
...@@ -65,7 +65,7 @@ struct bitmap_ipmac_elem { ...@@ -65,7 +65,7 @@ struct bitmap_ipmac_elem {
unsigned char filled; unsigned char filled;
} __aligned(__alignof__(u64)); } __aligned(__alignof__(u64));
static inline u32 static u32
ip_to_id(const struct bitmap_ipmac *m, u32 ip) ip_to_id(const struct bitmap_ipmac *m, u32 ip)
{ {
return ip - m->first_ip; return ip - m->first_ip;
...@@ -79,7 +79,7 @@ ip_to_id(const struct bitmap_ipmac *m, u32 ip) ...@@ -79,7 +79,7 @@ ip_to_id(const struct bitmap_ipmac *m, u32 ip)
/* Common functions */ /* Common functions */
static inline int static int
bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e, bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e,
const struct bitmap_ipmac *map, size_t dsize) const struct bitmap_ipmac *map, size_t dsize)
{ {
...@@ -94,7 +94,7 @@ bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e, ...@@ -94,7 +94,7 @@ bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e,
return -EAGAIN; return -EAGAIN;
} }
static inline int static int
bitmap_ipmac_gc_test(u16 id, const struct bitmap_ipmac *map, size_t dsize) bitmap_ipmac_gc_test(u16 id, const struct bitmap_ipmac *map, size_t dsize)
{ {
const struct bitmap_ipmac_elem *elem; const struct bitmap_ipmac_elem *elem;
...@@ -106,13 +106,13 @@ bitmap_ipmac_gc_test(u16 id, const struct bitmap_ipmac *map, size_t dsize) ...@@ -106,13 +106,13 @@ bitmap_ipmac_gc_test(u16 id, const struct bitmap_ipmac *map, size_t dsize)
return elem->filled == MAC_FILLED; return elem->filled == MAC_FILLED;
} }
static inline int static int
bitmap_ipmac_is_filled(const struct bitmap_ipmac_elem *elem) bitmap_ipmac_is_filled(const struct bitmap_ipmac_elem *elem)
{ {
return elem->filled == MAC_FILLED; return elem->filled == MAC_FILLED;
} }
static inline int static int
bitmap_ipmac_add_timeout(unsigned long *timeout, bitmap_ipmac_add_timeout(unsigned long *timeout,
const struct bitmap_ipmac_adt_elem *e, const struct bitmap_ipmac_adt_elem *e,
const struct ip_set_ext *ext, struct ip_set *set, const struct ip_set_ext *ext, struct ip_set *set,
...@@ -139,7 +139,7 @@ bitmap_ipmac_add_timeout(unsigned long *timeout, ...@@ -139,7 +139,7 @@ bitmap_ipmac_add_timeout(unsigned long *timeout,
return 0; return 0;
} }
static inline int static int
bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e,
struct bitmap_ipmac *map, u32 flags, size_t dsize) struct bitmap_ipmac *map, u32 flags, size_t dsize)
{ {
...@@ -177,14 +177,14 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, ...@@ -177,14 +177,14 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e,
return IPSET_ADD_STORE_PLAIN_TIMEOUT; return IPSET_ADD_STORE_PLAIN_TIMEOUT;
} }
static inline int static int
bitmap_ipmac_do_del(const struct bitmap_ipmac_adt_elem *e, bitmap_ipmac_do_del(const struct bitmap_ipmac_adt_elem *e,
struct bitmap_ipmac *map) struct bitmap_ipmac *map)
{ {
return !test_and_clear_bit(e->id, map->members); return !test_and_clear_bit(e->id, map->members);
} }
static inline int static int
bitmap_ipmac_do_list(struct sk_buff *skb, const struct bitmap_ipmac *map, bitmap_ipmac_do_list(struct sk_buff *skb, const struct bitmap_ipmac *map,
u32 id, size_t dsize) u32 id, size_t dsize)
{ {
...@@ -197,7 +197,7 @@ bitmap_ipmac_do_list(struct sk_buff *skb, const struct bitmap_ipmac *map, ...@@ -197,7 +197,7 @@ bitmap_ipmac_do_list(struct sk_buff *skb, const struct bitmap_ipmac *map,
nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, elem->ether)); nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, elem->ether));
} }
static inline int static int
bitmap_ipmac_do_head(struct sk_buff *skb, const struct bitmap_ipmac *map) bitmap_ipmac_do_head(struct sk_buff *skb, const struct bitmap_ipmac *map)
{ {
return nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) || return nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) ||
......
...@@ -46,7 +46,7 @@ struct bitmap_port_adt_elem { ...@@ -46,7 +46,7 @@ struct bitmap_port_adt_elem {
u16 id; u16 id;
}; };
static inline u16 static u16
port_to_id(const struct bitmap_port *m, u16 port) port_to_id(const struct bitmap_port *m, u16 port)
{ {
return port - m->first_port; return port - m->first_port;
...@@ -54,34 +54,34 @@ port_to_id(const struct bitmap_port *m, u16 port) ...@@ -54,34 +54,34 @@ port_to_id(const struct bitmap_port *m, u16 port)
/* Common functions */ /* Common functions */
static inline int static int
bitmap_port_do_test(const struct bitmap_port_adt_elem *e, bitmap_port_do_test(const struct bitmap_port_adt_elem *e,
const struct bitmap_port *map, size_t dsize) const struct bitmap_port *map, size_t dsize)
{ {
return !!test_bit(e->id, map->members); return !!test_bit(e->id, map->members);
} }
static inline int static int
bitmap_port_gc_test(u16 id, const struct bitmap_port *map, size_t dsize) bitmap_port_gc_test(u16 id, const struct bitmap_port *map, size_t dsize)
{ {
return !!test_bit(id, map->members); return !!test_bit(id, map->members);
} }
static inline int static int
bitmap_port_do_add(const struct bitmap_port_adt_elem *e, bitmap_port_do_add(const struct bitmap_port_adt_elem *e,
struct bitmap_port *map, u32 flags, size_t dsize) struct bitmap_port *map, u32 flags, size_t dsize)
{ {
return !!test_bit(e->id, map->members); return !!test_bit(e->id, map->members);
} }
static inline int static int
bitmap_port_do_del(const struct bitmap_port_adt_elem *e, bitmap_port_do_del(const struct bitmap_port_adt_elem *e,
struct bitmap_port *map) struct bitmap_port *map)
{ {
return !test_and_clear_bit(e->id, map->members); return !test_and_clear_bit(e->id, map->members);
} }
static inline int static int
bitmap_port_do_list(struct sk_buff *skb, const struct bitmap_port *map, u32 id, bitmap_port_do_list(struct sk_buff *skb, const struct bitmap_port *map, u32 id,
size_t dsize) size_t dsize)
{ {
...@@ -89,7 +89,7 @@ bitmap_port_do_list(struct sk_buff *skb, const struct bitmap_port *map, u32 id, ...@@ -89,7 +89,7 @@ bitmap_port_do_list(struct sk_buff *skb, const struct bitmap_port *map, u32 id,
htons(map->first_port + id)); htons(map->first_port + id));
} }
static inline int static int
bitmap_port_do_head(struct sk_buff *skb, const struct bitmap_port *map) bitmap_port_do_head(struct sk_buff *skb, const struct bitmap_port *map)
{ {
return nla_put_net16(skb, IPSET_ATTR_PORT, htons(map->first_port)) || return nla_put_net16(skb, IPSET_ATTR_PORT, htons(map->first_port)) ||
......
...@@ -35,7 +35,7 @@ struct ip_set_net { ...@@ -35,7 +35,7 @@ struct ip_set_net {
static unsigned int ip_set_net_id __read_mostly; static unsigned int ip_set_net_id __read_mostly;
static inline struct ip_set_net *ip_set_pernet(struct net *net) static struct ip_set_net *ip_set_pernet(struct net *net)
{ {
return net_generic(net, ip_set_net_id); return net_generic(net, ip_set_net_id);
} }
...@@ -67,13 +67,13 @@ MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET); ...@@ -67,13 +67,13 @@ MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET);
* serialized by ip_set_type_mutex. * serialized by ip_set_type_mutex.
*/ */
static inline void static void
ip_set_type_lock(void) ip_set_type_lock(void)
{ {
mutex_lock(&ip_set_type_mutex); mutex_lock(&ip_set_type_mutex);
} }
static inline void static void
ip_set_type_unlock(void) ip_set_type_unlock(void)
{ {
mutex_unlock(&ip_set_type_mutex); mutex_unlock(&ip_set_type_mutex);
...@@ -277,7 +277,7 @@ ip_set_free(void *members) ...@@ -277,7 +277,7 @@ ip_set_free(void *members)
} }
EXPORT_SYMBOL_GPL(ip_set_free); EXPORT_SYMBOL_GPL(ip_set_free);
static inline bool static bool
flag_nested(const struct nlattr *nla) flag_nested(const struct nlattr *nla)
{ {
return nla->nla_type & NLA_F_NESTED; return nla->nla_type & NLA_F_NESTED;
...@@ -356,7 +356,7 @@ const struct ip_set_ext_type ip_set_extensions[] = { ...@@ -356,7 +356,7 @@ const struct ip_set_ext_type ip_set_extensions[] = {
}; };
EXPORT_SYMBOL_GPL(ip_set_extensions); EXPORT_SYMBOL_GPL(ip_set_extensions);
static inline bool static bool
add_extension(enum ip_set_ext_id id, u32 flags, struct nlattr *tb[]) add_extension(enum ip_set_ext_id id, u32 flags, struct nlattr *tb[])
{ {
return ip_set_extensions[id].flag ? return ip_set_extensions[id].flag ?
...@@ -506,7 +506,7 @@ EXPORT_SYMBOL_GPL(ip_set_match_extensions); ...@@ -506,7 +506,7 @@ EXPORT_SYMBOL_GPL(ip_set_match_extensions);
* The set behind an index may change by swapping only, from userspace. * The set behind an index may change by swapping only, from userspace.
*/ */
static inline void static void
__ip_set_get(struct ip_set *set) __ip_set_get(struct ip_set *set)
{ {
write_lock_bh(&ip_set_ref_lock); write_lock_bh(&ip_set_ref_lock);
...@@ -514,7 +514,7 @@ __ip_set_get(struct ip_set *set) ...@@ -514,7 +514,7 @@ __ip_set_get(struct ip_set *set)
write_unlock_bh(&ip_set_ref_lock); write_unlock_bh(&ip_set_ref_lock);
} }
static inline void static void
__ip_set_put(struct ip_set *set) __ip_set_put(struct ip_set *set)
{ {
write_lock_bh(&ip_set_ref_lock); write_lock_bh(&ip_set_ref_lock);
...@@ -526,7 +526,7 @@ __ip_set_put(struct ip_set *set) ...@@ -526,7 +526,7 @@ __ip_set_put(struct ip_set *set)
/* set->ref can be swapped out by ip_set_swap, netlink events (like dump) need /* set->ref can be swapped out by ip_set_swap, netlink events (like dump) need
* a separate reference counter * a separate reference counter
*/ */
static inline void static void
__ip_set_put_netlink(struct ip_set *set) __ip_set_put_netlink(struct ip_set *set)
{ {
write_lock_bh(&ip_set_ref_lock); write_lock_bh(&ip_set_ref_lock);
...@@ -541,7 +541,7 @@ __ip_set_put_netlink(struct ip_set *set) ...@@ -541,7 +541,7 @@ __ip_set_put_netlink(struct ip_set *set)
* so it can't be destroyed (or changed) under our foot. * so it can't be destroyed (or changed) under our foot.
*/ */
static inline struct ip_set * static struct ip_set *
ip_set_rcu_get(struct net *net, ip_set_id_t index) ip_set_rcu_get(struct net *net, ip_set_id_t index)
{ {
struct ip_set *set; struct ip_set *set;
...@@ -670,7 +670,7 @@ EXPORT_SYMBOL_GPL(ip_set_get_byname); ...@@ -670,7 +670,7 @@ EXPORT_SYMBOL_GPL(ip_set_get_byname);
* *
*/ */
static inline void static void
__ip_set_put_byindex(struct ip_set_net *inst, ip_set_id_t index) __ip_set_put_byindex(struct ip_set_net *inst, ip_set_id_t index)
{ {
struct ip_set *set; struct ip_set *set;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#ifdef IP_SET_HASH_WITH_MULTI #ifdef IP_SET_HASH_WITH_MULTI
#define AHASH_MAX(h) ((h)->ahash_max) #define AHASH_MAX(h) ((h)->ahash_max)
static inline u8 static u8
tune_ahash_max(u8 curr, u32 multi) tune_ahash_max(u8 curr, u32 multi)
{ {
u32 n; u32 n;
...@@ -909,7 +909,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext, ...@@ -909,7 +909,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext,
return ret; return ret;
} }
static inline int static int
mtype_data_match(struct mtype_elem *data, const struct ip_set_ext *ext, mtype_data_match(struct mtype_elem *data, const struct ip_set_ext *ext,
struct ip_set_ext *mext, struct ip_set *set, u32 flags) struct ip_set_ext *mext, struct ip_set *set, u32 flags)
{ {
......
...@@ -44,7 +44,7 @@ struct hash_ip4_elem { ...@@ -44,7 +44,7 @@ struct hash_ip4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ip4_data_equal(const struct hash_ip4_elem *e1, hash_ip4_data_equal(const struct hash_ip4_elem *e1,
const struct hash_ip4_elem *e2, const struct hash_ip4_elem *e2,
u32 *multi) u32 *multi)
...@@ -63,7 +63,7 @@ hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *e) ...@@ -63,7 +63,7 @@ hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *e)
return true; return true;
} }
static inline void static void
hash_ip4_data_next(struct hash_ip4_elem *next, const struct hash_ip4_elem *e) hash_ip4_data_next(struct hash_ip4_elem *next, const struct hash_ip4_elem *e)
{ {
next->ip = e->ip; next->ip = e->ip;
...@@ -171,7 +171,7 @@ struct hash_ip6_elem { ...@@ -171,7 +171,7 @@ struct hash_ip6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ip6_data_equal(const struct hash_ip6_elem *ip1, hash_ip6_data_equal(const struct hash_ip6_elem *ip1,
const struct hash_ip6_elem *ip2, const struct hash_ip6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -179,7 +179,7 @@ hash_ip6_data_equal(const struct hash_ip6_elem *ip1, ...@@ -179,7 +179,7 @@ hash_ip6_data_equal(const struct hash_ip6_elem *ip1,
return ipv6_addr_equal(&ip1->ip.in6, &ip2->ip.in6); return ipv6_addr_equal(&ip1->ip.in6, &ip2->ip.in6);
} }
static inline void static void
hash_ip6_netmask(union nf_inet_addr *ip, u8 prefix) hash_ip6_netmask(union nf_inet_addr *ip, u8 prefix)
{ {
ip6_netmask(ip, prefix); ip6_netmask(ip, prefix);
...@@ -196,7 +196,7 @@ hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *e) ...@@ -196,7 +196,7 @@ hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *e)
return true; return true;
} }
static inline void static void
hash_ip6_data_next(struct hash_ip6_elem *next, const struct hash_ip6_elem *e) hash_ip6_data_next(struct hash_ip6_elem *next, const struct hash_ip6_elem *e)
{ {
} }
......
...@@ -47,7 +47,7 @@ struct hash_ipmac4_elem { ...@@ -47,7 +47,7 @@ struct hash_ipmac4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipmac4_data_equal(const struct hash_ipmac4_elem *e1, hash_ipmac4_data_equal(const struct hash_ipmac4_elem *e1,
const struct hash_ipmac4_elem *e2, const struct hash_ipmac4_elem *e2,
u32 *multi) u32 *multi)
...@@ -67,7 +67,7 @@ hash_ipmac4_data_list(struct sk_buff *skb, const struct hash_ipmac4_elem *e) ...@@ -67,7 +67,7 @@ hash_ipmac4_data_list(struct sk_buff *skb, const struct hash_ipmac4_elem *e)
return true; return true;
} }
static inline void static void
hash_ipmac4_data_next(struct hash_ipmac4_elem *next, hash_ipmac4_data_next(struct hash_ipmac4_elem *next,
const struct hash_ipmac4_elem *e) const struct hash_ipmac4_elem *e)
{ {
...@@ -154,7 +154,7 @@ struct hash_ipmac6_elem { ...@@ -154,7 +154,7 @@ struct hash_ipmac6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipmac6_data_equal(const struct hash_ipmac6_elem *e1, hash_ipmac6_data_equal(const struct hash_ipmac6_elem *e1,
const struct hash_ipmac6_elem *e2, const struct hash_ipmac6_elem *e2,
u32 *multi) u32 *multi)
...@@ -175,7 +175,7 @@ hash_ipmac6_data_list(struct sk_buff *skb, const struct hash_ipmac6_elem *e) ...@@ -175,7 +175,7 @@ hash_ipmac6_data_list(struct sk_buff *skb, const struct hash_ipmac6_elem *e)
return true; return true;
} }
static inline void static void
hash_ipmac6_data_next(struct hash_ipmac6_elem *next, hash_ipmac6_data_next(struct hash_ipmac6_elem *next,
const struct hash_ipmac6_elem *e) const struct hash_ipmac6_elem *e)
{ {
......
...@@ -42,7 +42,7 @@ struct hash_ipmark4_elem { ...@@ -42,7 +42,7 @@ struct hash_ipmark4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipmark4_data_equal(const struct hash_ipmark4_elem *ip1, hash_ipmark4_data_equal(const struct hash_ipmark4_elem *ip1,
const struct hash_ipmark4_elem *ip2, const struct hash_ipmark4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -64,7 +64,7 @@ hash_ipmark4_data_list(struct sk_buff *skb, ...@@ -64,7 +64,7 @@ hash_ipmark4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipmark4_data_next(struct hash_ipmark4_elem *next, hash_ipmark4_data_next(struct hash_ipmark4_elem *next,
const struct hash_ipmark4_elem *d) const struct hash_ipmark4_elem *d)
{ {
...@@ -165,7 +165,7 @@ struct hash_ipmark6_elem { ...@@ -165,7 +165,7 @@ struct hash_ipmark6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipmark6_data_equal(const struct hash_ipmark6_elem *ip1, hash_ipmark6_data_equal(const struct hash_ipmark6_elem *ip1,
const struct hash_ipmark6_elem *ip2, const struct hash_ipmark6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -187,7 +187,7 @@ hash_ipmark6_data_list(struct sk_buff *skb, ...@@ -187,7 +187,7 @@ hash_ipmark6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipmark6_data_next(struct hash_ipmark6_elem *next, hash_ipmark6_data_next(struct hash_ipmark6_elem *next,
const struct hash_ipmark6_elem *d) const struct hash_ipmark6_elem *d)
{ {
......
...@@ -47,7 +47,7 @@ struct hash_ipport4_elem { ...@@ -47,7 +47,7 @@ struct hash_ipport4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipport4_data_equal(const struct hash_ipport4_elem *ip1, hash_ipport4_data_equal(const struct hash_ipport4_elem *ip1,
const struct hash_ipport4_elem *ip2, const struct hash_ipport4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -71,7 +71,7 @@ hash_ipport4_data_list(struct sk_buff *skb, ...@@ -71,7 +71,7 @@ hash_ipport4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipport4_data_next(struct hash_ipport4_elem *next, hash_ipport4_data_next(struct hash_ipport4_elem *next,
const struct hash_ipport4_elem *d) const struct hash_ipport4_elem *d)
{ {
...@@ -202,7 +202,7 @@ struct hash_ipport6_elem { ...@@ -202,7 +202,7 @@ struct hash_ipport6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipport6_data_equal(const struct hash_ipport6_elem *ip1, hash_ipport6_data_equal(const struct hash_ipport6_elem *ip1,
const struct hash_ipport6_elem *ip2, const struct hash_ipport6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -226,7 +226,7 @@ hash_ipport6_data_list(struct sk_buff *skb, ...@@ -226,7 +226,7 @@ hash_ipport6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipport6_data_next(struct hash_ipport6_elem *next, hash_ipport6_data_next(struct hash_ipport6_elem *next,
const struct hash_ipport6_elem *d) const struct hash_ipport6_elem *d)
{ {
......
...@@ -46,7 +46,7 @@ struct hash_ipportip4_elem { ...@@ -46,7 +46,7 @@ struct hash_ipportip4_elem {
u8 padding; u8 padding;
}; };
static inline bool static bool
hash_ipportip4_data_equal(const struct hash_ipportip4_elem *ip1, hash_ipportip4_data_equal(const struct hash_ipportip4_elem *ip1,
const struct hash_ipportip4_elem *ip2, const struct hash_ipportip4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -72,7 +72,7 @@ hash_ipportip4_data_list(struct sk_buff *skb, ...@@ -72,7 +72,7 @@ hash_ipportip4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipportip4_data_next(struct hash_ipportip4_elem *next, hash_ipportip4_data_next(struct hash_ipportip4_elem *next,
const struct hash_ipportip4_elem *d) const struct hash_ipportip4_elem *d)
{ {
...@@ -210,7 +210,7 @@ struct hash_ipportip6_elem { ...@@ -210,7 +210,7 @@ struct hash_ipportip6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipportip6_data_equal(const struct hash_ipportip6_elem *ip1, hash_ipportip6_data_equal(const struct hash_ipportip6_elem *ip1,
const struct hash_ipportip6_elem *ip2, const struct hash_ipportip6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -236,7 +236,7 @@ hash_ipportip6_data_list(struct sk_buff *skb, ...@@ -236,7 +236,7 @@ hash_ipportip6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipportip6_data_next(struct hash_ipportip6_elem *next, hash_ipportip6_data_next(struct hash_ipportip6_elem *next,
const struct hash_ipportip6_elem *d) const struct hash_ipportip6_elem *d)
{ {
......
...@@ -59,7 +59,7 @@ struct hash_ipportnet4_elem { ...@@ -59,7 +59,7 @@ struct hash_ipportnet4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipportnet4_data_equal(const struct hash_ipportnet4_elem *ip1, hash_ipportnet4_data_equal(const struct hash_ipportnet4_elem *ip1,
const struct hash_ipportnet4_elem *ip2, const struct hash_ipportnet4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -71,25 +71,25 @@ hash_ipportnet4_data_equal(const struct hash_ipportnet4_elem *ip1, ...@@ -71,25 +71,25 @@ hash_ipportnet4_data_equal(const struct hash_ipportnet4_elem *ip1,
ip1->proto == ip2->proto; ip1->proto == ip2->proto;
} }
static inline int static int
hash_ipportnet4_do_data_match(const struct hash_ipportnet4_elem *elem) hash_ipportnet4_do_data_match(const struct hash_ipportnet4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_ipportnet4_data_set_flags(struct hash_ipportnet4_elem *elem, u32 flags) hash_ipportnet4_data_set_flags(struct hash_ipportnet4_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_ipportnet4_data_reset_flags(struct hash_ipportnet4_elem *elem, u8 *flags) hash_ipportnet4_data_reset_flags(struct hash_ipportnet4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr) hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr)
{ {
elem->ip2 &= ip_set_netmask(cidr); elem->ip2 &= ip_set_netmask(cidr);
...@@ -116,7 +116,7 @@ hash_ipportnet4_data_list(struct sk_buff *skb, ...@@ -116,7 +116,7 @@ hash_ipportnet4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipportnet4_data_next(struct hash_ipportnet4_elem *next, hash_ipportnet4_data_next(struct hash_ipportnet4_elem *next,
const struct hash_ipportnet4_elem *d) const struct hash_ipportnet4_elem *d)
{ {
...@@ -308,7 +308,7 @@ struct hash_ipportnet6_elem { ...@@ -308,7 +308,7 @@ struct hash_ipportnet6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_ipportnet6_data_equal(const struct hash_ipportnet6_elem *ip1, hash_ipportnet6_data_equal(const struct hash_ipportnet6_elem *ip1,
const struct hash_ipportnet6_elem *ip2, const struct hash_ipportnet6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -320,25 +320,25 @@ hash_ipportnet6_data_equal(const struct hash_ipportnet6_elem *ip1, ...@@ -320,25 +320,25 @@ hash_ipportnet6_data_equal(const struct hash_ipportnet6_elem *ip1,
ip1->proto == ip2->proto; ip1->proto == ip2->proto;
} }
static inline int static int
hash_ipportnet6_do_data_match(const struct hash_ipportnet6_elem *elem) hash_ipportnet6_do_data_match(const struct hash_ipportnet6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_ipportnet6_data_set_flags(struct hash_ipportnet6_elem *elem, u32 flags) hash_ipportnet6_data_set_flags(struct hash_ipportnet6_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_ipportnet6_data_reset_flags(struct hash_ipportnet6_elem *elem, u8 *flags) hash_ipportnet6_data_reset_flags(struct hash_ipportnet6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr) hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr)
{ {
ip6_netmask(&elem->ip2, cidr); ip6_netmask(&elem->ip2, cidr);
...@@ -365,7 +365,7 @@ hash_ipportnet6_data_list(struct sk_buff *skb, ...@@ -365,7 +365,7 @@ hash_ipportnet6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_ipportnet6_data_next(struct hash_ipportnet6_elem *next, hash_ipportnet6_data_next(struct hash_ipportnet6_elem *next,
const struct hash_ipportnet6_elem *d) const struct hash_ipportnet6_elem *d)
{ {
......
...@@ -37,7 +37,7 @@ struct hash_mac4_elem { ...@@ -37,7 +37,7 @@ struct hash_mac4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_mac4_data_equal(const struct hash_mac4_elem *e1, hash_mac4_data_equal(const struct hash_mac4_elem *e1,
const struct hash_mac4_elem *e2, const struct hash_mac4_elem *e2,
u32 *multi) u32 *multi)
...@@ -45,7 +45,7 @@ hash_mac4_data_equal(const struct hash_mac4_elem *e1, ...@@ -45,7 +45,7 @@ hash_mac4_data_equal(const struct hash_mac4_elem *e1,
return ether_addr_equal(e1->ether, e2->ether); return ether_addr_equal(e1->ether, e2->ether);
} }
static inline bool static bool
hash_mac4_data_list(struct sk_buff *skb, const struct hash_mac4_elem *e) hash_mac4_data_list(struct sk_buff *skb, const struct hash_mac4_elem *e)
{ {
if (nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, e->ether)) if (nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN, e->ether))
...@@ -56,7 +56,7 @@ hash_mac4_data_list(struct sk_buff *skb, const struct hash_mac4_elem *e) ...@@ -56,7 +56,7 @@ hash_mac4_data_list(struct sk_buff *skb, const struct hash_mac4_elem *e)
return true; return true;
} }
static inline void static void
hash_mac4_data_next(struct hash_mac4_elem *next, hash_mac4_data_next(struct hash_mac4_elem *next,
const struct hash_mac4_elem *e) const struct hash_mac4_elem *e)
{ {
......
...@@ -47,7 +47,7 @@ struct hash_net4_elem { ...@@ -47,7 +47,7 @@ struct hash_net4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_net4_data_equal(const struct hash_net4_elem *ip1, hash_net4_data_equal(const struct hash_net4_elem *ip1,
const struct hash_net4_elem *ip2, const struct hash_net4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -56,25 +56,25 @@ hash_net4_data_equal(const struct hash_net4_elem *ip1, ...@@ -56,25 +56,25 @@ hash_net4_data_equal(const struct hash_net4_elem *ip1,
ip1->cidr == ip2->cidr; ip1->cidr == ip2->cidr;
} }
static inline int static int
hash_net4_do_data_match(const struct hash_net4_elem *elem) hash_net4_do_data_match(const struct hash_net4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_net4_data_set_flags(struct hash_net4_elem *elem, u32 flags) hash_net4_data_set_flags(struct hash_net4_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_net4_data_reset_flags(struct hash_net4_elem *elem, u8 *flags) hash_net4_data_reset_flags(struct hash_net4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr) hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr)
{ {
elem->ip &= ip_set_netmask(cidr); elem->ip &= ip_set_netmask(cidr);
...@@ -97,7 +97,7 @@ hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data) ...@@ -97,7 +97,7 @@ hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data)
return true; return true;
} }
static inline void static void
hash_net4_data_next(struct hash_net4_elem *next, hash_net4_data_next(struct hash_net4_elem *next,
const struct hash_net4_elem *d) const struct hash_net4_elem *d)
{ {
...@@ -212,7 +212,7 @@ struct hash_net6_elem { ...@@ -212,7 +212,7 @@ struct hash_net6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_net6_data_equal(const struct hash_net6_elem *ip1, hash_net6_data_equal(const struct hash_net6_elem *ip1,
const struct hash_net6_elem *ip2, const struct hash_net6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -221,25 +221,25 @@ hash_net6_data_equal(const struct hash_net6_elem *ip1, ...@@ -221,25 +221,25 @@ hash_net6_data_equal(const struct hash_net6_elem *ip1,
ip1->cidr == ip2->cidr; ip1->cidr == ip2->cidr;
} }
static inline int static int
hash_net6_do_data_match(const struct hash_net6_elem *elem) hash_net6_do_data_match(const struct hash_net6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_net6_data_set_flags(struct hash_net6_elem *elem, u32 flags) hash_net6_data_set_flags(struct hash_net6_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_net6_data_reset_flags(struct hash_net6_elem *elem, u8 *flags) hash_net6_data_reset_flags(struct hash_net6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr) hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr)
{ {
ip6_netmask(&elem->ip, cidr); ip6_netmask(&elem->ip, cidr);
...@@ -262,7 +262,7 @@ hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data) ...@@ -262,7 +262,7 @@ hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data)
return true; return true;
} }
static inline void static void
hash_net6_data_next(struct hash_net6_elem *next, hash_net6_data_next(struct hash_net6_elem *next,
const struct hash_net6_elem *d) const struct hash_net6_elem *d)
{ {
......
...@@ -62,7 +62,7 @@ struct hash_netiface4_elem { ...@@ -62,7 +62,7 @@ struct hash_netiface4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netiface4_data_equal(const struct hash_netiface4_elem *ip1, hash_netiface4_data_equal(const struct hash_netiface4_elem *ip1,
const struct hash_netiface4_elem *ip2, const struct hash_netiface4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -74,25 +74,25 @@ hash_netiface4_data_equal(const struct hash_netiface4_elem *ip1, ...@@ -74,25 +74,25 @@ hash_netiface4_data_equal(const struct hash_netiface4_elem *ip1,
strcmp(ip1->iface, ip2->iface) == 0; strcmp(ip1->iface, ip2->iface) == 0;
} }
static inline int static int
hash_netiface4_do_data_match(const struct hash_netiface4_elem *elem) hash_netiface4_do_data_match(const struct hash_netiface4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netiface4_data_set_flags(struct hash_netiface4_elem *elem, u32 flags) hash_netiface4_data_set_flags(struct hash_netiface4_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_netiface4_data_reset_flags(struct hash_netiface4_elem *elem, u8 *flags) hash_netiface4_data_reset_flags(struct hash_netiface4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netiface4_data_netmask(struct hash_netiface4_elem *elem, u8 cidr) hash_netiface4_data_netmask(struct hash_netiface4_elem *elem, u8 cidr)
{ {
elem->ip &= ip_set_netmask(cidr); elem->ip &= ip_set_netmask(cidr);
...@@ -119,7 +119,7 @@ hash_netiface4_data_list(struct sk_buff *skb, ...@@ -119,7 +119,7 @@ hash_netiface4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netiface4_data_next(struct hash_netiface4_elem *next, hash_netiface4_data_next(struct hash_netiface4_elem *next,
const struct hash_netiface4_elem *d) const struct hash_netiface4_elem *d)
{ {
...@@ -285,7 +285,7 @@ struct hash_netiface6_elem { ...@@ -285,7 +285,7 @@ struct hash_netiface6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netiface6_data_equal(const struct hash_netiface6_elem *ip1, hash_netiface6_data_equal(const struct hash_netiface6_elem *ip1,
const struct hash_netiface6_elem *ip2, const struct hash_netiface6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -297,25 +297,25 @@ hash_netiface6_data_equal(const struct hash_netiface6_elem *ip1, ...@@ -297,25 +297,25 @@ hash_netiface6_data_equal(const struct hash_netiface6_elem *ip1,
strcmp(ip1->iface, ip2->iface) == 0; strcmp(ip1->iface, ip2->iface) == 0;
} }
static inline int static int
hash_netiface6_do_data_match(const struct hash_netiface6_elem *elem) hash_netiface6_do_data_match(const struct hash_netiface6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netiface6_data_set_flags(struct hash_netiface6_elem *elem, u32 flags) hash_netiface6_data_set_flags(struct hash_netiface6_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_netiface6_data_reset_flags(struct hash_netiface6_elem *elem, u8 *flags) hash_netiface6_data_reset_flags(struct hash_netiface6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netiface6_data_netmask(struct hash_netiface6_elem *elem, u8 cidr) hash_netiface6_data_netmask(struct hash_netiface6_elem *elem, u8 cidr)
{ {
ip6_netmask(&elem->ip, cidr); ip6_netmask(&elem->ip, cidr);
...@@ -342,7 +342,7 @@ hash_netiface6_data_list(struct sk_buff *skb, ...@@ -342,7 +342,7 @@ hash_netiface6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netiface6_data_next(struct hash_netiface6_elem *next, hash_netiface6_data_next(struct hash_netiface6_elem *next,
const struct hash_netiface6_elem *d) const struct hash_netiface6_elem *d)
{ {
......
...@@ -52,7 +52,7 @@ struct hash_netnet4_elem { ...@@ -52,7 +52,7 @@ struct hash_netnet4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netnet4_data_equal(const struct hash_netnet4_elem *ip1, hash_netnet4_data_equal(const struct hash_netnet4_elem *ip1,
const struct hash_netnet4_elem *ip2, const struct hash_netnet4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -61,32 +61,32 @@ hash_netnet4_data_equal(const struct hash_netnet4_elem *ip1, ...@@ -61,32 +61,32 @@ hash_netnet4_data_equal(const struct hash_netnet4_elem *ip1,
ip1->ccmp == ip2->ccmp; ip1->ccmp == ip2->ccmp;
} }
static inline int static int
hash_netnet4_do_data_match(const struct hash_netnet4_elem *elem) hash_netnet4_do_data_match(const struct hash_netnet4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netnet4_data_set_flags(struct hash_netnet4_elem *elem, u32 flags) hash_netnet4_data_set_flags(struct hash_netnet4_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_netnet4_data_reset_flags(struct hash_netnet4_elem *elem, u8 *flags) hash_netnet4_data_reset_flags(struct hash_netnet4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netnet4_data_reset_elem(struct hash_netnet4_elem *elem, hash_netnet4_data_reset_elem(struct hash_netnet4_elem *elem,
struct hash_netnet4_elem *orig) struct hash_netnet4_elem *orig)
{ {
elem->ip[1] = orig->ip[1]; elem->ip[1] = orig->ip[1];
} }
static inline void static void
hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner) hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner)
{ {
if (inner) { if (inner) {
...@@ -117,7 +117,7 @@ hash_netnet4_data_list(struct sk_buff *skb, ...@@ -117,7 +117,7 @@ hash_netnet4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netnet4_data_next(struct hash_netnet4_elem *next, hash_netnet4_data_next(struct hash_netnet4_elem *next,
const struct hash_netnet4_elem *d) const struct hash_netnet4_elem *d)
{ {
...@@ -282,7 +282,7 @@ struct hash_netnet6_elem { ...@@ -282,7 +282,7 @@ struct hash_netnet6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netnet6_data_equal(const struct hash_netnet6_elem *ip1, hash_netnet6_data_equal(const struct hash_netnet6_elem *ip1,
const struct hash_netnet6_elem *ip2, const struct hash_netnet6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -292,32 +292,32 @@ hash_netnet6_data_equal(const struct hash_netnet6_elem *ip1, ...@@ -292,32 +292,32 @@ hash_netnet6_data_equal(const struct hash_netnet6_elem *ip1,
ip1->ccmp == ip2->ccmp; ip1->ccmp == ip2->ccmp;
} }
static inline int static int
hash_netnet6_do_data_match(const struct hash_netnet6_elem *elem) hash_netnet6_do_data_match(const struct hash_netnet6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netnet6_data_set_flags(struct hash_netnet6_elem *elem, u32 flags) hash_netnet6_data_set_flags(struct hash_netnet6_elem *elem, u32 flags)
{ {
elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH; elem->nomatch = (flags >> 16) & IPSET_FLAG_NOMATCH;
} }
static inline void static void
hash_netnet6_data_reset_flags(struct hash_netnet6_elem *elem, u8 *flags) hash_netnet6_data_reset_flags(struct hash_netnet6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netnet6_data_reset_elem(struct hash_netnet6_elem *elem, hash_netnet6_data_reset_elem(struct hash_netnet6_elem *elem,
struct hash_netnet6_elem *orig) struct hash_netnet6_elem *orig)
{ {
elem->ip[1] = orig->ip[1]; elem->ip[1] = orig->ip[1];
} }
static inline void static void
hash_netnet6_data_netmask(struct hash_netnet6_elem *elem, u8 cidr, bool inner) hash_netnet6_data_netmask(struct hash_netnet6_elem *elem, u8 cidr, bool inner)
{ {
if (inner) { if (inner) {
...@@ -348,7 +348,7 @@ hash_netnet6_data_list(struct sk_buff *skb, ...@@ -348,7 +348,7 @@ hash_netnet6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netnet6_data_next(struct hash_netnet6_elem *next, hash_netnet6_data_next(struct hash_netnet6_elem *next,
const struct hash_netnet6_elem *d) const struct hash_netnet6_elem *d)
{ {
......
...@@ -57,7 +57,7 @@ struct hash_netport4_elem { ...@@ -57,7 +57,7 @@ struct hash_netport4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netport4_data_equal(const struct hash_netport4_elem *ip1, hash_netport4_data_equal(const struct hash_netport4_elem *ip1,
const struct hash_netport4_elem *ip2, const struct hash_netport4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -68,25 +68,25 @@ hash_netport4_data_equal(const struct hash_netport4_elem *ip1, ...@@ -68,25 +68,25 @@ hash_netport4_data_equal(const struct hash_netport4_elem *ip1,
ip1->cidr == ip2->cidr; ip1->cidr == ip2->cidr;
} }
static inline int static int
hash_netport4_do_data_match(const struct hash_netport4_elem *elem) hash_netport4_do_data_match(const struct hash_netport4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netport4_data_set_flags(struct hash_netport4_elem *elem, u32 flags) hash_netport4_data_set_flags(struct hash_netport4_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_netport4_data_reset_flags(struct hash_netport4_elem *elem, u8 *flags) hash_netport4_data_reset_flags(struct hash_netport4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr) hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr)
{ {
elem->ip &= ip_set_netmask(cidr); elem->ip &= ip_set_netmask(cidr);
...@@ -112,7 +112,7 @@ hash_netport4_data_list(struct sk_buff *skb, ...@@ -112,7 +112,7 @@ hash_netport4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netport4_data_next(struct hash_netport4_elem *next, hash_netport4_data_next(struct hash_netport4_elem *next,
const struct hash_netport4_elem *d) const struct hash_netport4_elem *d)
{ {
...@@ -270,7 +270,7 @@ struct hash_netport6_elem { ...@@ -270,7 +270,7 @@ struct hash_netport6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netport6_data_equal(const struct hash_netport6_elem *ip1, hash_netport6_data_equal(const struct hash_netport6_elem *ip1,
const struct hash_netport6_elem *ip2, const struct hash_netport6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -281,25 +281,25 @@ hash_netport6_data_equal(const struct hash_netport6_elem *ip1, ...@@ -281,25 +281,25 @@ hash_netport6_data_equal(const struct hash_netport6_elem *ip1,
ip1->cidr == ip2->cidr; ip1->cidr == ip2->cidr;
} }
static inline int static int
hash_netport6_do_data_match(const struct hash_netport6_elem *elem) hash_netport6_do_data_match(const struct hash_netport6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netport6_data_set_flags(struct hash_netport6_elem *elem, u32 flags) hash_netport6_data_set_flags(struct hash_netport6_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_netport6_data_reset_flags(struct hash_netport6_elem *elem, u8 *flags) hash_netport6_data_reset_flags(struct hash_netport6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr) hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr)
{ {
ip6_netmask(&elem->ip, cidr); ip6_netmask(&elem->ip, cidr);
...@@ -325,7 +325,7 @@ hash_netport6_data_list(struct sk_buff *skb, ...@@ -325,7 +325,7 @@ hash_netport6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netport6_data_next(struct hash_netport6_elem *next, hash_netport6_data_next(struct hash_netport6_elem *next,
const struct hash_netport6_elem *d) const struct hash_netport6_elem *d)
{ {
......
...@@ -56,7 +56,7 @@ struct hash_netportnet4_elem { ...@@ -56,7 +56,7 @@ struct hash_netportnet4_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netportnet4_data_equal(const struct hash_netportnet4_elem *ip1, hash_netportnet4_data_equal(const struct hash_netportnet4_elem *ip1,
const struct hash_netportnet4_elem *ip2, const struct hash_netportnet4_elem *ip2,
u32 *multi) u32 *multi)
...@@ -67,32 +67,32 @@ hash_netportnet4_data_equal(const struct hash_netportnet4_elem *ip1, ...@@ -67,32 +67,32 @@ hash_netportnet4_data_equal(const struct hash_netportnet4_elem *ip1,
ip1->proto == ip2->proto; ip1->proto == ip2->proto;
} }
static inline int static int
hash_netportnet4_do_data_match(const struct hash_netportnet4_elem *elem) hash_netportnet4_do_data_match(const struct hash_netportnet4_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netportnet4_data_set_flags(struct hash_netportnet4_elem *elem, u32 flags) hash_netportnet4_data_set_flags(struct hash_netportnet4_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_netportnet4_data_reset_flags(struct hash_netportnet4_elem *elem, u8 *flags) hash_netportnet4_data_reset_flags(struct hash_netportnet4_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netportnet4_data_reset_elem(struct hash_netportnet4_elem *elem, hash_netportnet4_data_reset_elem(struct hash_netportnet4_elem *elem,
struct hash_netportnet4_elem *orig) struct hash_netportnet4_elem *orig)
{ {
elem->ip[1] = orig->ip[1]; elem->ip[1] = orig->ip[1];
} }
static inline void static void
hash_netportnet4_data_netmask(struct hash_netportnet4_elem *elem, hash_netportnet4_data_netmask(struct hash_netportnet4_elem *elem,
u8 cidr, bool inner) u8 cidr, bool inner)
{ {
...@@ -126,7 +126,7 @@ hash_netportnet4_data_list(struct sk_buff *skb, ...@@ -126,7 +126,7 @@ hash_netportnet4_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netportnet4_data_next(struct hash_netportnet4_elem *next, hash_netportnet4_data_next(struct hash_netportnet4_elem *next,
const struct hash_netportnet4_elem *d) const struct hash_netportnet4_elem *d)
{ {
...@@ -331,7 +331,7 @@ struct hash_netportnet6_elem { ...@@ -331,7 +331,7 @@ struct hash_netportnet6_elem {
/* Common functions */ /* Common functions */
static inline bool static bool
hash_netportnet6_data_equal(const struct hash_netportnet6_elem *ip1, hash_netportnet6_data_equal(const struct hash_netportnet6_elem *ip1,
const struct hash_netportnet6_elem *ip2, const struct hash_netportnet6_elem *ip2,
u32 *multi) u32 *multi)
...@@ -343,32 +343,32 @@ hash_netportnet6_data_equal(const struct hash_netportnet6_elem *ip1, ...@@ -343,32 +343,32 @@ hash_netportnet6_data_equal(const struct hash_netportnet6_elem *ip1,
ip1->proto == ip2->proto; ip1->proto == ip2->proto;
} }
static inline int static int
hash_netportnet6_do_data_match(const struct hash_netportnet6_elem *elem) hash_netportnet6_do_data_match(const struct hash_netportnet6_elem *elem)
{ {
return elem->nomatch ? -ENOTEMPTY : 1; return elem->nomatch ? -ENOTEMPTY : 1;
} }
static inline void static void
hash_netportnet6_data_set_flags(struct hash_netportnet6_elem *elem, u32 flags) hash_netportnet6_data_set_flags(struct hash_netportnet6_elem *elem, u32 flags)
{ {
elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH); elem->nomatch = !!((flags >> 16) & IPSET_FLAG_NOMATCH);
} }
static inline void static void
hash_netportnet6_data_reset_flags(struct hash_netportnet6_elem *elem, u8 *flags) hash_netportnet6_data_reset_flags(struct hash_netportnet6_elem *elem, u8 *flags)
{ {
swap(*flags, elem->nomatch); swap(*flags, elem->nomatch);
} }
static inline void static void
hash_netportnet6_data_reset_elem(struct hash_netportnet6_elem *elem, hash_netportnet6_data_reset_elem(struct hash_netportnet6_elem *elem,
struct hash_netportnet6_elem *orig) struct hash_netportnet6_elem *orig)
{ {
elem->ip[1] = orig->ip[1]; elem->ip[1] = orig->ip[1];
} }
static inline void static void
hash_netportnet6_data_netmask(struct hash_netportnet6_elem *elem, hash_netportnet6_data_netmask(struct hash_netportnet6_elem *elem,
u8 cidr, bool inner) u8 cidr, bool inner)
{ {
...@@ -402,7 +402,7 @@ hash_netportnet6_data_list(struct sk_buff *skb, ...@@ -402,7 +402,7 @@ hash_netportnet6_data_list(struct sk_buff *skb,
return true; return true;
} }
static inline void static void
hash_netportnet6_data_next(struct hash_netportnet6_elem *next, hash_netportnet6_data_next(struct hash_netportnet6_elem *next,
const struct hash_netportnet6_elem *d) const struct hash_netportnet6_elem *d)
{ {
......
...@@ -149,7 +149,7 @@ __list_set_del_rcu(struct rcu_head * rcu) ...@@ -149,7 +149,7 @@ __list_set_del_rcu(struct rcu_head * rcu)
kfree(e); kfree(e);
} }
static inline void static void
list_set_del(struct ip_set *set, struct set_elem *e) list_set_del(struct ip_set *set, struct set_elem *e)
{ {
struct list_set *map = set->data; struct list_set *map = set->data;
...@@ -160,7 +160,7 @@ list_set_del(struct ip_set *set, struct set_elem *e) ...@@ -160,7 +160,7 @@ list_set_del(struct ip_set *set, struct set_elem *e)
call_rcu(&e->rcu, __list_set_del_rcu); call_rcu(&e->rcu, __list_set_del_rcu);
} }
static inline void static void
list_set_replace(struct ip_set *set, struct set_elem *e, struct set_elem *old) list_set_replace(struct ip_set *set, struct set_elem *e, struct set_elem *old)
{ {
struct list_set *map = set->data; struct list_set *map = set->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment