diff options
author | Vishal Moola (Oracle) <vishal.moola@gmail.com> | 2023-06-13 19:13:10 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-06-19 16:19:34 -0700 |
commit | c9223a4aede774b0cea2a9944bc5dac48683e802 (patch) | |
tree | 5e306220a998c5ab4a636194d0e9bbd94bfe0292 /mm/gup_test.c | |
parent | 28fb54f6a2fd6cc471165cce1650a57dfbf49746 (diff) | |
download | linux-starfive-c9223a4aede774b0cea2a9944bc5dac48683e802.tar.gz linux-starfive-c9223a4aede774b0cea2a9944bc5dac48683e802.tar.bz2 linux-starfive-c9223a4aede774b0cea2a9944bc5dac48683e802.zip |
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/20230614021312.34085-4-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/gup_test.c')
-rw-r--r-- | mm/gup_test.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/gup_test.c b/mm/gup_test.c index 1668ce0e0783..26f45fe45c48 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -40,24 +40,25 @@ static void verify_dma_pinned(unsigned int cmd, struct page **pages, unsigned long nr_pages) { unsigned long i; - struct page *page; + struct folio *folio; switch (cmd) { case PIN_FAST_BENCHMARK: case PIN_BASIC_TEST: case PIN_LONGTERM_BENCHMARK: for (i = 0; i < nr_pages; i++) { - page = pages[i]; - if (WARN(!page_maybe_dma_pinned(page), + folio = page_folio(pages[i]); + + if (WARN(!folio_maybe_dma_pinned(folio), "pages[%lu] is NOT dma-pinned\n", i)) { - dump_page(page, "gup_test failure"); + dump_page(&folio->page, "gup_test failure"); break; } else if (cmd == PIN_LONGTERM_BENCHMARK && - WARN(!is_longterm_pinnable_page(page), + WARN(!folio_is_longterm_pinnable(folio), "pages[%lu] is NOT pinnable but pinned\n", i)) { - dump_page(page, "gup_test failure"); + dump_page(&folio->page, "gup_test failure"); break; } } |