mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
swap: use bvec_set_page to initialize bvecs
Use the bvec_set_page helper to initialize bvecs. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230203150634.3199647-20-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
cc342a2193
commit
8976fa6d79
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user