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

From: Barry Song

Date: Thu Nov 05 2026 - 22:48:23 EST


On Fri, Nov 6, 2026 at 5:31 AM Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx> 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@xxxxxxxxxx>

Reviewed-by: Barry Song <baohua@xxxxxxxxxx>

> ---
> 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!

>