summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-12 20:23:04 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:16 -0700
commit069d849cde3a02c075548ac68a43ed97fc95ee34 (patch)
tree0dfbeca56cebe4a8135a4e047fee30f642a84247 /mm/shmem.c
parentb7dd44a12cf26603712e60f1e1449c87d5f8cb79 (diff)
downloadlinux-069d849cde3a02c075548ac68a43ed97fc95ee34.tar.gz
linux-069d849cde3a02c075548ac68a43ed97fc95ee34.tar.bz2
linux-069d849cde3a02c075548ac68a43ed97fc95ee34.zip
mm/shmem: turn shmem_should_replace_page into shmem_should_replace_folio
This is a straightforward conversion. Link: https://lkml.kernel.org/r/20220504182857.4013401-20-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 2e800d4e0d03..d11dc37d332f 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1601,9 +1601,9 @@ failed:
* NUMA mempolicy, and applied also to anonymous pages in do_swap_page();
* but for now it is a simple matter of zone.
*/
-static bool shmem_should_replace_page(struct page *page, gfp_t gfp)
+static bool shmem_should_replace_folio(struct folio *folio, gfp_t gfp)
{
- return page_zonenum(page) > gfp_zone(gfp);
+ return folio_zonenum(folio) > gfp_zone(gfp);
}
static int shmem_replace_page(struct page **pagep, gfp_t gfp,
@@ -1735,13 +1735,13 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index,
*/
arch_swap_restore(swap, page);
- if (shmem_should_replace_page(page, gfp)) {
+ folio = page_folio(page);
+ if (shmem_should_replace_folio(folio, gfp)) {
error = shmem_replace_page(&page, gfp, info, index);
if (error)
goto failed;
}
- folio = page_folio(page);
error = shmem_add_to_page_cache(folio, mapping, index,
swp_to_radix_entry(swap), gfp,
charge_mm);