net,rcu: convert call_rcu(free_dm_hw_stat) to kfree_rcu()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Fri, 18 Mar 2011 03:39:43 +0000 (11:39 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 May 2011 05:50:59 +0000 (22:50 -0700)
The rcu callback free_dm_hw_stat() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(free_dm_hw_stat).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
net/core/drop_monitor.c

index 706502ff64aa884548bf5122bd71085aea098a45..7f36b38e060fcfbf98ed35cd1dff84067f75d11c 100644 (file)
@@ -207,14 +207,6 @@ static void trace_napi_poll_hit(void *ignore, struct napi_struct *napi)
        rcu_read_unlock();
 }
 
-
-static void free_dm_hw_stat(struct rcu_head *head)
-{
-       struct dm_hw_stat_delta *n;
-       n = container_of(head, struct dm_hw_stat_delta, rcu);
-       kfree(n);
-}
-
 static int set_all_monitor_traces(int state)
 {
        int rc = 0;
@@ -245,7 +237,7 @@ static int set_all_monitor_traces(int state)
                list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) {
                        if (new_stat->dev == NULL) {
                                list_del_rcu(&new_stat->list);
-                               call_rcu(&new_stat->rcu, free_dm_hw_stat);
+                               kfree_rcu(new_stat, rcu);
                        }
                }
                break;
@@ -314,7 +306,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
                                new_stat->dev = NULL;
                                if (trace_state == TRACE_OFF) {
                                        list_del_rcu(&new_stat->list);
-                                       call_rcu(&new_stat->rcu, free_dm_hw_stat);
+                                       kfree_rcu(new_stat, rcu);
                                        break;
                                }
                        }