Commit dba438bd authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

rmap: pass the folio to __page_check_anon_rmap()

The lone caller already has the folio, so pass it in instead of deriving
it from the page again.

Link: https://lkml.kernel.org/r/20230706195251.2707542-1-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 35fb4764
...@@ -1175,14 +1175,14 @@ static void __page_set_anon_rmap(struct folio *folio, struct page *page, ...@@ -1175,14 +1175,14 @@ static void __page_set_anon_rmap(struct folio *folio, struct page *page,
/** /**
* __page_check_anon_rmap - sanity check anonymous rmap addition * __page_check_anon_rmap - sanity check anonymous rmap addition
* @page: the page to add the mapping to * @folio: The folio containing @page.
* @page: the page to check the mapping of
* @vma: the vm area in which the mapping is added * @vma: the vm area in which the mapping is added
* @address: the user virtual address mapped * @address: the user virtual address mapped
*/ */
static void __page_check_anon_rmap(struct page *page, static void __page_check_anon_rmap(struct folio *folio, struct page *page,
struct vm_area_struct *vma, unsigned long address) struct vm_area_struct *vma, unsigned long address)
{ {
struct folio *folio = page_folio(page);
/* /*
* The page's anon-rmap details (mapping and index) are guaranteed to * The page's anon-rmap details (mapping and index) are guaranteed to
* be set up correctly at this point. * be set up correctly at this point.
...@@ -1262,7 +1262,7 @@ void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma, ...@@ -1262,7 +1262,7 @@ void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma,
__page_set_anon_rmap(folio, page, vma, address, __page_set_anon_rmap(folio, page, vma, address,
!!(flags & RMAP_EXCLUSIVE)); !!(flags & RMAP_EXCLUSIVE));
else else
__page_check_anon_rmap(page, vma, address); __page_check_anon_rmap(folio, page, vma, address);
} }
mlock_vma_folio(folio, vma, compound); mlock_vma_folio(folio, vma, compound);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment