mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 16:19:53 +00:00
fb0eb5df09
We will support multipage bvec soon, so initialize bvec table using the standardy way instead of writing the talbe directly. Otherwise it won't work any more once multipage bvec is enabled. Acked-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Shaohua Li <shli@fb.com>
20 lines
498 B
C
20 lines
498 B
C
/* generally called after bio_reset() for reseting bvec */
|
|
static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp,
|
|
int size)
|
|
{
|
|
int idx = 0;
|
|
|
|
/* initialize bvec table again */
|
|
do {
|
|
struct page *page = resync_fetch_page(rp, idx);
|
|
int len = min_t(int, size, PAGE_SIZE);
|
|
|
|
/*
|
|
* won't fail because the vec table is big
|
|
* enough to hold all these pages
|
|
*/
|
|
bio_add_page(bio, page, len, 0);
|
|
size -= len;
|
|
} while (idx++ < RESYNC_PAGES && size > 0);
|
|
}
|