Commit 0a384b22 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

garp: use kfree_rcu()

Use kfree_rcu() instead of call_rcu(), remove garp_cleanup_module()
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f6c6392
...@@ -544,11 +544,6 @@ static int garp_init_port(struct net_device *dev) ...@@ -544,11 +544,6 @@ static int garp_init_port(struct net_device *dev)
return 0; return 0;
} }
static void garp_kfree_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct garp_port, rcu));
}
static void garp_release_port(struct net_device *dev) static void garp_release_port(struct net_device *dev)
{ {
struct garp_port *port = rtnl_dereference(dev->garp_port); struct garp_port *port = rtnl_dereference(dev->garp_port);
...@@ -559,7 +554,7 @@ static void garp_release_port(struct net_device *dev) ...@@ -559,7 +554,7 @@ static void garp_release_port(struct net_device *dev)
return; return;
} }
rcu_assign_pointer(dev->garp_port, NULL); rcu_assign_pointer(dev->garp_port, NULL);
call_rcu(&port->rcu, garp_kfree_rcu); kfree_rcu(port, rcu);
} }
int garp_init_applicant(struct net_device *dev, struct garp_application *appl) int garp_init_applicant(struct net_device *dev, struct garp_application *appl)
...@@ -603,11 +598,6 @@ int garp_init_applicant(struct net_device *dev, struct garp_application *appl) ...@@ -603,11 +598,6 @@ int garp_init_applicant(struct net_device *dev, struct garp_application *appl)
} }
EXPORT_SYMBOL_GPL(garp_init_applicant); EXPORT_SYMBOL_GPL(garp_init_applicant);
static void garp_app_kfree_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct garp_applicant, rcu));
}
void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl) void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl)
{ {
struct garp_port *port = rtnl_dereference(dev->garp_port); struct garp_port *port = rtnl_dereference(dev->garp_port);
...@@ -625,7 +615,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl ...@@ -625,7 +615,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl
garp_queue_xmit(app); garp_queue_xmit(app);
dev_mc_del(dev, appl->proto.group_address); dev_mc_del(dev, appl->proto.group_address);
call_rcu(&app->rcu, garp_app_kfree_rcu); kfree_rcu(app, rcu);
garp_release_port(dev); garp_release_port(dev);
} }
EXPORT_SYMBOL_GPL(garp_uninit_applicant); EXPORT_SYMBOL_GPL(garp_uninit_applicant);
...@@ -643,9 +633,3 @@ void garp_unregister_application(struct garp_application *appl) ...@@ -643,9 +633,3 @@ void garp_unregister_application(struct garp_application *appl)
stp_proto_unregister(&appl->proto); stp_proto_unregister(&appl->proto);
} }
EXPORT_SYMBOL_GPL(garp_unregister_application); EXPORT_SYMBOL_GPL(garp_unregister_application);
static void __exit garp_cleanup_module(void)
{
rcu_barrier(); /* Wait for completion of call_rcu()'s */
}
module_exit(garp_cleanup_module);
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