summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 21:46:20 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 23:02:49 +0200
commit4e1fc793ad9892cec67b40c9f67583160e08f695 (patch)
tree97904bfc9f4dbd38fd4b6c4e8d0c52de6aa856f2 /mm/shmem.c
parentshmem: convert shmem_read_mapping_page_gfp() to use shmem_get_folio_gfp() (diff)
downloadlinux-4e1fc793ad9892cec67b40c9f67583160e08f695.tar.xz
linux-4e1fc793ad9892cec67b40c9f67583160e08f695.zip
shmem: add shmem_get_folio()
With no remaining callers of shmem_getpage_gfp(), add shmem_get_folio() and reimplement shmem_getpage() as a call to shmem_get_folio(). Link: https://lkml.kernel.org/r/20220902194653.1739778-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index c3e2a65a65fc..32afc8039e66 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2025,14 +2025,18 @@ unlock:
return error;
}
-static int shmem_getpage_gfp(struct inode *inode, pgoff_t index,
- struct page **pagep, enum sgp_type sgp,
- gfp_t gfp, struct vm_area_struct *vma,
- struct vm_fault *vmf, vm_fault_t *fault_type)
+int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop,
+ enum sgp_type sgp)
+{
+ return shmem_get_folio_gfp(inode, index, foliop, sgp,
+ mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL);
+}
+
+int shmem_getpage(struct inode *inode, pgoff_t index,
+ struct page **pagep, enum sgp_type sgp)
{
struct folio *folio = NULL;
- int ret = shmem_get_folio_gfp(inode, index, &folio, sgp, gfp, vma,
- vmf, fault_type);
+ int ret = shmem_get_folio(inode, index, &folio, sgp);
if (folio)
*pagep = folio_file_page(folio, index);
@@ -2041,13 +2045,6 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index,
return ret;
}
-int shmem_getpage(struct inode *inode, pgoff_t index,
- struct page **pagep, enum sgp_type sgp)
-{
- return shmem_getpage_gfp(inode, index, pagep, sgp,
- mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL);
-}
-
/*
* This is like autoremove_wake_function, but it removes the wait queue
* entry unconditionally - even if something else had already woken the