Skip to content

Commit

Permalink
btrfs: use mp_bvec_last_segment to get bio's last page
Browse files Browse the repository at this point in the history
Preparing for supporting multi-page bvec.

Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Ming Lei authored and Jens Axboe committed Feb 15, 2019
1 parent f70f446 commit c3a7ce7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,11 +2697,12 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
{
blk_status_t ret = 0;
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;
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;

Expand Down

0 comments on commit c3a7ce7

Please sign in to comment.