mm/vma: introduce VM_ACCESS_FLAGS

There are many places where all basic VMA access flags (read, write,
exec) are initialized or checked against as a group.  One such example
is during page fault.  Existing vma_is_accessible() wrapper already
creates the notion of VMA accessibility as a group access permissions.

Hence lets just create VM_ACCESS_FLAGS (VM_READ|VM_WRITE|VM_EXEC) which
will not only reduce code duplication but also extend the VMA
accessibility concept in general.

Signed-off-by: Anshuman Khandual <>
Signed-off-by: Andrew Morton <>
Reviewed-by: Vlastimil Babka <>
Cc: Russell King <>
Cc: Catalin Marinas <>
Cc: Mark Salter <>
Cc: Nick Hu <>
Cc: Ley Foon Tan <>
Cc: Michael Ellerman <>
Cc: Heiko Carstens <>
Cc: Yoshinori Sato <>
Cc: Guan Xuetao <>
Cc: Dave Hansen <>
Cc: Thomas Gleixner <>
Cc: Rob Springer <>
Cc: Greg Kroah-Hartman <>
Cc: Geert Uytterhoeven <>
Signed-off-by: Linus Torvalds <>
11 files changed