summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-02-02 17:01:00 +0100
committerJens Axboe <axboe@kernel.dk>2022-02-04 07:43:17 -0700
commit8eabf5d0a7bd9226d6cc25402dde67f372aae838 (patch)
tree5e2c52b981a008f0bc4afd6a25371629f5671d70 /drivers
parentb1bee79237ce0ab43ef7fe66aa6e5c4783165012 (diff)
downloadlinux-stable-8eabf5d0a7bd9226d6cc25402dde67f372aae838.tar.gz
linux-stable-8eabf5d0a7bd9226d6cc25402dde67f372aae838.tar.bz2
linux-stable-8eabf5d0a7bd9226d6cc25402dde67f372aae838.zip
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 9384d250a3e4..2527b287ead0 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1273,29 +1273,24 @@ static void alloc_multiple_bios(struct bio_list *blist, struct clone_info *ci,
}
}
-static void __clone_and_map_simple_bio(struct clone_info *ci,
- struct dm_target_io *tio, unsigned *len)
-{
- struct bio *clone = &tio->clone;
-
- tio->len_ptr = len;
-
- __bio_clone_fast(clone, ci->bio);
- if (len)
- bio_setup_sector(clone, ci->sector, *len);
- __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;
+ struct bio *clone;
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);
+ while ((clone = bio_list_pop(&blist))) {
+ struct dm_target_io *tio = clone_to_tio(clone);
+
+ tio->len_ptr = len;
+
+ __bio_clone_fast(clone, ci->bio);
+ if (len)
+ bio_setup_sector(clone, ci->sector, *len);
+ __map_bio(tio);
+ }
}
static int __send_empty_flush(struct clone_info *ci)