Lets move vma_is_accessible() helper to include/linux/mm.h which makes it available for general use. While here, this replaces all remaining open encodings for VMA access check with vma_is_accessible().
Showing the changes to include/linux (1 of 12 files). Show all
Unified · Split
| @@ -629,6 +629,12 @@ static inline bool vma_is_foreign(struct vm_area_struct *vma) · 628 unmodified lines | ||
| 629 | 629 | |
| 630 | 630 | return false; |
| 631 | 631 | } |
| 632 | + | |
| 633 | +static inline bool vma_is_accessible(struct vm_area_struct *vma) | |
| 634 | +{ | |
| 635 | + return vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC); | |
| 636 | +} | |
| 637 | + | |
| 632 | 638 | #ifdef CONFIG_SHMEM |
| 633 | 639 | /* |
| 634 | 640 | * The vma_is_shmem is not inline because it is used only by slow |