When Jens merged my commit to only allow contiguous page structs in a
bio_vec with Ming's 5.1 fix to ensue the bvec length didn't overflow
we failed to keep the removal of the expensive nth_page calls.  This
commits adds them back as intended.
Fixes: 5c61ee2cd586 ("Merge tag 'v5.1-rc6' into for-5.2/block")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
        return &iter_all->bv;
 }
 
-static inline struct page *bvec_nth_page(struct page *page, int idx)
-{
-       return idx == 0 ? page : nth_page(page, idx);
-}
-
 static inline void bvec_advance(const struct bio_vec *bvec,
                                struct bvec_iter_all *iter_all)
 {
                bv->bv_page++;
                bv->bv_offset = 0;
        } else {
-               bv->bv_page = bvec_nth_page(bvec->bv_page, bvec->bv_offset /
-                                           PAGE_SIZE);
+               bv->bv_page = bvec->bv_page + (bvec->bv_offset >> PAGE_SHIFT);
                bv->bv_offset = bvec->bv_offset & ~PAGE_MASK;
        }
        bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset,