diff options
| author | Ingo Molnar <mingo@kernel.org> | 2019-05-03 12:52:45 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-05-03 12:52:45 +0200 |
| commit | 176d2323c7743e03e3bb4298b6f25eea2f00fed0 (patch) | |
| tree | c751cba895aa8870372c97c8340166de079eae8e /include/linux/bvec.h | |
| parent | 9b019acb72e4b5741d88e8936d6f200ed44b66b2 (diff) | |
| parent | ea9866793d1e925b4d320eaea409263b2a568f38 (diff) | |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/bvec.h')
| -rw-r--r-- | include/linux/bvec.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/bvec.h b/include/linux/bvec.h index f6275c4da13a..ff13cbc1887d 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -145,26 +145,33 @@ static inline bool bvec_iter_advance(const struct bio_vec *bv, static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) { - iter_all->bv.bv_page = NULL; iter_all->done = 0; + iter_all->idx = 0; return &iter_all->bv; } -static inline void mp_bvec_next_segment(const struct bio_vec *bvec, - struct bvec_iter_all *iter_all) +static inline void bvec_advance(const struct bio_vec *bvec, + struct bvec_iter_all *iter_all) { struct bio_vec *bv = &iter_all->bv; - if (bv->bv_page) { + if (iter_all->done) { bv->bv_page = nth_page(bv->bv_page, 1); bv->bv_offset = 0; } else { - bv->bv_page = bvec->bv_page; - bv->bv_offset = bvec->bv_offset; + bv->bv_page = bvec_nth_page(bvec->bv_page, bvec->bv_offset / + PAGE_SIZE); + bv->bv_offset = bvec->bv_offset & ~PAGE_MASK; } bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset, bvec->bv_len - iter_all->done); + iter_all->done += bv->bv_len; + + if (iter_all->done == bvec->bv_len) { + iter_all->idx++; + iter_all->done = 0; + } } /* |
