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
commit0c023ef52d769ea064df2c86bcdf29cbedb0a9b7 (patch)
treee1982f78bb0f42266515ed4a6e5d5ddf96c05b6e /mm/shmem.c
parent069d849cde3a02c075548ac68a43ed97fc95ee34 (diff)
downloadlinux-0c023ef52d769ea064df2c86bcdf29cbedb0a9b7.tar.gz
linux-0c023ef52d769ea064df2c86bcdf29cbedb0a9b7.tar.bz2
linux-0c023ef52d769ea064df2c86bcdf29cbedb0a9b7.zip
mm/shmem: add shmem_alloc_folio()
Call vma_alloc_folio() directly instead of alloc_page_vma(). Add a shmem_alloc_page() wrapper to avoid changing the callers. Link: https://lkml.kernel.org/r/20220504182857.4013401-21-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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index d11dc37d332f..668d054728bc 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1544,17 +1544,23 @@ static struct page *shmem_alloc_hugepage(gfp_t gfp,
return &folio->page;
}
-static struct page *shmem_alloc_page(gfp_t gfp,
+static struct folio *shmem_alloc_folio(gfp_t gfp,
struct shmem_inode_info *info, pgoff_t index)
{
struct vm_area_struct pvma;
- struct page *page;
+ struct folio *folio;
shmem_pseudo_vma_init(&pvma, info, index);
- page = alloc_page_vma(gfp, &pvma, 0);
+ folio = vma_alloc_folio(gfp, 0, &pvma, 0, false);
shmem_pseudo_vma_destroy(&pvma);
- return page;
+ return folio;
+}
+
+static struct page *shmem_alloc_page(gfp_t gfp,
+ struct shmem_inode_info *info, pgoff_t index)
+{
+ return &shmem_alloc_folio(gfp, info, index)->page;
}
static struct page *shmem_alloc_and_acct_page(gfp_t gfp,