From ed3c453a0787ddc10c5ce6010bd6ac663c740b68 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 20 Jan 2011 23:10:26 +0100 Subject: Un-inline functions which are not small enough --- .../include/linux/netfilter/ipset/ip_set_ahash.h | 14 +++++----- kernel/ip_set_bitmap_ip.c | 2 +- kernel/ip_set_bitmap_ipmac.c | 2 +- kernel/ip_set_bitmap_port.c | 2 +- kernel/ip_set_core.c | 8 +++--- kernel/ip_set_hash_ip.c | 22 +++------------- kernel/ip_set_hash_ipport.c | 28 +++----------------- kernel/ip_set_hash_ipportip.c | 30 +++------------------- kernel/ip_set_hash_ipportnet.c | 30 +++------------------- kernel/ip_set_hash_net.c | 26 +++---------------- kernel/ip_set_hash_netport.c | 29 +++------------------ kernel/ip_set_list_set.c | 10 ++++---- 12 files changed, 42 insertions(+), 161 deletions(-) diff --git a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h index 05855a7..cee22d6 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h @@ -63,7 +63,7 @@ struct ip_set_hash { }; /* Compute htable_bits from the user input parameter hashsize */ -static inline u8 +static u8 htable_bits(u32 hashsize) { /* Assume that hashsize == 2^htable_bits */ @@ -81,7 +81,7 @@ htable_bits(u32 hashsize) /* Network cidr size book keeping when the hash stores different * sized networks */ -static inline void +static void add_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) { u8 i; @@ -103,7 +103,7 @@ add_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) h->nets[i].cidr = cidr; } -static inline void +static void del_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) { u8 i; @@ -142,7 +142,7 @@ ahash_destroy(struct htable *t) } /* Calculate the actual memory size of the set data */ -static inline size_t +static size_t ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 host_mask) { u32 i; @@ -436,7 +436,7 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout) /* Special test function which takes into account the different network * sizes added to the set */ -static inline int +static int type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) { struct ip_set_hash *h = set->data; @@ -881,7 +881,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout) } #ifdef IP_SET_HASH_WITH_NETS -static inline int +static int type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) { struct ip_set_hash *h = set->data; @@ -1017,7 +1017,7 @@ type_pf_gc(unsigned long ul_set) add_timer(&h->gc); } -static inline void +static void type_pf_gc_init(struct ip_set *set) { struct ip_set_hash *h = set->data; diff --git a/kernel/ip_set_bitmap_ip.c b/kernel/ip_set_bitmap_ip.c index 30db991..f491d4e 100644 --- a/kernel/ip_set_bitmap_ip.c +++ b/kernel/ip_set_bitmap_ip.c @@ -549,7 +549,7 @@ bitmap_ip_gc(unsigned long ul_set) add_timer(&map->gc); } -static inline void +static void bitmap_ip_gc_init(struct ip_set *set) { struct bitmap_ip_timeout *map = set->data; diff --git a/kernel/ip_set_bitmap_ipmac.c b/kernel/ip_set_bitmap_ipmac.c index 87870a3..65cd1ea 100644 --- a/kernel/ip_set_bitmap_ipmac.c +++ b/kernel/ip_set_bitmap_ipmac.c @@ -524,7 +524,7 @@ bitmap_ipmac_gc(unsigned long ul_set) add_timer(&map->gc); } -static inline void +static void bitmap_ipmac_gc_init(struct ip_set *set) { struct bitmap_ipmac *map = set->data; diff --git a/kernel/ip_set_bitmap_port.c b/kernel/ip_set_bitmap_port.c index 7e3f473..c5643cd 100644 --- a/kernel/ip_set_bitmap_port.c +++ b/kernel/ip_set_bitmap_port.c @@ -521,7 +521,7 @@ bitmap_port_gc(unsigned long ul_set) add_timer(&map->gc); } -static inline void +static void bitmap_port_gc_init(struct ip_set *set) { struct bitmap_port_timeout *map = set->data; diff --git a/kernel/ip_set_core.c b/kernel/ip_set_core.c index 6e48412..425da11 100644 --- a/kernel/ip_set_core.c +++ b/kernel/ip_set_core.c @@ -60,7 +60,7 @@ ip_set_type_unlock(void) /* Register and deregister settype */ -static inline struct ip_set_type * +static struct ip_set_type * find_set_type(const char *name, u8 family, u8 revision) { struct ip_set_type *type; @@ -717,7 +717,7 @@ ip_set_setname_policy[IPSET_ATTR_CMD_MAX + 1] = { .len = IPSET_MAXNAMELEN - 1 }, }; -static inline void +static void ip_set_destroy_set(ip_set_id_t index) { struct ip_set *set = ip_set_list[index]; @@ -766,7 +766,7 @@ ip_set_destroy(struct sock *ctnl, struct sk_buff *skb, /* Flush sets */ -static inline void +static void ip_set_flush_set(struct ip_set *set) { pr_debug("set: %s", set->name); @@ -929,7 +929,7 @@ dump_attrs(struct nlmsghdr *nlh) } } -static inline int +static int dump_init(struct netlink_callback *cb) { struct nlmsghdr *nlh = nlmsg_hdr(cb->skb); diff --git a/kernel/ip_set_hash_ip.c b/kernel/ip_set_hash_ip.c index 21ace91..448d418 100644 --- a/kernel/ip_set_hash_ip.c +++ b/kernel/ip_set_hash_ip.c @@ -73,12 +73,6 @@ hash_ip4_data_copy(struct hash_ip4_elem *dst, const struct hash_ip4_elem *src) dst->ip = src->ip; } -static inline void -hash_ip4_data_swap(struct hash_ip4_elem *dst, struct hash_ip4_elem *src) -{ - swap(dst->ip, src->ip); -} - /* Zero valued IP addresses cannot be stored */ static inline void hash_ip4_data_zero_out(struct hash_ip4_elem *elem) @@ -96,7 +90,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ip4_data_tlist(struct sk_buff *skb, const struct hash_ip4_elem *data) { const struct hash_ip4_telem *tdata = @@ -256,16 +250,6 @@ hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src) ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); } -static inline void -hash_ip6_data_swap(struct hash_ip6_elem *dst, struct hash_ip6_elem *src) -{ - struct in6_addr tmp; - - ipv6_addr_copy(&tmp, &dst->ip.in6); - ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); - ipv6_addr_copy(&src->ip.in6, &tmp); -} - static inline void hash_ip6_data_zero_out(struct hash_ip6_elem *elem) { @@ -281,7 +265,7 @@ ip6_netmask(union nf_inet_addr *ip, u8 prefix) ip->ip6[3] &= ip_set_netmask6(prefix)[3]; } -static inline bool +static bool hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *data) { NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip); @@ -291,7 +275,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ip6_data_tlist(struct sk_buff *skb, const struct hash_ip6_elem *data) { const struct hash_ip6_telem *e = diff --git a/kernel/ip_set_hash_ipport.c b/kernel/ip_set_hash_ipport.c index 415639d..37e664a 100644 --- a/kernel/ip_set_hash_ipport.c +++ b/kernel/ip_set_hash_ipport.c @@ -85,22 +85,13 @@ hash_ipport4_data_copy(struct hash_ipport4_elem *dst, dst->proto = src->proto; } -static inline void -hash_ipport4_data_swap(struct hash_ipport4_elem *dst, - struct hash_ipport4_elem *src) -{ - swap(dst->ip, src->ip); - swap(dst->port, src->port); - swap(dst->proto, src->proto); -} - static inline void hash_ipport4_data_zero_out(struct hash_ipport4_elem *elem) { elem->proto = 0; } -static inline bool +static bool hash_ipport4_data_list(struct sk_buff *skb, const struct hash_ipport4_elem *data) { @@ -113,7 +104,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipport4_data_tlist(struct sk_buff *skb, const struct hash_ipport4_elem *data) { @@ -320,24 +311,13 @@ hash_ipport6_data_copy(struct hash_ipport6_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_ipport6_data_swap(struct hash_ipport6_elem *dst, - struct hash_ipport6_elem *src) -{ - struct hash_ipport6_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_ipport6_data_zero_out(struct hash_ipport6_elem *elem) { elem->proto = 0; } -static inline bool +static bool hash_ipport6_data_list(struct sk_buff *skb, const struct hash_ipport6_elem *data) { @@ -350,7 +330,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipport6_data_tlist(struct sk_buff *skb, const struct hash_ipport6_elem *data) { diff --git a/kernel/ip_set_hash_ipportip.c b/kernel/ip_set_hash_ipportip.c index 4712c3c..78eeb4a 100644 --- a/kernel/ip_set_hash_ipportip.c +++ b/kernel/ip_set_hash_ipportip.c @@ -86,24 +86,13 @@ hash_ipportip4_data_copy(struct hash_ipportip4_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_ipportip4_data_swap(struct hash_ipportip4_elem *dst, - struct hash_ipportip4_elem *src) -{ - struct hash_ipportip4_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_ipportip4_data_zero_out(struct hash_ipportip4_elem *elem) { elem->proto = 0; } -static inline bool +static bool hash_ipportip4_data_list(struct sk_buff *skb, const struct hash_ipportip4_elem *data) { @@ -117,7 +106,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipportip4_data_tlist(struct sk_buff *skb, const struct hash_ipportip4_elem *data) { @@ -334,24 +323,13 @@ hash_ipportip6_data_copy(struct hash_ipportip6_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_ipportip6_data_swap(struct hash_ipportip6_elem *dst, - struct hash_ipportip6_elem *src) -{ - struct hash_ipportip6_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_ipportip6_data_zero_out(struct hash_ipportip6_elem *elem) { elem->proto = 0; } -static inline bool +static bool hash_ipportip6_data_list(struct sk_buff *skb, const struct hash_ipportip6_elem *data) { @@ -365,7 +343,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipportip6_data_tlist(struct sk_buff *skb, const struct hash_ipportip6_elem *data) { diff --git a/kernel/ip_set_hash_ipportnet.c b/kernel/ip_set_hash_ipportnet.c index b64730c..d4ec935 100644 --- a/kernel/ip_set_hash_ipportnet.c +++ b/kernel/ip_set_hash_ipportnet.c @@ -87,17 +87,6 @@ hash_ipportnet4_data_copy(struct hash_ipportnet4_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_ipportnet4_data_swap(struct hash_ipportnet4_elem *dst, - struct hash_ipportnet4_elem *src) -{ - struct hash_ipportnet4_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr) { @@ -111,7 +100,7 @@ hash_ipportnet4_data_zero_out(struct hash_ipportnet4_elem *elem) elem->proto = 0; } -static inline bool +static bool hash_ipportnet4_data_list(struct sk_buff *skb, const struct hash_ipportnet4_elem *data) { @@ -126,7 +115,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipportnet4_data_tlist(struct sk_buff *skb, const struct hash_ipportnet4_elem *data) { @@ -364,17 +353,6 @@ hash_ipportnet6_data_copy(struct hash_ipportnet6_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_ipportnet6_data_swap(struct hash_ipportnet6_elem *dst, - struct hash_ipportnet6_elem *src) -{ - struct hash_ipportnet6_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_ipportnet6_data_zero_out(struct hash_ipportnet6_elem *elem) { @@ -397,7 +375,7 @@ hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr) elem->cidr = cidr; } -static inline bool +static bool hash_ipportnet6_data_list(struct sk_buff *skb, const struct hash_ipportnet6_elem *data) { @@ -412,7 +390,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_ipportnet6_data_tlist(struct sk_buff *skb, const struct hash_ipportnet6_elem *data) { diff --git a/kernel/ip_set_hash_net.c b/kernel/ip_set_hash_net.c index 175c621..bdaebb4 100644 --- a/kernel/ip_set_hash_net.c +++ b/kernel/ip_set_hash_net.c @@ -80,14 +80,6 @@ hash_net4_data_copy(struct hash_net4_elem *dst, dst->cidr = src->cidr; } -static inline void -hash_net4_data_swap(struct hash_net4_elem *dst, - struct hash_net4_elem *src) -{ - swap(dst->ip, src->ip); - swap(dst->cidr, src->cidr); -} - static inline void hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr) { @@ -102,7 +94,7 @@ hash_net4_data_zero_out(struct hash_net4_elem *elem) elem->cidr = 0; } -static inline bool +static bool hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data) { NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip); @@ -113,7 +105,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_net4_data_tlist(struct sk_buff *skb, const struct hash_net4_elem *data) { const struct hash_net4_telem *tdata = @@ -256,16 +248,6 @@ hash_net6_data_copy(struct hash_net6_elem *dst, dst->cidr = src->cidr; } -static inline void -hash_net6_data_swap(struct hash_net6_elem *dst, struct hash_net6_elem *src) -{ - struct hash_net6_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_net6_data_zero_out(struct hash_net6_elem *elem) { @@ -288,7 +270,7 @@ hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr) elem->cidr = cidr; } -static inline bool +static bool hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data) { NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip); @@ -299,7 +281,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_net6_data_tlist(struct sk_buff *skb, const struct hash_net6_elem *data) { const struct hash_net6_telem *e = diff --git a/kernel/ip_set_hash_netport.c b/kernel/ip_set_hash_netport.c index b0251f3..39080f9 100644 --- a/kernel/ip_set_hash_netport.c +++ b/kernel/ip_set_hash_netport.c @@ -86,16 +86,6 @@ hash_netport4_data_copy(struct hash_netport4_elem *dst, dst->cidr = src->cidr; } -static inline void -hash_netport4_data_swap(struct hash_netport4_elem *dst, - struct hash_netport4_elem *src) -{ - swap(dst->ip, src->ip); - swap(dst->port, src->port); - swap(dst->proto, src->proto); - swap(dst->cidr, src->cidr); -} - static inline void hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr) { @@ -109,7 +99,7 @@ hash_netport4_data_zero_out(struct hash_netport4_elem *elem) elem->proto = 0; } -static inline bool +static bool hash_netport4_data_list(struct sk_buff *skb, const struct hash_netport4_elem *data) { @@ -123,7 +113,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_netport4_data_tlist(struct sk_buff *skb, const struct hash_netport4_elem *data) { @@ -324,17 +314,6 @@ hash_netport6_data_copy(struct hash_netport6_elem *dst, memcpy(dst, src, sizeof(*dst)); } -static inline void -hash_netport6_data_swap(struct hash_netport6_elem *dst, - struct hash_netport6_elem *src) -{ - struct hash_netport6_elem tmp; - - memcpy(&tmp, dst, sizeof(tmp)); - memcpy(dst, src, sizeof(tmp)); - memcpy(src, &tmp, sizeof(tmp)); -} - static inline void hash_netport6_data_zero_out(struct hash_netport6_elem *elem) { @@ -357,7 +336,7 @@ hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr) elem->cidr = cidr; } -static inline bool +static bool hash_netport6_data_list(struct sk_buff *skb, const struct hash_netport6_elem *data) { @@ -371,7 +350,7 @@ nla_put_failure: return 1; } -static inline bool +static bool hash_netport6_data_tlist(struct sk_buff *skb, const struct hash_netport6_elem *data) { diff --git a/kernel/ip_set_list_set.c b/kernel/ip_set_list_set.c index 9cae5d7..892a106 100644 --- a/kernel/ip_set_list_set.c +++ b/kernel/ip_set_list_set.c @@ -121,7 +121,7 @@ static const struct nla_policy list_set_adt_policy[IPSET_ATTR_ADT_MAX+1] = { [IPSET_ATTR_CADT_FLAGS] = { .type = NLA_U32 }, }; -static inline bool +static bool next_id_eq(const struct list_set *map, u32 i, ip_set_id_t id) { const struct set_elem *elem; @@ -136,7 +136,7 @@ next_id_eq(const struct list_set *map, u32 i, ip_set_id_t id) return 0; } -static inline void +static void list_elem_add(struct list_set *map, u32 i, ip_set_id_t id) { struct set_elem *e; @@ -149,7 +149,7 @@ list_elem_add(struct list_set *map, u32 i, ip_set_id_t id) } } -static inline void +static void list_elem_tadd(struct list_set *map, u32 i, ip_set_id_t id, unsigned long timeout) { @@ -487,7 +487,7 @@ list_set_gc(unsigned long ul_set) add_timer(&map->gc); } -static inline void +static void list_set_gc_init(struct ip_set *set) { struct list_set *map = set->data; @@ -507,7 +507,7 @@ list_set_create_policy[IPSET_ATTR_CREATE_MAX+1] = { [IPSET_ATTR_TIMEOUT] = { .type = NLA_U32 }, }; -static inline bool +static bool init_list_set(struct ip_set *set, u32 size, size_t dsize, unsigned long timeout) { -- cgit v1.2.3