]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/hugetlb: Pass boolean to hugetlb_mfill_prepare() instead of flags
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 28 Oct 2025 16:24:18 +0000 (12:24 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 30 Oct 2025 16:46:01 +0000 (12:46 -0400)
uffd_flags_t is used all over the place to communicate if the operation
is requesting write protection.  Just pass a boolean stating true for
write protection or false for not.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/hugetlb.c

index fee92ecd274d0cdc312eb1e80930c9a8d7ba4998..55c0beb9107ad18666182191db82fa63876bc96f 100644 (file)
@@ -6939,7 +6939,7 @@ out_mutex:
 
 static inline
 ssize_t hugetlb_mfill_prepare(struct vm_area_struct *dst_vma, unsigned long dst_addr,
-               unsigned long increment, pte_t **dst_pte, u32 *hash, uffd_flags_t flags)
+               unsigned long increment, pte_t **dst_pte, u32 *hash, bool wp)
 {
        struct mm_struct *dst_mm = dst_vma->vm_mm;
        struct address_space *mapping;
@@ -6963,7 +6963,7 @@ ssize_t hugetlb_mfill_prepare(struct vm_area_struct *dst_vma, unsigned long dst_
                return -ENOMEM;
        }
 
-       if (!uffd_flags_mode_is(flags, MFILL_ATOMIC_CONTINUE) &&
+       if (!wp &&
            !huge_pte_none_mostly(huge_ptep_get(dst_mm, dst_addr, *dst_pte))) {
                hugetlb_vma_unlock_read(dst_vma);
                mutex_unlock(&hugetlb_fault_mutex_table[*hash]);
@@ -7077,7 +7077,7 @@ static int hugetlb_mfill_pte_continue(struct vm_area_struct *dst_vma,
        u32 hash;
 
        ret = hugetlb_mfill_prepare(dst_vma, dst_addr, increment,
-                                   &dst_pte, &hash, flags);
+                                   &dst_pte, &hash, flags & MFILL_ATOMIC_WP);
        if (ret)
                return ret;
 
@@ -7179,7 +7179,7 @@ static int hugetlb_mfill_atomic_pte_copy(struct vm_area_struct *dst_vma,
        u32 hash;
 
        ret = hugetlb_mfill_prepare(dst_vma, dst_addr, increment,
-                                   &dst_pte, &hash, flags);
+                                   &dst_pte, &hash, wp_enabled);
        if (ret)
                return ret;