Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: introduce mp_bvec_for_each_page() for iterating over page

mp_bvec_for_each_segment() is a bit big for the iteration, so introduce
a light-weight helper for iterating over pages, then 32bytes stack
space can be saved.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
594b9a89 bbcbbd56

+5
+5
include/linux/bvec.h
··· 188 188 } 189 189 } 190 190 191 + #define mp_bvec_for_each_page(pg, bv, i) \ 192 + for (i = (bv)->bv_offset / PAGE_SIZE; \ 193 + (i <= (((bv)->bv_offset + (bv)->bv_len - 1) / PAGE_SIZE)) && \ 194 + (pg = bvec_nth_page((bv)->bv_page, i)); i += 1) 195 + 191 196 #endif /* __LINUX_BVEC_ITER_H */