mm: remove some calls to page_add_new_anon_rmap()
We already have the folio in these functions, we just need to use it. folio_add_new_anon_rmap() didn't exist at the time they were converted to folios. Link: https://lkml.kernel.org/r/20231211162214.2146080-5-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>
This commit is contained in:
parent
f00f48436c
commit
2853b66b60
|
@ -181,7 +181,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
|
||||||
|
|
||||||
if (new_page) {
|
if (new_page) {
|
||||||
folio_get(new_folio);
|
folio_get(new_folio);
|
||||||
page_add_new_anon_rmap(new_page, vma, addr);
|
folio_add_new_anon_rmap(new_folio, vma, addr);
|
||||||
folio_add_lru_vma(new_folio, vma);
|
folio_add_lru_vma(new_folio, vma);
|
||||||
} else
|
} else
|
||||||
/* no new page, just dec_mm_counter for old_page */
|
/* no new page, just dec_mm_counter for old_page */
|
||||||
|
|
|
@ -4071,7 +4071,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
|
||||||
|
|
||||||
/* ksm created a completely new copy */
|
/* ksm created a completely new copy */
|
||||||
if (unlikely(folio != swapcache && swapcache)) {
|
if (unlikely(folio != swapcache && swapcache)) {
|
||||||
page_add_new_anon_rmap(page, vma, vmf->address);
|
folio_add_new_anon_rmap(folio, vma, vmf->address);
|
||||||
folio_add_lru_vma(folio, vma);
|
folio_add_lru_vma(folio, vma);
|
||||||
} else {
|
} else {
|
||||||
page_add_anon_rmap(page, vma, vmf->address, rmap_flags);
|
page_add_anon_rmap(page, vma, vmf->address, rmap_flags);
|
||||||
|
|
|
@ -116,7 +116,7 @@ int mfill_atomic_install_pte(pmd_t *dst_pmd,
|
||||||
folio_add_lru(folio);
|
folio_add_lru(folio);
|
||||||
page_add_file_rmap(page, dst_vma, false);
|
page_add_file_rmap(page, dst_vma, false);
|
||||||
} else {
|
} else {
|
||||||
page_add_new_anon_rmap(page, dst_vma, dst_addr);
|
folio_add_new_anon_rmap(folio, dst_vma, dst_addr);
|
||||||
folio_add_lru_vma(folio, dst_vma);
|
folio_add_lru_vma(folio, dst_vma);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue