Commit 8eabf5d0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

dm: fold __send_duplicate_bios into __clone_and_map_simple_bio

Fold __send_duplicate_bios into its only caller to prepare for
refactoring.
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-5-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b1bee792
...@@ -1273,10 +1273,16 @@ static void alloc_multiple_bios(struct bio_list *blist, struct clone_info *ci, ...@@ -1273,10 +1273,16 @@ static void alloc_multiple_bios(struct bio_list *blist, struct clone_info *ci,
} }
} }
static void __clone_and_map_simple_bio(struct clone_info *ci, static void __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti,
struct dm_target_io *tio, unsigned *len) unsigned num_bios, unsigned *len)
{ {
struct bio *clone = &tio->clone; struct bio_list blist = BIO_EMPTY_LIST;
struct bio *clone;
alloc_multiple_bios(&blist, ci, ti, num_bios);
while ((clone = bio_list_pop(&blist))) {
struct dm_target_io *tio = clone_to_tio(clone);
tio->len_ptr = len; tio->len_ptr = len;
...@@ -1284,18 +1290,7 @@ static void __clone_and_map_simple_bio(struct clone_info *ci, ...@@ -1284,18 +1290,7 @@ static void __clone_and_map_simple_bio(struct clone_info *ci,
if (len) if (len)
bio_setup_sector(clone, ci->sector, *len); bio_setup_sector(clone, ci->sector, *len);
__map_bio(tio); __map_bio(tio);
} }
static void __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti,
unsigned num_bios, unsigned *len)
{
struct bio_list blist = BIO_EMPTY_LIST;
struct bio *bio;
alloc_multiple_bios(&blist, ci, ti, num_bios);
while ((bio = bio_list_pop(&blist)))
__clone_and_map_simple_bio(ci, clone_to_tio(bio), len);
} }
static int __send_empty_flush(struct clone_info *ci) static int __send_empty_flush(struct clone_info *ci)
......
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