diff options
| author | Jens Axboe <axboe@kernel.dk> | 2019-04-22 11:47:36 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-04-22 11:47:36 -0400 |
| commit | 5c61ee2cd5860e41c8ab98837761ffaa93eb4dfe (patch) | |
| tree | 0c78e25f5020eeee47863092ccbb2a3f56bea8a9 /include/linux/bvec.h | |
| parent | cdf3e3deb747d5e193dee617ed37c83060eb576f (diff) | |
| parent | 085b7755808aa11f78ab9377257e1dad2e6fa4bb (diff) | |
Merge tag 'v5.1-rc6' into for-5.2/block
Pull in v5.1-rc6 to resolve two conflicts. One is in BFQ, in just a
comment, and is trivial. The other one is a conflict due to a later fix
in the bio multi-page work, and needs a bit more care.
* tag 'v5.1-rc6': (770 commits)
Linux 5.1-rc6
block: make sure that bvec length can't be overflow
block: kill all_q_node in request_queue
x86/cpu/intel: Lower the "ENERGY_PERF_BIAS: Set to normal" message's log priority
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
mm/kmemleak.c: fix unused-function warning
init: initialize jump labels before command line option parsing
kernel/watchdog_hld.c: hard lockup message should end with a newline
kcov: improve CONFIG_ARCH_HAS_KCOV help text
mm: fix inactive list balancing between NUMA nodes and cgroups
mm/hotplug: treat CMA pages as unmovable
proc: fixup proc-pid-vm test
proc: fix map_files test on F29
mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n
mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock
mm: swapoff: shmem_unuse() stop eviction without igrab()
mm: swapoff: take notice of completion sooner
mm: swapoff: remove too limiting SWAP_UNUSE_MAX_TRIES
mm: swapoff: shmem_find_swap_entries() filter out other types
slab: store tagged freelist for off-slab slabmgmt
...
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/bvec.h')
| -rw-r--r-- | include/linux/bvec.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 44b0f4684190..a4811410e4fc 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h | |||
| @@ -140,26 +140,38 @@ static inline bool bvec_iter_advance(const struct bio_vec *bv, | |||
| 140 | 140 | ||
| 141 | static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) | 141 | static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) |
| 142 | { | 142 | { |
| 143 | iter_all->bv.bv_page = NULL; | ||
| 144 | iter_all->done = 0; | 143 | iter_all->done = 0; |
| 144 | iter_all->idx = 0; | ||
| 145 | 145 | ||
| 146 | return &iter_all->bv; | 146 | return &iter_all->bv; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | static inline void mp_bvec_next_segment(const struct bio_vec *bvec, | 149 | static inline struct page *bvec_nth_page(struct page *page, int idx) |
| 150 | struct bvec_iter_all *iter_all) | 150 | { |
| 151 | return idx == 0 ? page : nth_page(page, idx); | ||
| 152 | } | ||
| 153 | |||
| 154 | static inline void bvec_advance(const struct bio_vec *bvec, | ||
| 155 | struct bvec_iter_all *iter_all) | ||
| 151 | { | 156 | { |
| 152 | struct bio_vec *bv = &iter_all->bv; | 157 | struct bio_vec *bv = &iter_all->bv; |
| 153 | 158 | ||
| 154 | if (bv->bv_page) { | 159 | if (iter_all->done) { |
| 155 | bv->bv_page++; | 160 | bv->bv_page++; |
| 156 | bv->bv_offset = 0; | 161 | bv->bv_offset = 0; |
| 157 | } else { | 162 | } else { |
| 158 | bv->bv_page = bvec->bv_page; | 163 | bv->bv_page = bvec_nth_page(bvec->bv_page, bvec->bv_offset / |
| 159 | bv->bv_offset = bvec->bv_offset; | 164 | PAGE_SIZE); |
| 165 | bv->bv_offset = bvec->bv_offset & ~PAGE_MASK; | ||
| 160 | } | 166 | } |
| 161 | bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset, | 167 | bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset, |
| 162 | bvec->bv_len - iter_all->done); | 168 | bvec->bv_len - iter_all->done); |
| 169 | iter_all->done += bv->bv_len; | ||
| 170 | |||
| 171 | if (iter_all->done == bvec->bv_len) { | ||
| 172 | iter_all->idx++; | ||
| 173 | iter_all->done = 0; | ||
| 174 | } | ||
| 163 | } | 175 | } |
| 164 | 176 | ||
| 165 | /* | 177 | /* |
