# Re: \[PATCH 01/13\] mm/gup: convert GUP code to use vma\_flags\_t

- From: Barry Song \<baohua@kernel.org\>
- Date: 2026-11-06 03:47:44 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/11/17875405
- Thread: https://ratatoskr.run/linux-mm/2026/11/17874173/t.md

```text
On Fri, Nov 6, 2026 at 5:31 AM Lorenzo Stoakes (ARM) [ref] 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@kernel.org>

Reviewed-by: Barry Song <baohua@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!

>

```
