Skip to content

Commit

Permalink
block: floppy: use bio_add_page()
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Ming Lei authored and Jens Axboe committed Nov 22, 2016
1 parent 06efffd commit 2c73a60
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3807,12 +3807,9 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
cbdata.drive = drive;

bio_init(&bio, &bio_vec, 1);
bio_vec.bv_page = page;
bio_vec.bv_len = size;
bio_vec.bv_offset = 0;
bio.bi_vcnt = 1;
bio.bi_iter.bi_size = size;
bio.bi_bdev = bdev;
bio_add_page(&bio, page, size, 0);

bio.bi_iter.bi_sector = 0;
bio.bi_flags |= (1 << BIO_QUIET);
bio.bi_private = &cbdata;
Expand Down

0 comments on commit 2c73a60

Please sign in to comment.