[dm-devel] [PATCH 06/16] dm: use bio_{start,end}_io_acct

2020-05-26 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers.

Signed-off-by: Christoph Hellwig 
Reviewed-by: Konstantin Khlebnikov 
---
 drivers/md/dm.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f215b86664484..3f39fa1ac756e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -681,11 +681,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 = jiffies;
-
-   generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio),
- _disk(md)->part0);
-
+   io->start_time = bio_start_io_acct(bio);
if (unlikely(dm_stats_used(>stats)))
dm_stats_account_io(>stats, bio_data_dir(bio),
bio->bi_iter.bi_sector, bio_sectors(bio),
@@ -698,8 +694,7 @@ static void end_io_acct(struct dm_io *io)
struct bio *bio = io->orig_bio;
unsigned long duration = jiffies - io->start_time;
 
-   generic_end_io_acct(md->queue, bio_op(bio), _disk(md)->part0,
-   io->start_time);
+   bio_end_io_acct(bio, io->start_time);
 
if (unlikely(dm_stats_used(>stats)))
dm_stats_account_io(>stats, bio_data_dir(bio),
-- 
2.26.2

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel



[dm-devel] [PATCH 06/16] dm: use bio_{start,end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers.

Signed-off-by: Christoph Hellwig 
---
 drivers/md/dm.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f215b86664484..3f39fa1ac756e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -681,11 +681,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 = jiffies;
-
-   generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio),
- _disk(md)->part0);
-
+   io->start_time = bio_start_io_acct(bio);
if (unlikely(dm_stats_used(>stats)))
dm_stats_account_io(>stats, bio_data_dir(bio),
bio->bi_iter.bi_sector, bio_sectors(bio),
@@ -698,8 +694,7 @@ static void end_io_acct(struct dm_io *io)
struct bio *bio = io->orig_bio;
unsigned long duration = jiffies - io->start_time;
 
-   generic_end_io_acct(md->queue, bio_op(bio), _disk(md)->part0,
-   io->start_time);
+   bio_end_io_acct(bio, io->start_time);
 
if (unlikely(dm_stats_used(>stats)))
dm_stats_account_io(>stats, bio_data_dir(bio),
-- 
2.26.2

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel