[PATCH 01/13] mm/gup: convert GUP code to use vma_flags_t

Barry Song baohua at kernel.org
Fri Nov 6 03:47:31 UTC 2026


On Fri, Nov 6, 2026 at 5:31 AM Lorenzo Stoakes (ARM) <ljs at kernel.org> wrote:
>
> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the GUP logic, both for the MMU and nommu variants.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>

Reviewed-by: Barry Song <baohua at kernel.org>

> ---
>  mm/gup.c | 45 ++++++++++++++++++++++++---------------------
>  1 file changed, 24 insertions(+), 21 deletions(-)
>

> @@ -1514,9 +1514,8 @@ static bool vma_permits_fault(struct vm_area_struct *vma,
>  {
>         bool write   = !!(fault_flags & FAULT_FLAG_WRITE);
>         bool foreign = !!(fault_flags & FAULT_FLAG_REMOTE);
> -       vm_flags_t vm_flags = write ? VM_WRITE : VM_READ;
>
> -       if (!(vm_flags & vma->vm_flags))
> +       if (!vma_test(vma, write ? VMA_WRITE_BIT : VMA_READ_BIT))
>                 return false;

This also improves readability. Thanks!

>



More information about the Linux-security-module-archive mailing list