diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2011-03-18 00:02:47 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-08 01:51:04 -0400 |
commit | b55071eb6011413af3b9c434ae77dea8832069c8 (patch) | |
tree | 47d1ea3b74536adbf5e17388f08981016e5c1397 | |
parent | edc86d8a1c824cca1df676f47fc713232885561f (diff) |
net,rcu: convert call_rcu(xps_dev_maps_release) to kfree_rcu()
The rcu callback xps_dev_maps_release() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xps_dev_maps_release).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.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>
-rw-r--r-- | net/core/net-sysfs.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 48ffc216c86f..80b2aad3b73d 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -891,14 +891,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue, | |||
891 | return len; | 891 | return len; |
892 | } | 892 | } |
893 | 893 | ||
894 | static void xps_dev_maps_release(struct rcu_head *rcu) | ||
895 | { | ||
896 | struct xps_dev_maps *dev_maps = | ||
897 | container_of(rcu, struct xps_dev_maps, rcu); | ||
898 | |||
899 | kfree(dev_maps); | ||
900 | } | ||
901 | |||
902 | static DEFINE_MUTEX(xps_map_mutex); | 894 | static DEFINE_MUTEX(xps_map_mutex); |
903 | #define xmap_dereference(P) \ | 895 | #define xmap_dereference(P) \ |
904 | rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) | 896 | rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) |
@@ -1008,7 +1000,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue, | |||
1008 | } | 1000 | } |
1009 | 1001 | ||
1010 | if (dev_maps) | 1002 | if (dev_maps) |
1011 | call_rcu(&dev_maps->rcu, xps_dev_maps_release); | 1003 | kfree_rcu(dev_maps, rcu); |
1012 | 1004 | ||
1013 | netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : | 1005 | netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : |
1014 | NUMA_NO_NODE); | 1006 | NUMA_NO_NODE); |
@@ -1080,7 +1072,7 @@ static void netdev_queue_release(struct kobject *kobj) | |||
1080 | 1072 | ||
1081 | if (!nonempty) { | 1073 | if (!nonempty) { |
1082 | RCU_INIT_POINTER(dev->xps_maps, NULL); | 1074 | RCU_INIT_POINTER(dev->xps_maps, NULL); |
1083 | call_rcu(&dev_maps->rcu, xps_dev_maps_release); | 1075 | kfree_rcu(dev_maps, rcu); |
1084 | } | 1076 | } |
1085 | } | 1077 | } |
1086 | 1078 | ||