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
Also in
damon, kvm, linux-fsdevel, linux-integrity, linux-mm, linux-perf-users, linux-security-module, linux-trace-kernel, lkml, selinux
Reply to
Lorenzo Stoakes (ARM), 2026-11-05
On Fri, Nov 6, 2026 at 5:31 AM Lorenzo Stoakes (ARM) [off-list 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>
quoted hunk ↗ jump to hunk
---
 mm/gup.c | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)
quoted hunk ↗ jump to hunk
@@ -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!
  
Thread (60 messages) 60 messages, 10 authors, last reply 15h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help