mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
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>
This commit is contained in:
parent
9a794fb9bd
commit
3a83f46775
17 changed files with 28 additions and 50 deletions
|
@ -222,9 +222,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
bio_init(&bio);
|
||||
bio.bi_max_vecs = nr_pages;
|
||||
bio.bi_io_vec = vecs;
|
||||
bio_init(&bio, vecs, nr_pages);
|
||||
bio.bi_bdev = bdev;
|
||||
bio.bi_iter.bi_sector = pos >> 9;
|
||||
bio.bi_private = current;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue