Commit 0a384b226f61b310586701669b573b49cfcbf436

Authored by Eric Dumazet
Committed by David S. Miller
1 parent 0f6c6392dc

garp: use kfree_rcu()

Use kfree_rcu() instead of call_rcu(), remove garp_cleanup_module()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 2 additions and 18 deletions Side-by-side Diff

... ... @@ -544,11 +544,6 @@
544 544 return 0;
545 545 }
546 546  
547   -static void garp_kfree_rcu(struct rcu_head *head)
548   -{
549   - kfree(container_of(head, struct garp_port, rcu));
550   -}
551   -
552 547 static void garp_release_port(struct net_device *dev)
553 548 {
554 549 struct garp_port *port = rtnl_dereference(dev->garp_port);
... ... @@ -559,7 +554,7 @@
559 554 return;
560 555 }
561 556 rcu_assign_pointer(dev->garp_port, NULL);
562   - call_rcu(&port->rcu, garp_kfree_rcu);
  557 + kfree_rcu(port, rcu);
563 558 }
564 559  
565 560 int garp_init_applicant(struct net_device *dev, struct garp_application *appl)
... ... @@ -603,11 +598,6 @@
603 598 }
604 599 EXPORT_SYMBOL_GPL(garp_init_applicant);
605 600  
606   -static void garp_app_kfree_rcu(struct rcu_head *head)
607   -{
608   - kfree(container_of(head, struct garp_applicant, rcu));
609   -}
610   -
611 601 void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl)
612 602 {
613 603 struct garp_port *port = rtnl_dereference(dev->garp_port);
... ... @@ -625,7 +615,7 @@
625 615 garp_queue_xmit(app);
626 616  
627 617 dev_mc_del(dev, appl->proto.group_address);
628   - call_rcu(&app->rcu, garp_app_kfree_rcu);
  618 + kfree_rcu(app, rcu);
629 619 garp_release_port(dev);
630 620 }
631 621 EXPORT_SYMBOL_GPL(garp_uninit_applicant);
... ... @@ -643,10 +633,4 @@
643 633 stp_proto_unregister(&appl->proto);
644 634 }
645 635 EXPORT_SYMBOL_GPL(garp_unregister_application);
646   -
647   -static void __exit garp_cleanup_module(void)
648   -{
649   - rcu_barrier(); /* Wait for completion of call_rcu()'s */
650   -}
651   -module_exit(garp_cleanup_module);