diff options
| author | Lorenzo Stoakes <[email protected]> | 2025-06-18 19:42:53 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-07-10 05:42:13 +0000 |
| commit | bfbe71109fa40e8cc05a0f99e6734b7d76ee00b0 (patch) | |
| tree | 9a02712343f1715fc3706784632bead7296057d3 /tools/testing/vma/vma_internal.h | |
| parent | mm: change vm_get_page_prot() to accept vm_flags_t argument (diff) | |
| download | kernel-bfbe71109fa40e8cc05a0f99e6734b7d76ee00b0.tar.gz kernel-bfbe71109fa40e8cc05a0f99e6734b7d76ee00b0.zip | |
mm: update core kernel code to use vm_flags_t consistently
The core kernel code is currently very inconsistent in its use of
vm_flags_t vs. unsigned long. This prevents us from changing the type of
vm_flags_t in the future and is simply not correct, so correct this.
While this results in rather a lot of churn, it is a critical
pre-requisite for a future planned change to VMA flag type.
Additionally, update VMA userland tests to account for the changes.
To make review easier and to break things into smaller parts, driver and
architecture-specific changes is left for a subsequent commit.
The code has been adjusted to cascade the changes across all calling code
as far as is needed.
We will adjust architecture-specific and driver code in a subsequent patch.
Overall, this patch does not introduce any functional change.
Link: https://lkml.kernel.org/r/d1588e7bb96d1ea3fe7b9df2c699d5b4592d901d.1750274467.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <[email protected]>
Acked-by: Kees Cook <[email protected]>
Acked-by: Mike Rapoport (Microsoft) <[email protected]>
Acked-by: Jan Kara <[email protected]>
Acked-by: Christian Brauner <[email protected]>
Reviewed-by: Vlastimil Babka <[email protected]>
Acked-by: Oscar Salvador <[email protected]>
Reviewed-by: Pedro Falcato <[email protected]>
Acked-by: Zi Yan <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Jarkko Sakkinen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/testing/vma/vma_internal.h')
| -rw-r--r-- | tools/testing/vma/vma_internal.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index 3b1b45256d56..f684649b1008 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -1084,7 +1084,7 @@ static inline bool mpol_equal(struct mempolicy *, struct mempolicy *) } static inline void khugepaged_enter_vma(struct vm_area_struct *vma, - unsigned long vm_flags) + vm_flags_t vm_flags) { (void)vma; (void)vm_flags; @@ -1200,7 +1200,7 @@ bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot); /* Update vma->vm_page_prot to reflect vma->vm_flags. */ static inline void vma_set_page_prot(struct vm_area_struct *vma) { - unsigned long vm_flags = vma->vm_flags; + vm_flags_t vm_flags = vma->vm_flags; pgprot_t vm_page_prot; /* testing: we inline vm_pgprot_modify() to avoid clash with vma.h. */ @@ -1280,12 +1280,12 @@ static inline bool capable(int cap) return true; } -static inline bool mlock_future_ok(struct mm_struct *mm, unsigned long flags, +static inline bool mlock_future_ok(struct mm_struct *mm, vm_flags_t vm_flags, unsigned long bytes) { unsigned long locked_pages, limit_pages; - if (!(flags & VM_LOCKED) || capable(CAP_IPC_LOCK)) + if (!(vm_flags & VM_LOCKED) || capable(CAP_IPC_LOCK)) return true; locked_pages = bytes >> PAGE_SHIFT; |
