[PATCH v2 09/13] mm: update all remaining mmap_prepare users to use vma_flags_t

Andrew Morton akpm at linux-foundation.org
Sat Feb 7 06:31:53 AEDT 2026


On Fri, 6 Feb 2026 17:46:36 +0000 Pedro Falcato <pfalcato at suse.de> wrote:

> > -#define VM_REMAP_FLAGS (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > +#define VMA_REMAP_FLAGS mk_vma_flags(VMA_IO_BIT, VMA_PFNMAP_BIT,	\
> > +				     VMA_DONTEXPAND_BIT, VMA_DONTDUMP_BIT)
> 
> as a sidenote, these flags are no longer constant expressions and thus
> 
> static vma_flags_t flags = VMA_REMAP_FLAGS;
> 
> can't compile.

Yup, that isn't nice.  An all-caps thing with no () is a compile-time
constant.

It looks like we can make this a nice inlined (commented!) lower-cased
C function as a little low-priority cleanup.

> Rest LGTM though.
> 
> Acked-by: Pedro Falcato <pfalcato at suse.de>

Great, thanks.


More information about the Linux-erofs mailing list