Skip to content

Commit c9223a4

Browse files
VMoolaakpm00
authored andcommitted
mm/gup_test.c: convert verify_dma_pinned() to us folios
verify_dma_pinned() checks that pages are dma-pinned. We can convert this to use folios. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Vishal Moola (Oracle) <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 28fb54f commit c9223a4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mm/gup_test.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,25 @@ static void verify_dma_pinned(unsigned int cmd, struct page **pages,
4040
unsigned long nr_pages)
4141
{
4242
unsigned long i;
43-
struct page *page;
43+
struct folio *folio;
4444

4545
switch (cmd) {
4646
case PIN_FAST_BENCHMARK:
4747
case PIN_BASIC_TEST:
4848
case PIN_LONGTERM_BENCHMARK:
4949
for (i = 0; i < nr_pages; i++) {
50-
page = pages[i];
51-
if (WARN(!page_maybe_dma_pinned(page),
50+
folio = page_folio(pages[i]);
51+
52+
if (WARN(!folio_maybe_dma_pinned(folio),
5253
"pages[%lu] is NOT dma-pinned\n", i)) {
5354

54-
dump_page(page, "gup_test failure");
55+
dump_page(&folio->page, "gup_test failure");
5556
break;
5657
} else if (cmd == PIN_LONGTERM_BENCHMARK &&
57-
WARN(!is_longterm_pinnable_page(page),
58+
WARN(!folio_is_longterm_pinnable(folio),
5859
"pages[%lu] is NOT pinnable but pinned\n",
5960
i)) {
60-
dump_page(page, "gup_test failure");
61+
dump_page(&folio->page, "gup_test failure");
6162
break;
6263
}
6364
}

0 commit comments

Comments
 (0)