Commit c3a7ce73 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

btrfs: use mp_bvec_last_segment to get bio's last page

Preparing for supporting multi-page bvec.
Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f70f4464
...@@ -2697,11 +2697,12 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, ...@@ -2697,11 +2697,12 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
{ {
blk_status_t ret = 0; blk_status_t ret = 0;
struct bio_vec *bvec = bio_last_bvec_all(bio); struct bio_vec *bvec = bio_last_bvec_all(bio);
struct page *page = bvec->bv_page; struct bio_vec bv;
struct extent_io_tree *tree = bio->bi_private; struct extent_io_tree *tree = bio->bi_private;
u64 start; u64 start;
start = page_offset(page) + bvec->bv_offset; mp_bvec_last_segment(bvec, &bv);
start = page_offset(bv.bv_page) + bv.bv_offset;
bio->bi_private = NULL; bio->bi_private = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment