Merge branches 'clk-range', 'clk-uniphier', 'clk-apple' and 'clk-qcom' into clk-next
[linux-2.6-microblaze.git] / drivers / md / dm.c
index c0ae808..dcbd6d2 100644 (file)
@@ -489,7 +489,7 @@ static void start_io_acct(struct dm_io *io)
        struct mapped_device *md = io->md;
        struct bio *bio = io->orig_bio;
 
-       io->start_time = bio_start_io_acct(bio);
+       bio_start_io_acct_time(bio, io->start_time);
        if (unlikely(dm_stats_used(&md->stats)))
                dm_stats_account_io(&md->stats, bio_data_dir(bio),
                                    bio->bi_iter.bi_sector, bio_sectors(bio),
@@ -535,7 +535,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)
        io->md = md;
        spin_lock_init(&io->endio_lock);
 
-       start_io_acct(io);
+       io->start_time = jiffies;
 
        return io;
 }
@@ -1442,9 +1442,6 @@ static void init_clone_info(struct clone_info *ci, struct mapped_device *md,
        ci->sector = bio->bi_iter.bi_sector;
 }
 
-#define __dm_part_stat_sub(part, field, subnd) \
-       (part_stat_get(part, field) -= (subnd))
-
 /*
  * Entry point to split a bio into clones and submit them to the targets.
  */
@@ -1480,23 +1477,12 @@ static void __split_and_process_bio(struct mapped_device *md,
                                                  GFP_NOIO, &md->queue->bio_split);
                        ci.io->orig_bio = b;
 
-                       /*
-                        * Adjust IO stats for each split, otherwise upon queue
-                        * reentry there will be redundant IO accounting.
-                        * NOTE: this is a stop-gap fix, a proper fix involves
-                        * significant refactoring of DM core's bio splitting
-                        * (by eliminating DM's splitting and just using bio_split)
-                        */
-                       part_stat_lock();
-                       __dm_part_stat_sub(dm_disk(md)->part0,
-                                          sectors[op_stat_group(bio_op(bio))], ci.sector_count);
-                       part_stat_unlock();
-
                        bio_chain(b, bio);
                        trace_block_split(b, bio->bi_iter.bi_sector);
                        submit_bio_noacct(bio);
                }
        }
+       start_io_acct(ci.io);
 
        /* drop the extra reference count */
        dm_io_dec_pending(ci.io, errno_to_blk_status(error));