Commit 8976fa6d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

swap: use bvec_set_page to initialize bvecs

Use the bvec_set_page helper to initialize bvecs.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230203150634.3199647-20-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent cc342a21
......@@ -318,9 +318,7 @@ static int swap_writepage_fs(struct page *page, struct writeback_control *wbc)
sio->pages = 0;
sio->len = 0;
}
sio->bvec[sio->pages].bv_page = page;
sio->bvec[sio->pages].bv_len = thp_size(page);
sio->bvec[sio->pages].bv_offset = 0;
bvec_set_page(&sio->bvec[sio->pages], page, thp_size(page), 0);
sio->len += thp_size(page);
sio->pages += 1;
if (sio->pages == ARRAY_SIZE(sio->bvec) || !wbc->swap_plug) {
......@@ -432,9 +430,7 @@ static void swap_readpage_fs(struct page *page,
sio->pages = 0;
sio->len = 0;
}
sio->bvec[sio->pages].bv_page = page;
sio->bvec[sio->pages].bv_len = thp_size(page);
sio->bvec[sio->pages].bv_offset = 0;
bvec_set_page(&sio->bvec[sio->pages], page, thp_size(page), 0);
sio->len += thp_size(page);
sio->pages += 1;
if (sio->pages == ARRAY_SIZE(sio->bvec) || !plug) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment