Skip to content

Commit e6926ad

Browse files
Ming LeiMike Snitzer
authored andcommitted
dm: pass dm_io instance to dm_io_acct directly
All the other 4 parameters are retrieved from the 'dm_io' instance, so it's not necessary to pass all four to dm_io_acct(). Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent b992b40 commit e6926ad

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/md/dm.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,12 @@ static bool bio_is_flush_with_data(struct bio *bio)
502502
return ((bio->bi_opf & REQ_PREFLUSH) && bio->bi_iter.bi_size);
503503
}
504504

505-
static void dm_io_acct(bool end, struct mapped_device *md, struct bio *bio,
506-
unsigned long start_time, struct dm_stats_aux *stats_aux)
505+
static void dm_io_acct(struct dm_io *io, bool end)
507506
{
507+
struct dm_stats_aux *stats_aux = &io->stats_aux;
508+
unsigned long start_time = io->start_time;
509+
struct mapped_device *md = io->md;
510+
struct bio *bio = io->orig_bio;
508511
bool is_flush_with_data;
509512
unsigned int bi_size;
510513

@@ -533,7 +536,7 @@ static void dm_io_acct(bool end, struct mapped_device *md, struct bio *bio,
533536

534537
static void __dm_start_io_acct(struct dm_io *io)
535538
{
536-
dm_io_acct(false, io->md, io->orig_bio, io->start_time, &io->stats_aux);
539+
dm_io_acct(io, false);
537540
}
538541

539542
static void dm_start_io_acct(struct dm_io *io, struct bio *clone)
@@ -560,7 +563,7 @@ static void dm_start_io_acct(struct dm_io *io, struct bio *clone)
560563

561564
static void dm_end_io_acct(struct dm_io *io)
562565
{
563-
dm_io_acct(true, io->md, io->orig_bio, io->start_time, &io->stats_aux);
566+
dm_io_acct(io, true);
564567
}
565568

566569
static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)

0 commit comments

Comments
 (0)