diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/gateway_client.c | 10 | ||||
-rw-r--r-- | net/batman-adv/originator.c | 10 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 10 | ||||
-rw-r--r-- | net/core/dev_addr_lists.c | 12 | ||||
-rw-r--r-- | net/core/drop_monitor.c | 12 | ||||
-rw-r--r-- | net/core/gen_estimator.c | 9 | ||||
-rw-r--r-- | net/core/net-sysfs.c | 34 | ||||
-rw-r--r-- | net/core/net_namespace.c | 10 | ||||
-rw-r--r-- | net/decnet/dn_dev.c | 7 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 12 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 7 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 32 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 16 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 8 | ||||
-rw-r--r-- | net/ipv6/sit.c | 7 | ||||
-rw-r--r-- | net/mac80211/agg-tx.c | 14 | ||||
-rw-r--r-- | net/mac80211/work.c | 10 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_extend.c | 8 | ||||
-rw-r--r-- | net/netfilter/xt_osf.c | 11 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 42 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 8 | ||||
-rw-r--r-- | net/phonet/pn_dev.c | 10 | ||||
-rw-r--r-- | net/sched/act_api.c | 7 | ||||
-rw-r--r-- | net/sched/act_police.c | 8 | ||||
-rw-r--r-- | net/sctp/bind_addr.c | 2 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 2 | ||||
-rw-r--r-- | net/sctp/protocol.c | 9 | ||||
-rw-r--r-- | net/socket.c | 11 |
28 files changed, 46 insertions, 292 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 3cc43558cf9c..150b6ce23df3 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -28,18 +28,10 @@ | |||
28 | #include <linux/udp.h> | 28 | #include <linux/udp.h> |
29 | #include <linux/if_vlan.h> | 29 | #include <linux/if_vlan.h> |
30 | 30 | ||
31 | static void gw_node_free_rcu(struct rcu_head *rcu) | ||
32 | { | ||
33 | struct gw_node *gw_node; | ||
34 | |||
35 | gw_node = container_of(rcu, struct gw_node, rcu); | ||
36 | kfree(gw_node); | ||
37 | } | ||
38 | |||
39 | static void gw_node_free_ref(struct gw_node *gw_node) | 31 | static void gw_node_free_ref(struct gw_node *gw_node) |
40 | { | 32 | { |
41 | if (atomic_dec_and_test(&gw_node->refcount)) | 33 | if (atomic_dec_and_test(&gw_node->refcount)) |
42 | call_rcu(&gw_node->rcu, gw_node_free_rcu); | 34 | kfree_rcu(gw_node, rcu); |
43 | } | 35 | } |
44 | 36 | ||
45 | void *gw_get_selected(struct bat_priv *bat_priv) | 37 | void *gw_get_selected(struct bat_priv *bat_priv) |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 0b9133022d2d..ed23a5895d6c 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -56,18 +56,10 @@ err: | |||
56 | return 0; | 56 | return 0; |
57 | } | 57 | } |
58 | 58 | ||
59 | static void neigh_node_free_rcu(struct rcu_head *rcu) | ||
60 | { | ||
61 | struct neigh_node *neigh_node; | ||
62 | |||
63 | neigh_node = container_of(rcu, struct neigh_node, rcu); | ||
64 | kfree(neigh_node); | ||
65 | } | ||
66 | |||
67 | void neigh_node_free_ref(struct neigh_node *neigh_node) | 59 | void neigh_node_free_ref(struct neigh_node *neigh_node) |
68 | { | 60 | { |
69 | if (atomic_dec_and_test(&neigh_node->refcount)) | 61 | if (atomic_dec_and_test(&neigh_node->refcount)) |
70 | call_rcu(&neigh_node->rcu, neigh_node_free_rcu); | 62 | kfree_rcu(neigh_node, rcu); |
71 | } | 63 | } |
72 | 64 | ||
73 | struct neigh_node *create_neighbor(struct orig_node *orig_node, | 65 | struct neigh_node *create_neighbor(struct orig_node *orig_node, |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 824e1f6e50f2..04efe022c13b 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -76,18 +76,10 @@ int my_skb_head_push(struct sk_buff *skb, unsigned int len) | |||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | static void softif_neigh_free_rcu(struct rcu_head *rcu) | ||
80 | { | ||
81 | struct softif_neigh *softif_neigh; | ||
82 | |||
83 | softif_neigh = container_of(rcu, struct softif_neigh, rcu); | ||
84 | kfree(softif_neigh); | ||
85 | } | ||
86 | |||
87 | static void softif_neigh_free_ref(struct softif_neigh *softif_neigh) | 79 | static void softif_neigh_free_ref(struct softif_neigh *softif_neigh) |
88 | { | 80 | { |
89 | if (atomic_dec_and_test(&softif_neigh->refcount)) | 81 | if (atomic_dec_and_test(&softif_neigh->refcount)) |
90 | call_rcu(&softif_neigh->rcu, softif_neigh_free_rcu); | 82 | kfree_rcu(softif_neigh, rcu); |
91 | } | 83 | } |
92 | 84 | ||
93 | void softif_neigh_purge(struct bat_priv *bat_priv) | 85 | void softif_neigh_purge(struct bat_priv *bat_priv) |
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index 7b39f3ed2fda..e2e66939ed00 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
@@ -68,14 +68,6 @@ static int __hw_addr_add(struct netdev_hw_addr_list *list, unsigned char *addr, | |||
68 | return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); | 68 | return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); |
69 | } | 69 | } |
70 | 70 | ||
71 | static void ha_rcu_free(struct rcu_head *head) | ||
72 | { | ||
73 | struct netdev_hw_addr *ha; | ||
74 | |||
75 | ha = container_of(head, struct netdev_hw_addr, rcu_head); | ||
76 | kfree(ha); | ||
77 | } | ||
78 | |||
79 | static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, | 71 | static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, |
80 | unsigned char *addr, int addr_len, | 72 | unsigned char *addr, int addr_len, |
81 | unsigned char addr_type, bool global) | 73 | unsigned char addr_type, bool global) |
@@ -94,7 +86,7 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, | |||
94 | if (--ha->refcount) | 86 | if (--ha->refcount) |
95 | return 0; | 87 | return 0; |
96 | list_del_rcu(&ha->list); | 88 | list_del_rcu(&ha->list); |
97 | call_rcu(&ha->rcu_head, ha_rcu_free); | 89 | kfree_rcu(ha, rcu_head); |
98 | list->count--; | 90 | list->count--; |
99 | return 0; | 91 | return 0; |
100 | } | 92 | } |
@@ -197,7 +189,7 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list) | |||
197 | 189 | ||
198 | list_for_each_entry_safe(ha, tmp, &list->list, list) { | 190 | list_for_each_entry_safe(ha, tmp, &list->list, list) { |
199 | list_del_rcu(&ha->list); | 191 | list_del_rcu(&ha->list); |
200 | call_rcu(&ha->rcu_head, ha_rcu_free); | 192 | kfree_rcu(ha, rcu_head); |
201 | } | 193 | } |
202 | list->count = 0; | 194 | list->count = 0; |
203 | } | 195 | } |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 706502ff64aa..7f36b38e060f 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
@@ -207,14 +207,6 @@ static void trace_napi_poll_hit(void *ignore, struct napi_struct *napi) | |||
207 | rcu_read_unlock(); | 207 | rcu_read_unlock(); |
208 | } | 208 | } |
209 | 209 | ||
210 | |||
211 | static void free_dm_hw_stat(struct rcu_head *head) | ||
212 | { | ||
213 | struct dm_hw_stat_delta *n; | ||
214 | n = container_of(head, struct dm_hw_stat_delta, rcu); | ||
215 | kfree(n); | ||
216 | } | ||
217 | |||
218 | static int set_all_monitor_traces(int state) | 210 | static int set_all_monitor_traces(int state) |
219 | { | 211 | { |
220 | int rc = 0; | 212 | int rc = 0; |
@@ -245,7 +237,7 @@ static int set_all_monitor_traces(int state) | |||
245 | list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) { | 237 | list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) { |
246 | if (new_stat->dev == NULL) { | 238 | if (new_stat->dev == NULL) { |
247 | list_del_rcu(&new_stat->list); | 239 | list_del_rcu(&new_stat->list); |
248 | call_rcu(&new_stat->rcu, free_dm_hw_stat); | 240 | kfree_rcu(new_stat, rcu); |
249 | } | 241 | } |
250 | } | 242 | } |
251 | break; | 243 | break; |
@@ -314,7 +306,7 @@ static int dropmon_net_event(struct notifier_block *ev_block, | |||
314 | new_stat->dev = NULL; | 306 | new_stat->dev = NULL; |
315 | if (trace_state == TRACE_OFF) { | 307 | if (trace_state == TRACE_OFF) { |
316 | list_del_rcu(&new_stat->list); | 308 | list_del_rcu(&new_stat->list); |
317 | call_rcu(&new_stat->rcu, free_dm_hw_stat); | 309 | kfree_rcu(new_stat, rcu); |
318 | break; | 310 | break; |
319 | } | 311 | } |
320 | } | 312 | } |
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 7c2373321b74..43b03dd71e85 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c | |||
@@ -249,13 +249,6 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, | |||
249 | } | 249 | } |
250 | EXPORT_SYMBOL(gen_new_estimator); | 250 | EXPORT_SYMBOL(gen_new_estimator); |
251 | 251 | ||
252 | static void __gen_kill_estimator(struct rcu_head *head) | ||
253 | { | ||
254 | struct gen_estimator *e = container_of(head, | ||
255 | struct gen_estimator, e_rcu); | ||
256 | kfree(e); | ||
257 | } | ||
258 | |||
259 | /** | 252 | /** |
260 | * gen_kill_estimator - remove a rate estimator | 253 | * gen_kill_estimator - remove a rate estimator |
261 | * @bstats: basic statistics | 254 | * @bstats: basic statistics |
@@ -279,7 +272,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, | |||
279 | write_unlock(&est_lock); | 272 | write_unlock(&est_lock); |
280 | 273 | ||
281 | list_del_rcu(&e->list); | 274 | list_del_rcu(&e->list); |
282 | call_rcu(&e->e_rcu, __gen_kill_estimator); | 275 | kfree_rcu(e, e_rcu); |
283 | } | 276 | } |
284 | spin_unlock_bh(&est_tree_lock); | 277 | spin_unlock_bh(&est_tree_lock); |
285 | } | 278 | } |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 5ceb257e860c..80b2aad3b73d 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -565,13 +565,6 @@ static ssize_t show_rps_map(struct netdev_rx_queue *queue, | |||
565 | return len; | 565 | return len; |
566 | } | 566 | } |
567 | 567 | ||
568 | static void rps_map_release(struct rcu_head *rcu) | ||
569 | { | ||
570 | struct rps_map *map = container_of(rcu, struct rps_map, rcu); | ||
571 | |||
572 | kfree(map); | ||
573 | } | ||
574 | |||
575 | static ssize_t store_rps_map(struct netdev_rx_queue *queue, | 568 | static ssize_t store_rps_map(struct netdev_rx_queue *queue, |
576 | struct rx_queue_attribute *attribute, | 569 | struct rx_queue_attribute *attribute, |
577 | const char *buf, size_t len) | 570 | const char *buf, size_t len) |
@@ -619,7 +612,7 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue, | |||
619 | spin_unlock(&rps_map_lock); | 612 | spin_unlock(&rps_map_lock); |
620 | 613 | ||
621 | if (old_map) | 614 | if (old_map) |
622 | call_rcu(&old_map->rcu, rps_map_release); | 615 | kfree_rcu(old_map, rcu); |
623 | 616 | ||
624 | free_cpumask_var(mask); | 617 | free_cpumask_var(mask); |
625 | return len; | 618 | return len; |
@@ -728,7 +721,7 @@ static void rx_queue_release(struct kobject *kobj) | |||
728 | map = rcu_dereference_raw(queue->rps_map); | 721 | map = rcu_dereference_raw(queue->rps_map); |
729 | if (map) { | 722 | if (map) { |
730 | RCU_INIT_POINTER(queue->rps_map, NULL); | 723 | RCU_INIT_POINTER(queue->rps_map, NULL); |
731 | call_rcu(&map->rcu, rps_map_release); | 724 | kfree_rcu(map, rcu); |
732 | } | 725 | } |
733 | 726 | ||
734 | flow_table = rcu_dereference_raw(queue->rps_flow_table); | 727 | flow_table = rcu_dereference_raw(queue->rps_flow_table); |
@@ -898,21 +891,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue, | |||
898 | return len; | 891 | return len; |
899 | } | 892 | } |
900 | 893 | ||
901 | static void xps_map_release(struct rcu_head *rcu) | ||
902 | { | ||
903 | struct xps_map *map = container_of(rcu, struct xps_map, rcu); | ||
904 | |||
905 | kfree(map); | ||
906 | } | ||
907 | |||
908 | static void xps_dev_maps_release(struct rcu_head *rcu) | ||
909 | { | ||
910 | struct xps_dev_maps *dev_maps = | ||
911 | container_of(rcu, struct xps_dev_maps, rcu); | ||
912 | |||
913 | kfree(dev_maps); | ||
914 | } | ||
915 | |||
916 | static DEFINE_MUTEX(xps_map_mutex); | 894 | static DEFINE_MUTEX(xps_map_mutex); |
917 | #define xmap_dereference(P) \ | 895 | #define xmap_dereference(P) \ |
918 | rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) | 896 | rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) |
@@ -1009,7 +987,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue, | |||
1009 | map = dev_maps ? | 987 | map = dev_maps ? |
1010 | xmap_dereference(dev_maps->cpu_map[cpu]) : NULL; | 988 | xmap_dereference(dev_maps->cpu_map[cpu]) : NULL; |
1011 | if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map) | 989 | if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map) |
1012 | call_rcu(&map->rcu, xps_map_release); | 990 | kfree_rcu(map, rcu); |
1013 | if (new_dev_maps->cpu_map[cpu]) | 991 | if (new_dev_maps->cpu_map[cpu]) |
1014 | nonempty = 1; | 992 | nonempty = 1; |
1015 | } | 993 | } |
@@ -1022,7 +1000,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue, | |||
1022 | } | 1000 | } |
1023 | 1001 | ||
1024 | if (dev_maps) | 1002 | if (dev_maps) |
1025 | call_rcu(&dev_maps->rcu, xps_dev_maps_release); | 1003 | kfree_rcu(dev_maps, rcu); |
1026 | 1004 | ||
1027 | netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : | 1005 | netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : |
1028 | NUMA_NO_NODE); | 1006 | NUMA_NO_NODE); |
@@ -1084,7 +1062,7 @@ static void netdev_queue_release(struct kobject *kobj) | |||
1084 | else { | 1062 | else { |
1085 | RCU_INIT_POINTER(dev_maps->cpu_map[i], | 1063 | RCU_INIT_POINTER(dev_maps->cpu_map[i], |
1086 | NULL); | 1064 | NULL); |
1087 | call_rcu(&map->rcu, xps_map_release); | 1065 | kfree_rcu(map, rcu); |
1088 | map = NULL; | 1066 | map = NULL; |
1089 | } | 1067 | } |
1090 | } | 1068 | } |
@@ -1094,7 +1072,7 @@ static void netdev_queue_release(struct kobject *kobj) | |||
1094 | 1072 | ||
1095 | if (!nonempty) { | 1073 | if (!nonempty) { |
1096 | RCU_INIT_POINTER(dev->xps_maps, NULL); | 1074 | RCU_INIT_POINTER(dev->xps_maps, NULL); |
1097 | call_rcu(&dev_maps->rcu, xps_dev_maps_release); | 1075 | kfree_rcu(dev_maps, rcu); |
1098 | } | 1076 | } |
1099 | } | 1077 | } |
1100 | 1078 | ||
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 3f860261c5ee..297bb9272240 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -27,14 +27,6 @@ EXPORT_SYMBOL(init_net); | |||
27 | 27 | ||
28 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ | 28 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ |
29 | 29 | ||
30 | static void net_generic_release(struct rcu_head *rcu) | ||
31 | { | ||
32 | struct net_generic *ng; | ||
33 | |||
34 | ng = container_of(rcu, struct net_generic, rcu); | ||
35 | kfree(ng); | ||
36 | } | ||
37 | |||
38 | static int net_assign_generic(struct net *net, int id, void *data) | 30 | static int net_assign_generic(struct net *net, int id, void *data) |
39 | { | 31 | { |
40 | struct net_generic *ng, *old_ng; | 32 | struct net_generic *ng, *old_ng; |
@@ -68,7 +60,7 @@ static int net_assign_generic(struct net *net, int id, void *data) | |||
68 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); | 60 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); |
69 | 61 | ||
70 | rcu_assign_pointer(net->gen, ng); | 62 | rcu_assign_pointer(net->gen, ng); |
71 | call_rcu(&old_ng->rcu, net_generic_release); | 63 | kfree_rcu(old_ng, rcu); |
72 | assign: | 64 | assign: |
73 | ng->ptr[id - 1] = data; | 65 | ng->ptr[id - 1] = data; |
74 | return 0; | 66 | return 0; |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 0dcaa903e00e..4c27615340dc 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -332,14 +332,9 @@ static struct dn_ifaddr *dn_dev_alloc_ifa(void) | |||
332 | return ifa; | 332 | return ifa; |
333 | } | 333 | } |
334 | 334 | ||
335 | static void dn_dev_free_ifa_rcu(struct rcu_head *head) | ||
336 | { | ||
337 | kfree(container_of(head, struct dn_ifaddr, rcu)); | ||
338 | } | ||
339 | |||
340 | static void dn_dev_free_ifa(struct dn_ifaddr *ifa) | 335 | static void dn_dev_free_ifa(struct dn_ifaddr *ifa) |
341 | { | 336 | { |
342 | call_rcu(&ifa->rcu, dn_dev_free_ifa_rcu); | 337 | kfree_rcu(ifa, rcu); |
343 | } | 338 | } |
344 | 339 | ||
345 | static void dn_dev_del_ifa(struct dn_dev *dn_db, struct dn_ifaddr __rcu **ifap, int destroy) | 340 | static void dn_dev_del_ifa(struct dn_dev *dn_db, struct dn_ifaddr __rcu **ifap, int destroy) |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 641a5a2a9f9c..33e2c35b74b7 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -141,18 +141,8 @@ const struct fib_prop fib_props[RTN_MAX + 1] = { | |||
141 | }, | 141 | }, |
142 | }; | 142 | }; |
143 | 143 | ||
144 | |||
145 | /* Release a nexthop info record */ | 144 | /* Release a nexthop info record */ |
146 | 145 | ||
147 | static void free_fib_info_rcu(struct rcu_head *head) | ||
148 | { | ||
149 | struct fib_info *fi = container_of(head, struct fib_info, rcu); | ||
150 | |||
151 | if (fi->fib_metrics != (u32 *) dst_default_metrics) | ||
152 | kfree(fi->fib_metrics); | ||
153 | kfree(fi); | ||
154 | } | ||
155 | |||
156 | void free_fib_info(struct fib_info *fi) | 146 | void free_fib_info(struct fib_info *fi) |
157 | { | 147 | { |
158 | if (fi->fib_dead == 0) { | 148 | if (fi->fib_dead == 0) { |
@@ -166,7 +156,7 @@ void free_fib_info(struct fib_info *fi) | |||
166 | } endfor_nexthops(fi); | 156 | } endfor_nexthops(fi); |
167 | fib_info_cnt--; | 157 | fib_info_cnt--; |
168 | release_net(fi->fib_net); | 158 | release_net(fi->fib_net); |
169 | call_rcu(&fi->rcu, free_fib_info_rcu); | 159 | kfree_rcu(fi, rcu); |
170 | } | 160 | } |
171 | 161 | ||
172 | void fib_release_info(struct fib_info *fi) | 162 | void fib_release_info(struct fib_info *fi) |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 5fe9b8b41df3..11d4d28190bd 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -350,14 +350,9 @@ static inline void free_leaf(struct leaf *l) | |||
350 | call_rcu_bh(&l->rcu, __leaf_free_rcu); | 350 | call_rcu_bh(&l->rcu, __leaf_free_rcu); |
351 | } | 351 | } |
352 | 352 | ||
353 | static void __leaf_info_free_rcu(struct rcu_head *head) | ||
354 | { | ||
355 | kfree(container_of(head, struct leaf_info, rcu)); | ||
356 | } | ||
357 | |||
358 | static inline void free_leaf_info(struct leaf_info *leaf) | 353 | static inline void free_leaf_info(struct leaf_info *leaf) |
359 | { | 354 | { |
360 | call_rcu(&leaf->rcu, __leaf_info_free_rcu); | 355 | kfree_rcu(leaf, rcu); |
361 | } | 356 | } |
362 | 357 | ||
363 | static struct tnode *tnode_alloc(size_t size) | 358 | static struct tnode *tnode_alloc(size_t size) |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 1fd3d9ce8398..8f62d66d0857 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -149,17 +149,11 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc); | |||
149 | static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, | 149 | static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, |
150 | int sfcount, __be32 *psfsrc, int delta); | 150 | int sfcount, __be32 *psfsrc, int delta); |
151 | 151 | ||
152 | |||
153 | static void ip_mc_list_reclaim(struct rcu_head *head) | ||
154 | { | ||
155 | kfree(container_of(head, struct ip_mc_list, rcu)); | ||
156 | } | ||
157 | |||
158 | static void ip_ma_put(struct ip_mc_list *im) | 152 | static void ip_ma_put(struct ip_mc_list *im) |
159 | { | 153 | { |
160 | if (atomic_dec_and_test(&im->refcnt)) { | 154 | if (atomic_dec_and_test(&im->refcnt)) { |
161 | in_dev_put(im->interface); | 155 | in_dev_put(im->interface); |
162 | call_rcu(&im->rcu, ip_mc_list_reclaim); | 156 | kfree_rcu(im, rcu); |
163 | } | 157 | } |
164 | } | 158 | } |
165 | 159 | ||
@@ -1836,12 +1830,6 @@ done: | |||
1836 | } | 1830 | } |
1837 | EXPORT_SYMBOL(ip_mc_join_group); | 1831 | EXPORT_SYMBOL(ip_mc_join_group); |
1838 | 1832 | ||
1839 | static void ip_sf_socklist_reclaim(struct rcu_head *rp) | ||
1840 | { | ||
1841 | kfree(container_of(rp, struct ip_sf_socklist, rcu)); | ||
1842 | /* sk_omem_alloc should have been decreased by the caller*/ | ||
1843 | } | ||
1844 | |||
1845 | static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, | 1833 | static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, |
1846 | struct in_device *in_dev) | 1834 | struct in_device *in_dev) |
1847 | { | 1835 | { |
@@ -1858,18 +1846,10 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, | |||
1858 | rcu_assign_pointer(iml->sflist, NULL); | 1846 | rcu_assign_pointer(iml->sflist, NULL); |
1859 | /* decrease mem now to avoid the memleak warning */ | 1847 | /* decrease mem now to avoid the memleak warning */ |
1860 | atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc); | 1848 | atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc); |
1861 | call_rcu(&psf->rcu, ip_sf_socklist_reclaim); | 1849 | kfree_rcu(psf, rcu); |
1862 | return err; | 1850 | return err; |
1863 | } | 1851 | } |
1864 | 1852 | ||
1865 | |||
1866 | static void ip_mc_socklist_reclaim(struct rcu_head *rp) | ||
1867 | { | ||
1868 | kfree(container_of(rp, struct ip_mc_socklist, rcu)); | ||
1869 | /* sk_omem_alloc should have been decreased by the caller*/ | ||
1870 | } | ||
1871 | |||
1872 | |||
1873 | /* | 1853 | /* |
1874 | * Ask a socket to leave a group. | 1854 | * Ask a socket to leave a group. |
1875 | */ | 1855 | */ |
@@ -1909,7 +1889,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) | |||
1909 | rtnl_unlock(); | 1889 | rtnl_unlock(); |
1910 | /* decrease mem now to avoid the memleak warning */ | 1890 | /* decrease mem now to avoid the memleak warning */ |
1911 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); | 1891 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); |
1912 | call_rcu(&iml->rcu, ip_mc_socklist_reclaim); | 1892 | kfree_rcu(iml, rcu); |
1913 | return 0; | 1893 | return 0; |
1914 | } | 1894 | } |
1915 | if (!in_dev) | 1895 | if (!in_dev) |
@@ -2026,7 +2006,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct | |||
2026 | newpsl->sl_addr[i] = psl->sl_addr[i]; | 2006 | newpsl->sl_addr[i] = psl->sl_addr[i]; |
2027 | /* decrease mem now to avoid the memleak warning */ | 2007 | /* decrease mem now to avoid the memleak warning */ |
2028 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); | 2008 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); |
2029 | call_rcu(&psl->rcu, ip_sf_socklist_reclaim); | 2009 | kfree_rcu(psl, rcu); |
2030 | } | 2010 | } |
2031 | rcu_assign_pointer(pmc->sflist, newpsl); | 2011 | rcu_assign_pointer(pmc->sflist, newpsl); |
2032 | psl = newpsl; | 2012 | psl = newpsl; |
@@ -2127,7 +2107,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
2127 | psl->sl_count, psl->sl_addr, 0); | 2107 | psl->sl_count, psl->sl_addr, 0); |
2128 | /* decrease mem now to avoid the memleak warning */ | 2108 | /* decrease mem now to avoid the memleak warning */ |
2129 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); | 2109 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); |
2130 | call_rcu(&psl->rcu, ip_sf_socklist_reclaim); | 2110 | kfree_rcu(psl, rcu); |
2131 | } else | 2111 | } else |
2132 | (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, | 2112 | (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, |
2133 | 0, NULL, 0); | 2113 | 0, NULL, 0); |
@@ -2324,7 +2304,7 @@ void ip_mc_drop_socket(struct sock *sk) | |||
2324 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); | 2304 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); |
2325 | /* decrease mem now to avoid the memleak warning */ | 2305 | /* decrease mem now to avoid the memleak warning */ |
2326 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); | 2306 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); |
2327 | call_rcu(&iml->rcu, ip_mc_socklist_reclaim); | 2307 | kfree_rcu(iml, rcu); |
2328 | } | 2308 | } |
2329 | rtnl_unlock(); | 2309 | rtnl_unlock(); |
2330 | } | 2310 | } |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a7bda0757053..8f13d88d7dba 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -317,12 +317,6 @@ static void snmp6_free_dev(struct inet6_dev *idev) | |||
317 | 317 | ||
318 | /* Nobody refers to this device, we may destroy it. */ | 318 | /* Nobody refers to this device, we may destroy it. */ |
319 | 319 | ||
320 | static void in6_dev_finish_destroy_rcu(struct rcu_head *head) | ||
321 | { | ||
322 | struct inet6_dev *idev = container_of(head, struct inet6_dev, rcu); | ||
323 | kfree(idev); | ||
324 | } | ||
325 | |||
326 | void in6_dev_finish_destroy(struct inet6_dev *idev) | 320 | void in6_dev_finish_destroy(struct inet6_dev *idev) |
327 | { | 321 | { |
328 | struct net_device *dev = idev->dev; | 322 | struct net_device *dev = idev->dev; |
@@ -339,7 +333,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev) | |||
339 | return; | 333 | return; |
340 | } | 334 | } |
341 | snmp6_free_dev(idev); | 335 | snmp6_free_dev(idev); |
342 | call_rcu(&idev->rcu, in6_dev_finish_destroy_rcu); | 336 | kfree_rcu(idev, rcu); |
343 | } | 337 | } |
344 | 338 | ||
345 | EXPORT_SYMBOL(in6_dev_finish_destroy); | 339 | EXPORT_SYMBOL(in6_dev_finish_destroy); |
@@ -535,12 +529,6 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) | |||
535 | } | 529 | } |
536 | #endif | 530 | #endif |
537 | 531 | ||
538 | static void inet6_ifa_finish_destroy_rcu(struct rcu_head *head) | ||
539 | { | ||
540 | struct inet6_ifaddr *ifp = container_of(head, struct inet6_ifaddr, rcu); | ||
541 | kfree(ifp); | ||
542 | } | ||
543 | |||
544 | /* Nobody refers to this ifaddr, destroy it */ | 532 | /* Nobody refers to this ifaddr, destroy it */ |
545 | void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) | 533 | void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) |
546 | { | 534 | { |
@@ -561,7 +549,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) | |||
561 | } | 549 | } |
562 | dst_release(&ifp->rt->dst); | 550 | dst_release(&ifp->rt->dst); |
563 | 551 | ||
564 | call_rcu(&ifp->rcu, inet6_ifa_finish_destroy_rcu); | 552 | kfree_rcu(ifp, rcu); |
565 | } | 553 | } |
566 | 554 | ||
567 | static void | 555 | static void |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 76b893771e6e..f2d98ca7588a 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -201,10 +201,6 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr) | |||
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
203 | 203 | ||
204 | static void ipv6_mc_socklist_reclaim(struct rcu_head *head) | ||
205 | { | ||
206 | kfree(container_of(head, struct ipv6_mc_socklist, rcu)); | ||
207 | } | ||
208 | /* | 204 | /* |
209 | * socket leave on multicast group | 205 | * socket leave on multicast group |
210 | */ | 206 | */ |
@@ -239,7 +235,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr) | |||
239 | (void) ip6_mc_leave_src(sk, mc_lst, NULL); | 235 | (void) ip6_mc_leave_src(sk, mc_lst, NULL); |
240 | rcu_read_unlock(); | 236 | rcu_read_unlock(); |
241 | atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); | 237 | atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); |
242 | call_rcu(&mc_lst->rcu, ipv6_mc_socklist_reclaim); | 238 | kfree_rcu(mc_lst, rcu); |
243 | return 0; | 239 | return 0; |
244 | } | 240 | } |
245 | } | 241 | } |
@@ -307,7 +303,7 @@ void ipv6_sock_mc_close(struct sock *sk) | |||
307 | rcu_read_unlock(); | 303 | rcu_read_unlock(); |
308 | 304 | ||
309 | atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); | 305 | atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); |
310 | call_rcu(&mc_lst->rcu, ipv6_mc_socklist_reclaim); | 306 | kfree_rcu(mc_lst, rcu); |
311 | 307 | ||
312 | spin_lock(&ipv6_sk_mc_lock); | 308 | spin_lock(&ipv6_sk_mc_lock); |
313 | } | 309 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 43b33373adb2..5f35d595e4a5 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -401,11 +401,6 @@ out: | |||
401 | return err; | 401 | return err; |
402 | } | 402 | } |
403 | 403 | ||
404 | static void prl_entry_destroy_rcu(struct rcu_head *head) | ||
405 | { | ||
406 | kfree(container_of(head, struct ip_tunnel_prl_entry, rcu_head)); | ||
407 | } | ||
408 | |||
409 | static void prl_list_destroy_rcu(struct rcu_head *head) | 404 | static void prl_list_destroy_rcu(struct rcu_head *head) |
410 | { | 405 | { |
411 | struct ip_tunnel_prl_entry *p, *n; | 406 | struct ip_tunnel_prl_entry *p, *n; |
@@ -433,7 +428,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) | |||
433 | p = &x->next) { | 428 | p = &x->next) { |
434 | if (x->addr == a->addr) { | 429 | if (x->addr == a->addr) { |
435 | *p = x->next; | 430 | *p = x->next; |
436 | call_rcu(&x->rcu_head, prl_entry_destroy_rcu); | 431 | kfree_rcu(x, rcu_head); |
437 | t->prl_count--; | 432 | t->prl_count--; |
438 | goto out; | 433 | goto out; |
439 | } | 434 | } |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 63d852cb4ca2..53defafb9aae 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -136,14 +136,6 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1 | |||
136 | ieee80211_tx_skb(sdata, skb); | 136 | ieee80211_tx_skb(sdata, skb); |
137 | } | 137 | } |
138 | 138 | ||
139 | static void kfree_tid_tx(struct rcu_head *rcu_head) | ||
140 | { | ||
141 | struct tid_ampdu_tx *tid_tx = | ||
142 | container_of(rcu_head, struct tid_ampdu_tx, rcu_head); | ||
143 | |||
144 | kfree(tid_tx); | ||
145 | } | ||
146 | |||
147 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 139 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
148 | enum ieee80211_back_parties initiator, | 140 | enum ieee80211_back_parties initiator, |
149 | bool tx) | 141 | bool tx) |
@@ -163,7 +155,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
163 | /* not even started yet! */ | 155 | /* not even started yet! */ |
164 | rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], NULL); | 156 | rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], NULL); |
165 | spin_unlock_bh(&sta->lock); | 157 | spin_unlock_bh(&sta->lock); |
166 | call_rcu(&tid_tx->rcu_head, kfree_tid_tx); | 158 | kfree_rcu(tid_tx, rcu_head); |
167 | return 0; | 159 | return 0; |
168 | } | 160 | } |
169 | 161 | ||
@@ -322,7 +314,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | |||
322 | spin_unlock_bh(&sta->lock); | 314 | spin_unlock_bh(&sta->lock); |
323 | 315 | ||
324 | ieee80211_wake_queue_agg(local, tid); | 316 | ieee80211_wake_queue_agg(local, tid); |
325 | call_rcu(&tid_tx->rcu_head, kfree_tid_tx); | 317 | kfree_rcu(tid_tx, rcu_head); |
326 | return; | 318 | return; |
327 | } | 319 | } |
328 | 320 | ||
@@ -701,7 +693,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
701 | 693 | ||
702 | ieee80211_agg_splice_finish(local, tid); | 694 | ieee80211_agg_splice_finish(local, tid); |
703 | 695 | ||
704 | call_rcu(&tid_tx->rcu_head, kfree_tid_tx); | 696 | kfree_rcu(tid_tx, rcu_head); |
705 | 697 | ||
706 | unlock_sta: | 698 | unlock_sta: |
707 | spin_unlock_bh(&sta->lock); | 699 | spin_unlock_bh(&sta->lock); |
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index e73c8cae036b..ac3549690b8e 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -65,17 +65,9 @@ static void run_again(struct ieee80211_local *local, | |||
65 | mod_timer(&local->work_timer, timeout); | 65 | mod_timer(&local->work_timer, timeout); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void work_free_rcu(struct rcu_head *head) | ||
69 | { | ||
70 | struct ieee80211_work *wk = | ||
71 | container_of(head, struct ieee80211_work, rcu_head); | ||
72 | |||
73 | kfree(wk); | ||
74 | } | ||
75 | |||
76 | void free_work(struct ieee80211_work *wk) | 68 | void free_work(struct ieee80211_work *wk) |
77 | { | 69 | { |
78 | call_rcu(&wk->rcu_head, work_free_rcu); | 70 | kfree_rcu(wk, rcu_head); |
79 | } | 71 | } |
80 | 72 | ||
81 | static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len, | 73 | static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len, |
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 80a23ed62bb0..05ecdc281a53 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c | |||
@@ -68,12 +68,6 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp) | |||
68 | return (void *)(*ext) + off; | 68 | return (void *)(*ext) + off; |
69 | } | 69 | } |
70 | 70 | ||
71 | static void __nf_ct_ext_free_rcu(struct rcu_head *head) | ||
72 | { | ||
73 | struct nf_ct_ext *ext = container_of(head, struct nf_ct_ext, rcu); | ||
74 | kfree(ext); | ||
75 | } | ||
76 | |||
77 | void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) | 71 | void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) |
78 | { | 72 | { |
79 | struct nf_ct_ext *old, *new; | 73 | struct nf_ct_ext *old, *new; |
@@ -114,7 +108,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) | |||
114 | (void *)old + old->offset[i]); | 108 | (void *)old + old->offset[i]); |
115 | rcu_read_unlock(); | 109 | rcu_read_unlock(); |
116 | } | 110 | } |
117 | call_rcu(&old->rcu, __nf_ct_ext_free_rcu); | 111 | kfree_rcu(old, rcu); |
118 | ct->ext = new; | 112 | ct->ext = new; |
119 | } | 113 | } |
120 | 114 | ||
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c index 4327e101c047..846f895cb656 100644 --- a/net/netfilter/xt_osf.c +++ b/net/netfilter/xt_osf.c | |||
@@ -62,13 +62,6 @@ static const struct nla_policy xt_osf_policy[OSF_ATTR_MAX + 1] = { | |||
62 | [OSF_ATTR_FINGER] = { .len = sizeof(struct xt_osf_user_finger) }, | 62 | [OSF_ATTR_FINGER] = { .len = sizeof(struct xt_osf_user_finger) }, |
63 | }; | 63 | }; |
64 | 64 | ||
65 | static void xt_osf_finger_free_rcu(struct rcu_head *rcu_head) | ||
66 | { | ||
67 | struct xt_osf_finger *f = container_of(rcu_head, struct xt_osf_finger, rcu_head); | ||
68 | |||
69 | kfree(f); | ||
70 | } | ||
71 | |||
72 | static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb, | 65 | static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb, |
73 | const struct nlmsghdr *nlh, | 66 | const struct nlmsghdr *nlh, |
74 | const struct nlattr * const osf_attrs[]) | 67 | const struct nlattr * const osf_attrs[]) |
@@ -133,7 +126,7 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb, | |||
133 | * We are protected by nfnl mutex. | 126 | * We are protected by nfnl mutex. |
134 | */ | 127 | */ |
135 | list_del_rcu(&sf->finger_entry); | 128 | list_del_rcu(&sf->finger_entry); |
136 | call_rcu(&sf->rcu_head, xt_osf_finger_free_rcu); | 129 | kfree_rcu(sf, rcu_head); |
137 | 130 | ||
138 | err = 0; | 131 | err = 0; |
139 | break; | 132 | break; |
@@ -414,7 +407,7 @@ static void __exit xt_osf_fini(void) | |||
414 | 407 | ||
415 | list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) { | 408 | list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) { |
416 | list_del_rcu(&f->finger_entry); | 409 | list_del_rcu(&f->finger_entry); |
417 | call_rcu(&f->rcu_head, xt_osf_finger_free_rcu); | 410 | kfree_rcu(f, rcu_head); |
418 | } | 411 | } |
419 | } | 412 | } |
420 | rcu_read_unlock(); | 413 | rcu_read_unlock(); |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index e2b0a680dd56..9c38658fba8b 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -154,44 +154,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1 | |||
154 | */ | 154 | */ |
155 | 155 | ||
156 | /** | 156 | /** |
157 | * netlbl_unlhsh_free_addr4 - Frees an IPv4 address entry from the hash table | ||
158 | * @entry: the entry's RCU field | ||
159 | * | ||
160 | * Description: | ||
161 | * This function is designed to be used as a callback to the call_rcu() | ||
162 | * function so that memory allocated to a hash table address entry can be | ||
163 | * released safely. | ||
164 | * | ||
165 | */ | ||
166 | static void netlbl_unlhsh_free_addr4(struct rcu_head *entry) | ||
167 | { | ||
168 | struct netlbl_unlhsh_addr4 *ptr; | ||
169 | |||
170 | ptr = container_of(entry, struct netlbl_unlhsh_addr4, rcu); | ||
171 | kfree(ptr); | ||
172 | } | ||
173 | |||
174 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
175 | /** | ||
176 | * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table | ||
177 | * @entry: the entry's RCU field | ||
178 | * | ||
179 | * Description: | ||
180 | * This function is designed to be used as a callback to the call_rcu() | ||
181 | * function so that memory allocated to a hash table address entry can be | ||
182 | * released safely. | ||
183 | * | ||
184 | */ | ||
185 | static void netlbl_unlhsh_free_addr6(struct rcu_head *entry) | ||
186 | { | ||
187 | struct netlbl_unlhsh_addr6 *ptr; | ||
188 | |||
189 | ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu); | ||
190 | kfree(ptr); | ||
191 | } | ||
192 | #endif /* IPv6 */ | ||
193 | |||
194 | /** | ||
195 | * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table | 157 | * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table |
196 | * @entry: the entry's RCU field | 158 | * @entry: the entry's RCU field |
197 | * | 159 | * |
@@ -568,7 +530,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net, | |||
568 | if (entry == NULL) | 530 | if (entry == NULL) |
569 | return -ENOENT; | 531 | return -ENOENT; |
570 | 532 | ||
571 | call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4); | 533 | kfree_rcu(entry, rcu); |
572 | return 0; | 534 | return 0; |
573 | } | 535 | } |
574 | 536 | ||
@@ -629,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net, | |||
629 | if (entry == NULL) | 591 | if (entry == NULL) |
630 | return -ENOENT; | 592 | return -ENOENT; |
631 | 593 | ||
632 | call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6); | 594 | kfree_rcu(entry, rcu); |
633 | return 0; | 595 | return 0; |
634 | } | 596 | } |
635 | #endif /* IPv6 */ | 597 | #endif /* IPv6 */ |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index c8f35b5d2ee9..5fe4f3b04ed3 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1566,12 +1566,6 @@ netlink_kernel_release(struct sock *sk) | |||
1566 | } | 1566 | } |
1567 | EXPORT_SYMBOL(netlink_kernel_release); | 1567 | EXPORT_SYMBOL(netlink_kernel_release); |
1568 | 1568 | ||
1569 | |||
1570 | static void listeners_free_rcu(struct rcu_head *head) | ||
1571 | { | ||
1572 | kfree(container_of(head, struct listeners, rcu)); | ||
1573 | } | ||
1574 | |||
1575 | int __netlink_change_ngroups(struct sock *sk, unsigned int groups) | 1569 | int __netlink_change_ngroups(struct sock *sk, unsigned int groups) |
1576 | { | 1570 | { |
1577 | struct listeners *new, *old; | 1571 | struct listeners *new, *old; |
@@ -1588,7 +1582,7 @@ int __netlink_change_ngroups(struct sock *sk, unsigned int groups) | |||
1588 | memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups)); | 1582 | memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups)); |
1589 | rcu_assign_pointer(tbl->listeners, new); | 1583 | rcu_assign_pointer(tbl->listeners, new); |
1590 | 1584 | ||
1591 | call_rcu(&old->rcu, listeners_free_rcu); | 1585 | kfree_rcu(old, rcu); |
1592 | } | 1586 | } |
1593 | tbl->groups = groups; | 1587 | tbl->groups = groups; |
1594 | 1588 | ||
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 947038ddd04c..1566672235dd 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -162,14 +162,6 @@ int phonet_address_add(struct net_device *dev, u8 addr) | |||
162 | return err; | 162 | return err; |
163 | } | 163 | } |
164 | 164 | ||
165 | static void phonet_device_rcu_free(struct rcu_head *head) | ||
166 | { | ||
167 | struct phonet_device *pnd; | ||
168 | |||
169 | pnd = container_of(head, struct phonet_device, rcu); | ||
170 | kfree(pnd); | ||
171 | } | ||
172 | |||
173 | int phonet_address_del(struct net_device *dev, u8 addr) | 165 | int phonet_address_del(struct net_device *dev, u8 addr) |
174 | { | 166 | { |
175 | struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev)); | 167 | struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev)); |
@@ -188,7 +180,7 @@ int phonet_address_del(struct net_device *dev, u8 addr) | |||
188 | mutex_unlock(&pndevs->lock); | 180 | mutex_unlock(&pndevs->lock); |
189 | 181 | ||
190 | if (pnd) | 182 | if (pnd) |
191 | call_rcu(&pnd->rcu, phonet_device_rcu_free); | 183 | kfree_rcu(pnd, rcu); |
192 | 184 | ||
193 | return err; | 185 | return err; |
194 | } | 186 | } |
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 14b42f4ad791..a606025814a1 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -26,11 +26,6 @@ | |||
26 | #include <net/act_api.h> | 26 | #include <net/act_api.h> |
27 | #include <net/netlink.h> | 27 | #include <net/netlink.h> |
28 | 28 | ||
29 | static void tcf_common_free_rcu(struct rcu_head *head) | ||
30 | { | ||
31 | kfree(container_of(head, struct tcf_common, tcfc_rcu)); | ||
32 | } | ||
33 | |||
34 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | 29 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) |
35 | { | 30 | { |
36 | unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); | 31 | unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); |
@@ -47,7 +42,7 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | |||
47 | * gen_estimator est_timer() might access p->tcfc_lock | 42 | * gen_estimator est_timer() might access p->tcfc_lock |
48 | * or bstats, wait a RCU grace period before freeing p | 43 | * or bstats, wait a RCU grace period before freeing p |
49 | */ | 44 | */ |
50 | call_rcu(&p->tcfc_rcu, tcf_common_free_rcu); | 45 | kfree_rcu(p, tcfc_rcu); |
51 | return; | 46 | return; |
52 | } | 47 | } |
53 | } | 48 | } |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 8a1630774fd6..b3b9b32f4e00 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -96,11 +96,6 @@ nla_put_failure: | |||
96 | goto done; | 96 | goto done; |
97 | } | 97 | } |
98 | 98 | ||
99 | static void tcf_police_free_rcu(struct rcu_head *head) | ||
100 | { | ||
101 | kfree(container_of(head, struct tcf_police, tcf_rcu)); | ||
102 | } | ||
103 | |||
104 | static void tcf_police_destroy(struct tcf_police *p) | 99 | static void tcf_police_destroy(struct tcf_police *p) |
105 | { | 100 | { |
106 | unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK); | 101 | unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK); |
@@ -121,7 +116,7 @@ static void tcf_police_destroy(struct tcf_police *p) | |||
121 | * gen_estimator est_timer() might access p->tcf_lock | 116 | * gen_estimator est_timer() might access p->tcf_lock |
122 | * or bstats, wait a RCU grace period before freeing p | 117 | * or bstats, wait a RCU grace period before freeing p |
123 | */ | 118 | */ |
124 | call_rcu(&p->tcf_rcu, tcf_police_free_rcu); | 119 | kfree_rcu(p, tcf_rcu); |
125 | return; | 120 | return; |
126 | } | 121 | } |
127 | } | 122 | } |
@@ -401,7 +396,6 @@ static void __exit | |||
401 | police_cleanup_module(void) | 396 | police_cleanup_module(void) |
402 | { | 397 | { |
403 | tcf_unregister_action(&act_police_ops); | 398 | tcf_unregister_action(&act_police_ops); |
404 | rcu_barrier(); /* Wait for completion of call_rcu()'s (tcf_police_free_rcu) */ | ||
405 | } | 399 | } |
406 | 400 | ||
407 | module_init(police_init_module); | 401 | module_init(police_init_module); |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index faf71d179e46..3c06c87cd280 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -219,7 +219,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr) | |||
219 | } | 219 | } |
220 | 220 | ||
221 | if (found) { | 221 | if (found) { |
222 | call_rcu(&addr->rcu, sctp_local_addr_free); | 222 | kfree_rcu(addr, rcu); |
223 | SCTP_DBG_OBJCNT_DEC(addr); | 223 | SCTP_DBG_OBJCNT_DEC(addr); |
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 865ce7ba4e14..185fe058db11 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -123,7 +123,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, | |||
123 | } | 123 | } |
124 | spin_unlock_bh(&sctp_local_addr_lock); | 124 | spin_unlock_bh(&sctp_local_addr_lock); |
125 | if (found) | 125 | if (found) |
126 | call_rcu(&addr->rcu, sctp_local_addr_free); | 126 | kfree_rcu(addr, rcu); |
127 | break; | 127 | break; |
128 | } | 128 | } |
129 | 129 | ||
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index d5bf91d04f63..065d99958ced 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -230,13 +230,6 @@ static void sctp_free_local_addr_list(void) | |||
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | void sctp_local_addr_free(struct rcu_head *head) | ||
234 | { | ||
235 | struct sctp_sockaddr_entry *e = container_of(head, | ||
236 | struct sctp_sockaddr_entry, rcu); | ||
237 | kfree(e); | ||
238 | } | ||
239 | |||
240 | /* Copy the local addresses which are valid for 'scope' into 'bp'. */ | 233 | /* Copy the local addresses which are valid for 'scope' into 'bp'. */ |
241 | int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, | 234 | int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, |
242 | gfp_t gfp, int copy_flags) | 235 | gfp_t gfp, int copy_flags) |
@@ -681,7 +674,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
681 | } | 674 | } |
682 | spin_unlock_bh(&sctp_local_addr_lock); | 675 | spin_unlock_bh(&sctp_local_addr_lock); |
683 | if (found) | 676 | if (found) |
684 | call_rcu(&addr->rcu, sctp_local_addr_free); | 677 | kfree_rcu(addr, rcu); |
685 | break; | 678 | break; |
686 | } | 679 | } |
687 | 680 | ||
diff --git a/net/socket.c b/net/socket.c index 310d16b1b3c9..c2ed7c95ce87 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -263,15 +263,6 @@ static struct inode *sock_alloc_inode(struct super_block *sb) | |||
263 | return &ei->vfs_inode; | 263 | return &ei->vfs_inode; |
264 | } | 264 | } |
265 | 265 | ||
266 | |||
267 | |||
268 | static void wq_free_rcu(struct rcu_head *head) | ||
269 | { | ||
270 | struct socket_wq *wq = container_of(head, struct socket_wq, rcu); | ||
271 | |||
272 | kfree(wq); | ||
273 | } | ||
274 | |||
275 | static void sock_destroy_inode(struct inode *inode) | 266 | static void sock_destroy_inode(struct inode *inode) |
276 | { | 267 | { |
277 | struct socket_alloc *ei; | 268 | struct socket_alloc *ei; |
@@ -279,7 +270,7 @@ static void sock_destroy_inode(struct inode *inode) | |||
279 | 270 | ||
280 | ei = container_of(inode, struct socket_alloc, vfs_inode); | 271 | ei = container_of(inode, struct socket_alloc, vfs_inode); |
281 | wq = rcu_dereference_protected(ei->socket.wq, 1); | 272 | wq = rcu_dereference_protected(ei->socket.wq, 1); |
282 | call_rcu(&wq->rcu, wq_free_rcu); | 273 | kfree_rcu(wq, rcu); |
283 | kmem_cache_free(sock_inode_cachep, ei); | 274 | kmem_cache_free(sock_inode_cachep, ei); |
284 | } | 275 | } |
285 | 276 | ||