diff options
author | Christoph Hellwig <hch@lst.de> | 2024-03-03 07:01:40 -0700 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-03-06 08:59:52 -0800 |
commit | c396b90e502691fc6ff7b43984cfd9d1b15aaa80 (patch) | |
tree | 9c36ee2b90f098178645ada275d2c936cfaa8086 /drivers/md/raid1.c | |
parent | 3a889fdce7e8927a7d81d11ca3d26608b3be1c31 (diff) | |
download | lwn-c396b90e502691fc6ff7b43984cfd9d1b15aaa80.tar.gz lwn-c396b90e502691fc6ff7b43984cfd9d1b15aaa80.zip |
md: add a mddev_trace_remap helper
Add a helper to trace bio remapping that hides some argument
dereferences and the check for a DM-mapped MD device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed--by: Song Liu <song@kernel.org>
Tested-by: Song Liu <song@kernel.org>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240303140150.5435-2-hch@lst.de
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index afca975ec7f3..421154430f24 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1418,11 +1418,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, test_bit(R1BIO_FailFast, &r1_bio->state)) read_bio->bi_opf |= MD_FAILFAST; read_bio->bi_private = r1_bio; - - if (mddev->gendisk) - trace_block_bio_remap(read_bio, disk_devt(mddev->gendisk), - r1_bio->sector); - + mddev_trace_remap(mddev, read_bio, r1_bio->sector); submit_bio_noacct(read_bio); } @@ -1655,10 +1651,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, mbio->bi_private = r1_bio; atomic_inc(&r1_bio->remaining); - - if (mddev->gendisk) - trace_block_bio_remap(mbio, disk_devt(mddev->gendisk), - r1_bio->sector); + mddev_trace_remap(mddev, mbio, r1_bio->sector); /* flush_pending_writes() needs access to the rdev so...*/ mbio->bi_bdev = (void *)rdev; if (!raid1_add_bio_to_plug(mddev, mbio, raid1_unplug, disks)) { |