mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
mm/gup: drop nth_page() usage within folio when recording subpages
nth_page() is no longer required when iterating over pages within a single folio, so let's just drop it when recording subpages. Link: https://lkml.kernel.org/r/20250901150359.867252-19-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
1a55ac6068
commit
541541dbfe
1 changed files with 3 additions and 4 deletions
7
mm/gup.c
7
mm/gup.c
|
|
@ -488,12 +488,11 @@ static int record_subpages(struct page *page, unsigned long sz,
|
|||
unsigned long addr, unsigned long end,
|
||||
struct page **pages)
|
||||
{
|
||||
struct page *start_page;
|
||||
int nr;
|
||||
|
||||
start_page = nth_page(page, (addr & (sz - 1)) >> PAGE_SHIFT);
|
||||
page += (addr & (sz - 1)) >> PAGE_SHIFT;
|
||||
for (nr = 0; addr != end; nr++, addr += PAGE_SIZE)
|
||||
pages[nr] = nth_page(start_page, nr);
|
||||
pages[nr] = page++;
|
||||
|
||||
return nr;
|
||||
}
|
||||
|
|
@ -1512,7 +1511,7 @@ next_page:
|
|||
}
|
||||
|
||||
for (j = 0; j < page_increm; j++) {
|
||||
subpage = nth_page(page, j);
|
||||
subpage = page + j;
|
||||
pages[i + j] = subpage;
|
||||
flush_anon_page(vma, subpage, start + j * PAGE_SIZE);
|
||||
flush_dcache_page(subpage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue