Re: [PATCH 7/8] mm: remove read_cache_page_gfp()

From: Lorenzo Stoakes (ARM)

Date: Tue Nov 03 2026 - 03:56:31 EST


On Mon, Nov 02, 2026 at 05:54:12PM -0500, Tal Zussman wrote:
> There are no callers left. Point the comment on shmem_read_folio_gfp()
> at mapping_read_folio_gfp() instead.
>
> Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>

LGTM!

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>

> ---
> include/linux/pagemap.h | 2 --
> mm/filemap.c | 23 -----------------------
> mm/shmem.c | 4 ++--
> 3 files changed, 2 insertions(+), 27 deletions(-)
>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index a92329805acd..305c99bad689 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -962,8 +962,6 @@ struct folio *mapping_read_folio_gfp(struct address_space *, pgoff_t index,
> gfp_t flags);
> struct page *read_cache_page(struct address_space *, pgoff_t index,
> filler_t *filler, struct file *file);
> -extern struct page * read_cache_page_gfp(struct address_space *mapping,
> - pgoff_t index, gfp_t gfp_mask);
>
> static inline struct page *read_mapping_page(struct address_space *mapping,
> pgoff_t index, struct file *file)
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 1df776907140..2b724d9be94b 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -4258,29 +4258,6 @@ struct page *read_cache_page(struct address_space *mapping,
> }
> EXPORT_SYMBOL(read_cache_page);
>
> -/**
> - * read_cache_page_gfp - read into page cache, using specified page allocation flags.
> - * @mapping: the page's address_space
> - * @index: the page index
> - * @gfp: the page allocator flags to use if allocating
> - *
> - * This is the same as "read_mapping_page(mapping, index, NULL)", but with
> - * any new page allocations done using the specified allocation flags.
> - *
> - * If the page does not get brought uptodate, return -EIO.
> - *
> - * The function expects mapping->invalidate_lock to be already held.
> - *
> - * Return: up to date page on success, ERR_PTR() on failure.
> - */
> -struct page *read_cache_page_gfp(struct address_space *mapping,
> - pgoff_t index,
> - gfp_t gfp)

Also eliminates this very weird line-wrapping... :)

> -{
> - return do_read_cache_page(mapping, index, NULL, NULL, gfp);
> -}
> -EXPORT_SYMBOL(read_cache_page_gfp);
> -
> /*
> * Warn about a page cache invalidation failure during a direct I/O write.
> */
> diff --git a/mm/shmem.c b/mm/shmem.c
> index de838dbb4df8..16b1cc3d8ac5 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -6190,9 +6190,9 @@ int shmem_zero_setup_desc(struct vm_area_desc *desc)
> * @index: the folio index
> * @gfp: the page allocator flags to use if allocating
> *
> - * This behaves as a tmpfs "read_cache_page_gfp(mapping, index, gfp)",
> + * This behaves as a tmpfs "mapping_read_folio_gfp(mapping, index, gfp)",
> * with any new page allocations done using the specified allocation flags.
> - * But read_cache_page_gfp() uses the ->read_folio() method: which does not
> + * But mapping_read_folio_gfp() uses the ->read_folio() method: which does not
> * suit tmpfs, since it may have pages in swapcache, and needs to find those
> * for itself; although drivers/gpu/drm i915 and ttm rely upon this support.
> *
>
> --
> 2.39.5
>

--
Cheers, Lorenzo