summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorChaitanya Kulkarni <kch@nvidia.com>2022-01-24 10:11:02 +0100
committerJens Axboe <axboe@kernel.dk>2022-02-02 07:49:59 -0700
commit0a3140ea0fae377c9eaa031b7db1670ae422ed47 (patch)
treebddc6fc46c05cede8a67a56092f56affcb05b55d /block/bio.c
parent3b005bf6acf009abd700e2c652c86e5c209cf63d (diff)
block: pass a block_device and opf to blk_next_bio
All callers need to set the block_device and operation, so lift that into the common code. Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220124091107.642561-15-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index 1536579ed490..a0166f29a05c 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -344,10 +344,14 @@ void bio_chain(struct bio *bio, struct bio *parent)
}
EXPORT_SYMBOL(bio_chain);
-struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)
+struct bio *blk_next_bio(struct bio *bio, struct block_device *bdev,
+ unsigned int nr_pages, unsigned int opf, gfp_t gfp)
{
struct bio *new = bio_alloc(gfp, nr_pages);
+ bio_set_dev(new, bdev);
+ new->bi_opf = opf;
+
if (bio) {
bio_chain(bio, new);
submit_bio(bio);