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

shmem: remove shmem_getpage()

With all callers removed, remove this wrapper function.  The flags are now
mysteriously called SGP, but I think we can live with that.

Link: https://lkml.kernel.org/r/20220902194653.1739778-34-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 12acf4fb
...@@ -102,7 +102,7 @@ extern unsigned long shmem_swap_usage(struct vm_area_struct *vma); ...@@ -102,7 +102,7 @@ extern unsigned long shmem_swap_usage(struct vm_area_struct *vma);
extern unsigned long shmem_partial_swap_usage(struct address_space *mapping, extern unsigned long shmem_partial_swap_usage(struct address_space *mapping,
pgoff_t start, pgoff_t end); pgoff_t start, pgoff_t end);
/* Flag allocation requirements to shmem_getpage */ /* Flag allocation requirements to shmem_get_folio */
enum sgp_type { enum sgp_type {
SGP_READ, /* don't exceed i_size, don't allocate page */ SGP_READ, /* don't exceed i_size, don't allocate page */
SGP_NOALLOC, /* similar, but fail on hole or use fallocated page */ SGP_NOALLOC, /* similar, but fail on hole or use fallocated page */
...@@ -111,8 +111,6 @@ enum sgp_type { ...@@ -111,8 +111,6 @@ enum sgp_type {
SGP_FALLOC, /* like SGP_WRITE, but make existing page Uptodate */ SGP_FALLOC, /* like SGP_WRITE, but make existing page Uptodate */
}; };
extern int shmem_getpage(struct inode *inode, pgoff_t index,
struct page **pagep, enum sgp_type sgp);
int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop,
enum sgp_type sgp); enum sgp_type sgp);
......
...@@ -179,7 +179,7 @@ static inline int shmem_reacct_size(unsigned long flags, ...@@ -179,7 +179,7 @@ static inline int shmem_reacct_size(unsigned long flags,
/* /*
* ... whereas tmpfs objects are accounted incrementally as * ... whereas tmpfs objects are accounted incrementally as
* pages are allocated, in order to allow large sparse files. * pages are allocated, in order to allow large sparse files.
* shmem_getpage reports shmem_acct_block failure as -ENOSPC not -ENOMEM, * shmem_get_folio reports shmem_acct_block failure as -ENOSPC not -ENOMEM,
* so that a failure on a sparse tmpfs mapping will give SIGBUS not OOM. * so that a failure on a sparse tmpfs mapping will give SIGBUS not OOM.
*/ */
static inline int shmem_acct_block(unsigned long flags, long pages) static inline int shmem_acct_block(unsigned long flags, long pages)
...@@ -2031,19 +2031,6 @@ int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, ...@@ -2031,19 +2031,6 @@ int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop,
mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL); 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(inode, index, &folio, sgp);
if (folio)
*pagep = folio_file_page(folio, index);
else
*pagep = NULL;
return ret;
}
/* /*
* This is like autoremove_wake_function, but it removes the wait queue * This is like autoremove_wake_function, but it removes the wait queue
* entry unconditionally - even if something else had already woken the * entry unconditionally - even if something else had already woken the
......
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