diff options
author | Ming Lei <tom.leiming@gmail.com> | 2016-11-22 08:57:21 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-22 08:57:21 -0700 |
commit | 3a83f4677539bce8eaa2bca9ee9c20e172d7ab04 (patch) | |
tree | edb5ffeed2c07c342bd6d9adb0180fab472c1666 /drivers/nvme | |
parent | 9a794fb9bddeda0b8c8c13858038318f3cbd4b7e (diff) | |
download | linux-3a83f4677539bce8eaa2bca9ee9c20e172d7ab04.tar.gz linux-3a83f4677539bce8eaa2bca9ee9c20e172d7ab04.tar.bz2 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/nvme')
-rw-r--r-- | drivers/nvme/target/io-cmd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c index ef52b1e70144..c4dc9ea8ade0 100644 --- a/drivers/nvme/target/io-cmd.c +++ b/drivers/nvme/target/io-cmd.c @@ -37,9 +37,7 @@ static void nvmet_inline_bio_init(struct nvmet_req *req) { struct bio *bio = &req->inline_bio; - bio_init(bio); - bio->bi_max_vecs = NVMET_MAX_INLINE_BIOVEC; - bio->bi_io_vec = req->inline_bvec; + bio_init(bio, req->inline_bvec, NVMET_MAX_INLINE_BIOVEC); } static void nvmet_execute_rw(struct nvmet_req *req) |