Re: [PATCH mm-new v2 1/5] mm: remove unused helpers from pagemap.h

From: Garg, Shivank

Date: Thu Nov 19 2026 - 00:21:42 EST


On Tue, 2026-11-17 at 07:16 +0000, Shivank Garg wrote:
> invalidate_remote_inode() lost its last user in commit d73065e60dcc
> ("afs: Use alternative invalidation to using launder_folio").
> mapping_clear_release_always() has no callers.
>
> Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
> ---
> include/linux/pagemap.h | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 73af18a37367..e681a7ba6642 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -20,12 +20,6 @@ struct folio_batch;
> unsigned long invalidate_mapping_pages(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
>
> -static inline void invalidate_remote_inode(struct inode *inode)
> -{
> - if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
> - S_ISLNK(inode->i_mode))
> - invalidate_mapping_pages(inode->i_mapping, 0, -1);
> -}
> int invalidate_inode_pages2(struct address_space *mapping);
> int invalidate_inode_pages2_range(struct address_space *mapping,
> pgoff_t start, pgoff_t end);
> @@ -298,11 +292,6 @@ static inline void mapping_set_release_always(struct address_space *mapping)
> set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> }
>
> -static inline void mapping_clear_release_always(struct address_space *mapping)
> -{
> - clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> -}
> -
> static inline bool mapping_stable_writes(const struct address_space *mapping)
> {
> return test_bit(AS_STABLE_WRITES, &mapping->flags);


Hi Willy,

I checked now that MAINTAINERS lists for pagemap.h to your tree

git://git.infradead.org/users/willy/pagecache.git

Rest of this series files go through Andrew's tree.
What would you prefer: should I send this patch separately, rebased on your
tree, or is it fine to keep it in this series for Andrew to pick up?


As suggested by Dev, additional info to fold into commit:

mapping_clear_release_always() was added in b4fa966f03b7 ("mm, netfs,
fscache: stop read optimisation when folio removed from pagecache") and
never had a caller. Earlier version of had called it from ->evict_inode()
but V4 dropped those calls as unnecessary [1] leaving the helper.

[1] https://lore.kernel.org/all/166924370539.1772793.13730698360771821317.stgit@xxxxxxxxxxxxxxxxxxxxxx

Thanks,
Shivank