Re: [PATCH 9/9] filemap: Remove FGP_NOFS

From: Jan Kara

Date: Mon Aug 31 2026 - 06:42:48 EST


On Sun 30-08-26 05:18:56, Matthew Wilcox (Oracle) wrote:
> There are no more users of FGP_NOFS. Remove it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Honza

> ---
> include/linux/pagemap.h | 10 ++++------
> mm/filemap.c | 2 --
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 3974b063a049..bff8b7264fb0 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -697,7 +697,6 @@ pgoff_t page_cache_prev_miss(struct address_space *mapping,
> * folio is already in cache. If the folio was allocated, unlock it
> * before returning so the caller can do the same dance.
> * * %FGP_WRITE - The folio will be written to by the caller.
> - * * %FGP_NOFS - __GFP_FS will get cleared in gfp.
> * * %FGP_NOWAIT - Don't block on the folio lock.
> * * %FGP_STABLE - Wait for the folio to be stable (finished writeback)
> * * %FGP_DONTCACHE - Uncached buffered IO
> @@ -710,11 +709,10 @@ typedef unsigned int __bitwise fgf_t;
> #define FGP_LOCK ((__force fgf_t)0x00000002)
> #define FGP_CREAT ((__force fgf_t)0x00000004)
> #define FGP_WRITE ((__force fgf_t)0x00000008)
> -#define FGP_NOFS ((__force fgf_t)0x00000010)
> -#define FGP_NOWAIT ((__force fgf_t)0x00000020)
> -#define FGP_FOR_MMAP ((__force fgf_t)0x00000040)
> -#define FGP_STABLE ((__force fgf_t)0x00000080)
> -#define FGP_DONTCACHE ((__force fgf_t)0x00000100)
> +#define FGP_NOWAIT ((__force fgf_t)0x00000010)
> +#define FGP_FOR_MMAP ((__force fgf_t)0x00000020)
> +#define FGP_STABLE ((__force fgf_t)0x00000040)
> +#define FGP_DONTCACHE ((__force fgf_t)0x00000080)
> #define FGF_GET_ORDER(fgf) (((__force unsigned)fgf) >> 26) /* top 6 bits */
>
> #define FGP_WRITEBEGIN (FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE)
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 6afec636881f..e6580291f218 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -1994,8 +1994,6 @@ struct folio *__filemap_get_folio_mpol(struct address_space *mapping,
>
> if ((fgp_flags & FGP_WRITE) && mapping_can_writeback(mapping))
> gfp |= __GFP_WRITE;
> - if (fgp_flags & FGP_NOFS)
> - gfp &= ~__GFP_FS;
> if (fgp_flags & FGP_NOWAIT) {
> gfp &= ~GFP_KERNEL;
> gfp |= GFP_NOWAIT;
> --
> 2.47.3
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR