diff options
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 8f37ed215b19..4c06585bf165 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -605,13 +605,10 @@ static void end_io_acct(struct dm_io *io) | |||
605 | struct mapped_device *md = io->md; | 605 | struct mapped_device *md = io->md; |
606 | struct bio *bio = io->bio; | 606 | struct bio *bio = io->bio; |
607 | unsigned long duration = jiffies - io->start_time; | 607 | unsigned long duration = jiffies - io->start_time; |
608 | int pending, cpu; | 608 | int pending; |
609 | int rw = bio_data_dir(bio); | 609 | int rw = bio_data_dir(bio); |
610 | 610 | ||
611 | cpu = part_stat_lock(); | 611 | generic_end_io_acct(rw, &dm_disk(md)->part0, io->start_time); |
612 | part_round_stats(cpu, &dm_disk(md)->part0); | ||
613 | part_stat_add(cpu, &dm_disk(md)->part0, ticks[rw], duration); | ||
614 | part_stat_unlock(); | ||
615 | 612 | ||
616 | if (unlikely(dm_stats_used(&md->stats))) | 613 | if (unlikely(dm_stats_used(&md->stats))) |
617 | dm_stats_account_io(&md->stats, bio->bi_rw, bio->bi_iter.bi_sector, | 614 | dm_stats_account_io(&md->stats, bio->bi_rw, bio->bi_iter.bi_sector, |
@@ -1651,16 +1648,12 @@ static void _dm_request(struct request_queue *q, struct bio *bio) | |||
1651 | { | 1648 | { |
1652 | int rw = bio_data_dir(bio); | 1649 | int rw = bio_data_dir(bio); |
1653 | struct mapped_device *md = q->queuedata; | 1650 | struct mapped_device *md = q->queuedata; |
1654 | int cpu; | ||
1655 | int srcu_idx; | 1651 | int srcu_idx; |
1656 | struct dm_table *map; | 1652 | struct dm_table *map; |
1657 | 1653 | ||
1658 | map = dm_get_live_table(md, &srcu_idx); | 1654 | map = dm_get_live_table(md, &srcu_idx); |
1659 | 1655 | ||
1660 | cpu = part_stat_lock(); | 1656 | generic_start_io_acct(rw, bio_sectors(bio), &dm_disk(md)->part0); |
1661 | part_stat_inc(cpu, &dm_disk(md)->part0, ios[rw]); | ||
1662 | part_stat_add(cpu, &dm_disk(md)->part0, sectors[rw], bio_sectors(bio)); | ||
1663 | part_stat_unlock(); | ||
1664 | 1657 | ||
1665 | /* if we're suspended, we have to queue this io for later */ | 1658 | /* if we're suspended, we have to queue this io for later */ |
1666 | if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags))) { | 1659 | if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags))) { |