Skip to content

Commit 00fe60e

Browse files
liu-song-6axboe
authored andcommitted
md: use part_[begin|end]_io_acct instead of disk_[begin|end]_io_acct
This enables proper statistics in /proc/diskstats for md partitions. Signed-off-by: Song Liu <songliubraving@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 7b26410 commit 00fe60e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/md/md.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,15 @@ struct md_io {
464464
bio_end_io_t *orig_bi_end_io;
465465
void *orig_bi_private;
466466
unsigned long start_time;
467+
struct hd_struct *part;
467468
};
468469

469470
static void md_end_io(struct bio *bio)
470471
{
471472
struct md_io *md_io = bio->bi_private;
472473
struct mddev *mddev = md_io->mddev;
473474

474-
disk_end_io_acct(mddev->gendisk, bio_op(bio), md_io->start_time);
475+
part_end_io_acct(md_io->part, bio, md_io->start_time);
475476

476477
bio->bi_end_io = md_io->orig_bi_end_io;
477478
bio->bi_private = md_io->orig_bi_private;
@@ -517,9 +518,8 @@ static blk_qc_t md_submit_bio(struct bio *bio)
517518
bio->bi_end_io = md_end_io;
518519
bio->bi_private = md_io;
519520

520-
md_io->start_time = disk_start_io_acct(mddev->gendisk,
521-
bio_sectors(bio),
522-
bio_op(bio));
521+
md_io->start_time = part_start_io_acct(mddev->gendisk,
522+
&md_io->part, bio);
523523
}
524524

525525
/* bio could be mergeable after passing to underlayer */

0 commit comments

Comments
 (0)