]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
block,rcu: Convert call_rcu(disk_free_ptbl_rcu_cb) to kfree_rcu()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Fri, 18 Mar 2011 03:42:58 +0000 (11:42 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 20 Jul 2011 21:10:13 +0000 (14:10 -0700)
The rcu callback disk_free_ptbl_rcu_cb() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(disk_free_ptbl_rcu_cb).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
block/genhd.c

index 3608289c8ecdc0c8506af62421ccaabbae38438b..6024b82e3209408fcfeb979435b1151739ce2b0f 100644 (file)
@@ -1018,14 +1018,6 @@ static const struct attribute_group *disk_attr_groups[] = {
        NULL
 };
 
-static void disk_free_ptbl_rcu_cb(struct rcu_head *head)
-{
-       struct disk_part_tbl *ptbl =
-               container_of(head, struct disk_part_tbl, rcu_head);
-
-       kfree(ptbl);
-}
-
 /**
  * disk_replace_part_tbl - replace disk->part_tbl in RCU-safe way
  * @disk: disk to replace part_tbl for
@@ -1046,7 +1038,7 @@ static void disk_replace_part_tbl(struct gendisk *disk,
 
        if (old_ptbl) {
                rcu_assign_pointer(old_ptbl->last_lookup, NULL);
-               call_rcu(&old_ptbl->rcu_head, disk_free_ptbl_rcu_cb);
+               kfree_rcu(old_ptbl, rcu_head);
        }
 }