Commit 1561b396 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

dm: pass the bio instead of tio to __map_bio

This simplifies the callers a bit.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
Link: https://lore.kernel.org/r/20220202160109.108149-7-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent dc8e2021
...@@ -1117,11 +1117,11 @@ static noinline void __set_swap_bios_limit(struct mapped_device *md, int latch) ...@@ -1117,11 +1117,11 @@ static noinline void __set_swap_bios_limit(struct mapped_device *md, int latch)
mutex_unlock(&md->swap_bios_lock); mutex_unlock(&md->swap_bios_lock);
} }
static void __map_bio(struct dm_target_io *tio) static void __map_bio(struct bio *clone)
{ {
struct dm_target_io *tio = clone_to_tio(clone);
int r; int r;
sector_t sector; sector_t sector;
struct bio *clone = &tio->clone;
struct dm_io *io = tio->io; struct dm_io *io = tio->io;
struct dm_target *ti = tio->ti; struct dm_target *ti = tio->ti;
...@@ -1227,7 +1227,7 @@ static int __clone_and_map_data_bio(struct clone_info *ci, struct dm_target *ti, ...@@ -1227,7 +1227,7 @@ static int __clone_and_map_data_bio(struct clone_info *ci, struct dm_target *ti,
if (bio_integrity(bio)) if (bio_integrity(bio))
bio_integrity_trim(clone); bio_integrity_trim(clone);
__map_bio(tio); __map_bio(clone);
return 0; return 0;
free_tio: free_tio:
free_tio(tio); free_tio(tio);
...@@ -1283,11 +1283,9 @@ static void __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti, ...@@ -1283,11 +1283,9 @@ static void __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti,
alloc_multiple_bios(&blist, ci, ti, num_bios, len); alloc_multiple_bios(&blist, ci, ti, num_bios, len);
while ((clone = bio_list_pop(&blist))) { while ((clone = bio_list_pop(&blist))) {
struct dm_target_io *tio = clone_to_tio(clone);
if (len) if (len)
bio_setup_sector(clone, ci->sector, *len); bio_setup_sector(clone, ci->sector, *len);
__map_bio(tio); __map_bio(clone);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment