diff options
author | Christoph Hellwig <hch@lst.de> | 2022-01-24 10:11:06 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-02-02 15:49:59 +0100 |
commit | 49add4966d79244013fce35f95c6833fae82b8b1 (patch) | |
tree | 915dec99a236142c08e4b0ac94346f178d467987 /drivers/block/floppy.c | |
parent | block: pass a block_device and opf to bio_alloc (diff) | |
download | linux-49add4966d79244013fce35f95c6833fae82b8b1.tar.xz linux-49add4966d79244013fce35f95c6833fae82b8b1.zip |
block: pass a block_device and opf to bio_init
Pass the block_device that we plan to use this bio for and the
operation to bio_init to optimize the assignment. A NULL block_device
can be passed, both for the passthrough case on a raw request_queue and
to temporarily avoid refactoring some nasty code.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220124091107.642561-19-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index e611411a934c..19c2d0327e15 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4129,15 +4129,13 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; - bio_init(&bio, &bio_vec, 1); - bio_set_dev(&bio, bdev); + bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); bio.bi_private = &cbdata; bio.bi_end_io = floppy_rb0_cb; - bio_set_op_attrs(&bio, REQ_OP_READ, 0); init_completion(&cbdata.complete); |