summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-02-15 14:13:16 +0300
committerJens Axboe <axboe@kernel.dk>2019-02-15 18:40:11 +0300
commitc3a7ce738009912f9d237bdabf4a20038522de10 (patch)
treedbe73b17f003885d7df92c20a3f277314eb95186 /fs
parentf70f44640759728d6e31326acbee08ca22d1066f (diff)
downloadlinux-c3a7ce738009912f9d237bdabf4a20038522de10.tar.xz
btrfs: use mp_bvec_last_segment to get bio's last page
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index dc8ba3ee515d..986ef49b0269 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -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;