diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2025-04-03 00:06:05 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-05-12 03:48:05 +0300 |
commit | b57f4f4f186d728a1b484be1f214f17d843b6a24 (patch) | |
tree | b5edab2ebbe3c8a9a624f4d1c544f25e3f8cbcbc /lib | |
parent | a55139579082e4bc9ea9b04003cb9f78c781e08b (diff) | |
download | linux-b57f4f4f186d728a1b484be1f214f17d843b6a24.tar.xz |
iov_iter: convert iter_xarray_populate_pages() to use folios
ITER_XARRAY is exclusively used with xarrays that contain folios, not
pages, so extract folio pointers from it, not page pointers. Removes a
hidden call to compound_head() and a use of find_subpage().
Link: https://lkml.kernel.org/r/20250402210612.2444135-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/iov_iter.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index bc9391e55d57..3e340d1fcadc 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1059,22 +1059,22 @@ static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa pgoff_t index, unsigned int nr_pages) { XA_STATE(xas, xa, index); - struct page *page; + struct folio *folio; unsigned int ret = 0; rcu_read_lock(); - for (page = xas_load(&xas); page; page = xas_next(&xas)) { - if (xas_retry(&xas, page)) + for (folio = xas_load(&xas); folio; folio = xas_next(&xas)) { + if (xas_retry(&xas, folio)) continue; - /* Has the page moved or been split? */ - if (unlikely(page != xas_reload(&xas))) { + /* Has the folio moved or been split? */ + if (unlikely(folio != xas_reload(&xas))) { xas_reset(&xas); continue; } - pages[ret] = find_subpage(page, xas.xa_index); - get_page(pages[ret]); + pages[ret] = folio_file_page(folio, xas.xa_index); + folio_get(folio); if (++ret == nr_pages) break; } |