diff options
author | Ming Lei <tom.leiming@gmail.com> | 2016-11-22 16:57:21 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-22 16:57:21 +0100 |
commit | 3a83f4677539bce8eaa2bca9ee9c20e172d7ab04 (patch) | |
tree | edb5ffeed2c07c342bd6d9adb0180fab472c1666 /drivers/block/floppy.c | |
parent | block_dev: get rid of blksize bits calculation (diff) | |
download | linux-3a83f4677539bce8eaa2bca9ee9c20e172d7ab04.tar.xz linux-3a83f4677539bce8eaa2bca9ee9c20e172d7ab04.zip |
block: bio: pass bvec table to bio_init()
Some drivers often use external bvec table, so introduce
this helper for this case. It is always safe to access the
bio->bi_io_vec in this way for this case.
After converting to this usage, it will becomes a bit easier
to evaluate the remaining direct access to bio->bi_io_vec,
so it can help to prepare for the following multipage bvec
support.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Fixed up the new O_DIRECT cases.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index e3d8e4ced4a2..6a3ff2b2e3ae 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3806,8 +3806,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; - bio_init(&bio); - bio.bi_io_vec = &bio_vec; + bio_init(&bio, &bio_vec, 1); bio_vec.bv_page = page; bio_vec.bv_len = size; bio_vec.bv_offset = 0; |