diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 545a480528e0e6a4c2fd4b11f7eafd0e91da3393..a032f01e928c5e71ce805c3aa51b563b82090b87 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -133,11 +133,6 @@ static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) 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) { @@ -147,8 +142,7 @@ static inline void bvec_advance(const struct bio_vec *bvec, 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,